|
Move MediaQueryResults to RuleFeatureSet.
The existing code only cleared the query results on the StyleResolver
when the StyleResolver was cleared. That meant we could end up in a
situation where the result list was ever-growing. That wasn't a big
issue in practice as the StyleResolver would be cleared quite often on
stylesheet changes. However, that will change when the RuleSet based
style invalidation is enabled.
We move the media query results to RuleFeatureSet so that:
- Results for @media rules are stored in RuleFeatureSet instead of
RuleSet.
- Results for media attributes are stored in the ScopedStyleResolver
when added instead of appending them directly to StyleResolver.
- Accumulated results for all scopes are stored in CSSGlobalRuleSet
on StyleEngine instead of StyleResolver and are accumulated with
other rule features in ScopedStyleResolver::collectFeaturesTo().
This CL introduces StyleEngine::ruleSetForSheet() for evaluating the
media attribute of the stylesheet node and create the RuleSet if the
media attribute matches. That way we are able to make the
MediaQueryEvaluator private to StyleEngine. Also, this method is
required when we start using ActiveStyleSheets.
R=meade@chromium.org
BUG= 567021, 614026
Committed: https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd
Cr-Commit-Position: refs/heads/master@{#434383}
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+154 lines, -102 lines) |
Patch |
|
M |
third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/CSSStyleSheet.h
|
View
|
|
3 chunks |
+10 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
|
View
|
|
2 chunks |
+12 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/RuleFeature.h
|
View
|
|
3 chunks |
+16 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/RuleFeature.cpp
|
View
|
|
3 chunks |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/RuleSet.h
|
View
|
|
2 chunks |
+0 lines, -9 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/RuleSet.cpp
|
View
|
|
3 chunks |
+6 lines, -8 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h
|
View
|
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
|
View
|
|
5 chunks |
+27 lines, -17 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/resolver/StyleResolver.h
|
View
|
1
|
4 chunks |
+1 line, -14 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
|
View
|
|
4 chunks |
+1 line, -46 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/StyleEngine.h
|
View
|
|
3 chunks |
+9 lines, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/StyleEngine.cpp
|
View
|
|
2 chunks |
+32 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
|
View
|
|
1 chunk |
+24 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/frame/FrameView.cpp
|
View
|
|
1 chunk |
+3 lines, -4 lines |
0 comments
|
Download
|
Total messages: 29 (20 generated)
|