|
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 not used, as it represents order-of-appearance
(Removal of CascadeOrder is not done here to make the CL smaller. Will
be removed in a follow-up CL).
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
The applyProperties code is hot, and I have made performance runs for
the micro-benchmarks in Layout and CSS without consistent regressions.
3. 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.
Because of this, TreeBoundaryCrossingRules is now reduced to a
DocumentOrderedList of scoping nodes, so the TreeBoundaryCrossingRules
class is removed.
[1] https://lists.w3.org/Archives/Public/www-style/2015Jun/0303.html
BUG= 452542, 455148, 487125
NOTRY=true
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200994
Total comments: 8
Total comments: 6
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+274 lines, -200 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
2
3
|
1 chunk |
+29 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/css/deep-cascade-order-expected.txt
|
View
|
1
2
3
|
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 chunk |
+0 lines, -2 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/ScopedStyleResolver.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/css/resolver/ScopedStyleResolver.cpp
|
View
|
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/resolver/StyleResolver.h
|
View
|
1
2
|
3 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
|
M |
Source/core/css/resolver/StyleResolver.cpp
|
View
|
1
2
|
9 chunks |
+101 lines, -41 lines |
0 comments
|
Download
|
|
M |
Source/core/dom/DocumentOrderedList.h
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
Total messages: 37 (16 generated)
|