|
Implement proposed shadow tree cascade order.
This CL implements the shadow tree cascade order proposed in [1].
Previously, in Blink, specificity would win over scope origin, even if the
scopes had an inner/outer scope relationship, and the order-of-appearance
was governed by the CascadeOrder type. Also, !important rules did not
apply in the reverse scope order, as the current spec says for inner/outer
scopes, and the proposal in [1] says apply between all shadow scopes.
What has been done is:
1. CascadeOrder is dropped, as it represented order-of-appearance
2. When collecting rules, sort after each scope instead of just after UA
and Author since we had:
UA important
Author important
Author
UA
and now we have (with A(n) appearing before A(n+1) in the tree-of-trees
order):
UA important
Author scope A(n) important
...
Author scope A(1) important
Author scope A(1)
...
Author scope A(n)
UA
There is bit of convenience functionality added around MatchResult and
rule ranges to make the code for applying rule ranges in the reverse
order for !important declarations cleaner.
The applyProperties code is hot, and I have made performance runs for
the micro-benchmarks in Layout and CSS without consistent regressions.
3. TreeBoundaryCrossingRules is now reduced to a DocumentOrderedList of
scoping nodes, so the TreeBoundaryCrossingRules class is removed.
4. Since the cascading order between scopes are just the inner/outer
relationship in the composed tree (direction decided by !important),
which is the same as the tree-of-trees order of the shadow trees,
we can just traverse the DocumentOrderedList of scopes in the reverse
order instead of doing calculation tricks for CascadeOrder values.
[1] https://lists.w3.org/Archives/Public/www-style/2015Jun/0303.html
BUG= 452542, 455148, 487125
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+427 lines, -283 lines) |
Patch |
|
M |
LayoutTests/fast/css/content-distributed-nodes.html
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/css/content-distributed-nodes-expected.txt
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/css/deep-cascade-order.html
|
View
|
|
1 chunk |
+29 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/css/deep-cascade-order-expected.txt
|
View
|
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/css/getComputedStyle/computed-style-redistribution.html
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/fast/dom/shadow/cascade-of-treeboundary-crossing-rules.html
|
View
|
|
2 chunks |
+19 lines, -3 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/dom/shadow/cascade-of-treeboundary-crossing-rules-expected.txt
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/shadow/inner-scope-important-wins.html
|
View
|
|
1 chunk |
+21 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/shadow/inner-scope-important-wins-expected.txt
|
View
|
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/shadow/outer-scope-lower-specificity-wins.html
|
View
|
|
1 chunk |
+21 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/shadow/outer-scope-lower-specificity-wins-expected.txt
|
View
|
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/shadow/outer-scope-wins.html
|
View
|
|
1 chunk |
+13 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/shadow/outer-scope-wins-expected.txt
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/dom/shadow/style-with-shadow-pseudo-element.html
|
View
|
|
5 chunks |
+6 lines, -7 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/dom/shadow/style-with-shadow-pseudo-element-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/core.gypi
|
View
|
1
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/css/ElementRuleCollector.h
|
View
|
1
|
2 chunks |
+7 lines, -11 lines |
0 comments
|
Download
|
|
M |
Source/core/css/ElementRuleCollector.cpp
|
View
|
1
|
8 chunks |
+16 lines, -19 lines |
0 comments
|
Download
|
|
D |
Source/core/css/TreeBoundaryCrossingRules.h
|
View
|
|
1 chunk |
+0 lines, -55 lines |
0 comments
|
Download
|
|
D |
Source/core/css/TreeBoundaryCrossingRules.cpp
|
View
|
|
1 chunk |
+0 lines, -82 lines |
0 comments
|
Download
|
|
M |
Source/core/css/resolver/MatchResult.h
|
View
|
1
2
|
1 chunk |
+86 lines, -9 lines |
0 comments
|
Download
|
|
M |
Source/core/css/resolver/MatchResult.cpp
|
View
|
|
1 chunk |
+13 lines, -2 lines |
1 comment
|
Download
|
|
M |
Source/core/css/resolver/MatchedPropertiesCache.h
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
Source/core/css/resolver/MatchedPropertiesCache.cpp
|
View
|
|
4 chunks |
+7 lines, -7 lines |
0 comments
|
Download
|
|
M |
Source/core/css/resolver/ScopedStyleResolver.h
|
View
|
1
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
Source/core/css/resolver/ScopedStyleResolver.cpp
|
View
|
1
|
1 chunk |
+14 lines, -6 lines |
0 comments
|
Download
|
|
M |
Source/core/css/resolver/StyleResolver.h
|
View
|
1
|
4 chunks |
+7 lines, -4 lines |
0 comments
|
Download
|
|
M |
Source/core/css/resolver/StyleResolver.cpp
|
View
|
1
|
18 chunks |
+113 lines, -64 lines |
1 comment
|
Download
|
|
M |
Source/core/dom/DocumentOrderedList.h
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
Total messages: 10 (2 generated)
|