Move inline stylesheet cache decision making from StyleSheetContents to StyleEngine
This separates the decisions about caching StyleSheetContents for <style> elements from those related to <link> elements. This makes the code clearer as there are fewer conditions that could cause uncacheability (for example, the StyleSheetContents for <style> elements could never be for an @import rule). And since the <style> cache is per-StyleEngine (and thus per-Document), the <style> case can now safely cache stylesheets that include @media rules. This speeds up the included performance test from ~90ms on my Z620 to ~50ms, and improves the biggest block of chromestatus.com load performance by ~20%. This patch also cleans up StyleSheetContents a bit, collapsing the maybeCacheable() method into isCacheable() and making appropriate accessors const. BUG=342507 Review URL: https://codereview.chromium.org/196133034 git-svn-id: svn://svn.chromium.org/blink/trunk@169610 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment