|
Reland: Collect active stylesheets and and apply asynchronously.
This CL enables asynchronously updating the lists of active stylesheets
applying any style changes using rule set invalidations. This means we
more often avoid full style recalcs when we add or remove stylesheets
from the document as well as when the evaluation of media queries
change.
In general, we now alway compare new and old stylesheets by comparing
their rulesets and schedule style invalidations for removed and added
rulesets.
When media queries changes, we used to give completely in and
recalculate all style once we discovered a media query changed its
evaluation. With this patch, we clear rule sets for sheets which
contain media queries which means we will invalidate rules for the sets
before and after the query change. This can be further refined by only
clearing rule sets when the sheets has a media query which actually did
change evaluation, and also just schedule invalidations for rules which
are inside @media rules.
TreeScopeStyleSheetCollectionTest.cpp is removed as it is replaced by
ActiveStyleSheetsTest.cpp which landed earlier.
updateActiveStyle() has been added a few places where
ensureStyleResolver() previously caused active stylesheets to be up-to-
date. ensureStyleResolver() is now merely a method which creates the
StyleResolver if necessary and returns it.
There are some cleanups and code removal which needs to be done after
this CL, but I have left those out to make this CL as small as
possible. For instance resolverChanged(), which synchronously updated
the active stylesheets, has an empty implementation instead of
including a lot of removals in this CL. The code for lazy-appending
stylesheets in StyleResolver is still there, but not in use.
R=meade@chromium.org
BUG= 567021
Committed: https://crrev.com/9fb5b60edfb769134733009f9447bad3eaf347b0
Committed: https://crrev.com/90d4ea3d543f0031769b3aacac2d3e084b95fb7d
Cr-Original-Commit-Position: refs/heads/master@{#438148}
Cr-Commit-Position: refs/heads/master@{#439092}
Total comments: 7
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+142 lines, -588 lines) |
Patch |
|
M |
third_party/WebKit/LayoutTests/animations/add-keyframes-in-shadow-recalc.html
|
View
|
|
1 chunk |
+1 line, -4 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/LayoutTests/fast/css/modify-stylesheet-minimal-recalc-style.html
|
View
|
|
2 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/LayoutTests/fast/css/modify-stylesheet-minimal-recalc-style-expected.txt
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/BUILD.gn
|
View
|
1
2
3
4
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/FontFaceSet.cpp
|
View
|
1
2
3
4
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/StyleSheetContents.cpp
|
View
|
1
2
3
4
|
2 chunks |
+9 lines, -11 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/Document.cpp
|
View
|
1
2
3
4
|
2 chunks |
+7 lines, -3 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.h
|
View
|
|
3 chunks |
+3 lines, -5 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp
|
View
|
|
2 chunks |
+21 lines, -49 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/DocumentStyleSheetCollector.h
|
View
|
|
2 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/DocumentStyleSheetCollector.cpp
|
View
|
1
2
3
4
|
2 chunks |
+3 lines, -7 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.h
|
View
|
|
3 chunks |
+2 lines, -5 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp
|
View
|
|
2 chunks |
+8 lines, -36 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/StyleEngine.h
|
View
|
1
2
3
|
8 chunks |
+6 lines, -19 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/StyleEngine.cpp
|
View
|
1
2
3
4
|
9 chunks |
+26 lines, -87 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
|
View
|
1
2
3
|
2 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/StyleSheetCollection.h
|
View
|
|
4 chunks |
+4 lines, -7 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/StyleSheetCollection.cpp
|
View
|
1
2
3
4
|
2 chunks |
+4 lines, -14 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.h
|
View
|
|
3 chunks |
+5 lines, -37 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.cpp
|
View
|
1
|
2 chunks |
+19 lines, -127 lines |
0 comments
|
Download
|
|
D |
third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollectionTest.cpp
|
View
|
|
1 chunk |
+0 lines, -152 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/frame/FrameView.cpp
|
View
|
1
2
3
4
|
3 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
View
|
1
2
3
4
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
|
View
|
1
2
3
|
1 chunk |
+3 lines, -6 lines |
0 comments
|
Download
|
Total messages: 53 (33 generated)
|