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

Issue 1224673002: Implement proposed shadow tree cascade order. (Closed)

Created:
5 years, 5 months ago by rune
Modified:
5 years, 4 months ago
Reviewers:
Timothy Loh, hayato, kochi
CC:
blink-reviews, blink-reviews-style_chromium.org, blink-reviews-css, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, apavlov+blink_chromium.org, darktears, rwlbuis, tasak, kojii
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

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

Patch Set 1 #

Patch Set 2 : Rebased #

Patch Set 3 : Added documentation #

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

Messages

Total messages: 10 (2 generated)
rune
Ready for review.
5 years, 4 months ago (2015-08-05 08:29:39 UTC) #2
kochi
Thanks, I'll take a look. +tasak FYI
5 years, 4 months ago (2015-08-05 09:35:09 UTC) #4
kochi
On 2015/08/05 09:35:09, Takayoshi Kochi wrote: > Thanks, I'll take a look. > > +tasak ...
5 years, 4 months ago (2015-08-10 04:48:19 UTC) #5
rune
On 2015/08/10 04:48:19, Takayoshi Kochi wrote: > On 2015/08/05 09:35:09, Takayoshi Kochi wrote: > > ...
5 years, 4 months ago (2015-08-10 07:07:40 UTC) #6
kochi
On 2015/08/10 07:07:40, rune wrote: > On 2015/08/10 04:48:19, Takayoshi Kochi wrote: > > On ...
5 years, 4 months ago (2015-08-10 11:42:20 UTC) #7
kochi
Sorry for long delay, it would be much appreciated if you could split this into ...
5 years, 4 months ago (2015-08-10 12:15:04 UTC) #8
rune
On 2015/08/10 11:42:20, Takayoshi Kochi wrote: > On 2015/08/10 07:07:40, rune wrote: > > I ...
5 years, 4 months ago (2015-08-10 13:16:54 UTC) #9
rune
5 years, 4 months ago (2015-08-18 13:34:15 UTC) #10
On 2015/08/10 13:16:54, rune wrote:
> On 2015/08/10 11:42:20, Takayoshi Kochi wrote:
> > On 2015/08/10 07:07:40, rune wrote:
> 
> > > I should at least be able to split out the MatchResult and corresponding
> > > modifications to applyPropertyChanges to prepare for multiple author
ranges
> > > without changing behavior. I'll see if I can split the other change
further
> > > after that.
> > 
> > Thanks, that would be helpful!
> 
> I have done that in https://codereview.chromium.org/1282243002/ now, but I'm
not
> quite happy with it yet. I'll re-iterate on that before publishing.

[1] has now landed. I've split the rest of this CL into [2] and [3]. Closing
this CL now.

[1] https://codereview.chromium.org/1282243002/
[2] https://codereview.chromium.org/1298173004/
[3] https://codereview.chromium.org/1291873005/

Powered by Google App Engine
This is Rietveld 408576698