Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Issue 196133034: Move inline stylesheet cache decision making from StyleSheetContents to StyleEngine (Closed)

Created:
6 years, 9 months ago by adamk
Modified:
6 years, 9 months ago
Reviewers:
esprehn, tasak
CC:
blink-reviews, sof, eae+blinkwatch, ed+blinkwatch_opera.com, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears, rune+blink, Inactive, rwlbuis, ojan
Visibility:
Public.

Description

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 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169610

Patch Set 1 #

Total comments: 2

Patch Set 2 : Renamed to isCachableForStyleElment #

Patch Set 3 : Merged to trunk #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -34 lines) Patch
A + PerformanceTests/ShadowDOM/shadow-style-share-media-query.html View 2 chunks +8 lines, -17 lines 0 comments Download
M Source/core/css/StyleSheetContents.h View 2 chunks +3 lines, -2 lines 0 comments Download
M Source/core/css/StyleSheetContents.cpp View 1 2 3 chunks +4 lines, -11 lines 0 comments Download
M Source/core/dom/StyleEngine.cpp View 1 2 chunks +21 lines, -4 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
adamk
6 years, 9 months ago (2014-03-19 22:25:06 UTC) #1
esprehn
lgtm, one of the names is a bit confusing but you can leave it if ...
6 years, 9 months ago (2014-03-19 22:32:14 UTC) #2
adamk
https://codereview.chromium.org/196133034/diff/1/Source/core/dom/StyleEngine.cpp File Source/core/dom/StyleEngine.cpp (right): https://codereview.chromium.org/196133034/diff/1/Source/core/dom/StyleEngine.cpp#newcode565 Source/core/dom/StyleEngine.cpp:565: static bool isCacheableForInlineStyle(const StyleSheetContents& contents) On 2014/03/19 22:32:14, esprehn ...
6 years, 9 months ago (2014-03-19 22:40:17 UTC) #3
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 9 months ago (2014-03-20 00:52:27 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/adamk@chromium.org/196133034/20001
6 years, 9 months ago (2014-03-20 00:52:36 UTC) #5
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-20 00:52:43 UTC) #6
commit-bot: I haz the power
Failed to apply patch for Source/core/css/StyleSheetContents.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 9 months ago (2014-03-20 00:52:43 UTC) #7
adamk
The CQ bit was checked by adamk@chromium.org
6 years, 9 months ago (2014-03-20 00:54:45 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/adamk@chromium.org/196133034/40001
6 years, 9 months ago (2014-03-20 00:54:54 UTC) #9
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-20 00:58:37 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel
6 years, 9 months ago (2014-03-20 00:58:38 UTC) #11
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 9 months ago (2014-03-20 00:59:28 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/adamk@chromium.org/196133034/40001
6 years, 9 months ago (2014-03-20 00:59:33 UTC) #13
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-20 01:02:45 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel
6 years, 9 months ago (2014-03-20 01:02:46 UTC) #15
adamk
The CQ bit was checked by adamk@chromium.org
6 years, 9 months ago (2014-03-20 01:04:40 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/adamk@chromium.org/196133034/40001
6 years, 9 months ago (2014-03-20 01:04:45 UTC) #17
commit-bot: I haz the power
6 years, 9 months ago (2014-03-20 04:03:56 UTC) #18
Message was sent while issue was closed.
Change committed as 169610

Powered by Google App Engine
This is Rietveld 408576698