:host([attr]) selector not getting invalidated correctly on shadow root creation |
||||||||
Issue description
Chrome Version: 58.0.3029.33 (Official Build) beta (64-bit)
OS: OSX
Create an element with an attribute:
<my-el pressed>
Add a shadow root, with a style tag that includes
:host and :host([attribute]) selectors.
```
:host div { color: blue }
:host([pressed]) div { color: red }
```
The div gets the wrong style (in this case, it's styled blue, not red. Devtools shows the correct rule winning, but the computed value for color shows the wrong color.
Toggling the attribute in devtools results in the style being set correctly.
Live demo:
https://jsbin.com/sumulix/1/edit?html,output
What is the expected result?
The element with the "pressed" attribute is colored red.
What happens instead?
Both elements are colored the same.
,
Apr 17 2017
,
Apr 17 2017
Able to reproduce this issue on Mac 10.12.4, Win-10 and Ubuntu 14.04 using chrome reported version #58.0.3029.33 and latest canary #60.0.3072.0. This is a non-regression issue as it is observed from M54 old builds. From M53 and older builds, when opening the url: https://jsbin.com/sumulix/1/edit?html,output gives no output/blank output. Could anyone from dev team please have a look into this issue. Thanks...!!
,
Apr 17 2017
Since the initial repro case uses v1 shadow DOM, it won't work prior to M53 (although theoretically it should work in M53 ...). The same sample using v0 shadow DOM (createShadowRoot) shows the same issue: https://jsbin.com/nuzarus/2/edit?html,output I believe this v0 shadow DOM behavior _is_ a regression (because the tutorial app that this sample is reduced from used to work). But I don't know how to get an older chrome build to test on.
,
Apr 18 2017
Test team - can you please bisect with the test case given in comment #4?
,
Apr 18 2017
,
Apr 18 2017
The issue is that the elements are incorrectly sharing computed style.
,
Apr 19 2017
Able to reproduce this issue on Mac 10.12.4, Windows 7 and Ubuntu 14.04 using chrome reported version #58.0.3029.33 and latest canary #60.0.3072.0. This is a non-regression issue as it is observed from M45 builds. From M44 and older builds, when opening the "https://jsbin.com/nuzarus/2/edit?html,output" as per comment#4,output gives as blank. Please find the attached screencast for reference. rune@,please take a look into this issue. Thanks...!!
,
Apr 20 2017
,
Apr 20 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0e2caa4b6dc7715e9d08e77f46e1dcdf28825405 commit 0e2caa4b6dc7715e9d08e77f46e1dcdf28825405 Author: rune <rune@opera.com> Date: Thu Apr 20 12:20:51 2017 Scopeless matching of :host rules for style sharing. The kSharingRules mode for selector matching needs to bypass scope checking in various places because we match selectors from the set of global uncommon attribute rules for which the source scope is unknown. We should really store these rules per scope, at least for Shadow DOM v1, and pass the correct scope for matching. BUG= 711539 Review-Url: https://codereview.chromium.org/2824853004 Cr-Commit-Position: refs/heads/master@{#465980} [modify] https://crrev.com/0e2caa4b6dc7715e9d08e77f46e1dcdf28825405/third_party/WebKit/Source/core/css/ElementRuleCollector.h [modify] https://crrev.com/0e2caa4b6dc7715e9d08e77f46e1dcdf28825405/third_party/WebKit/Source/core/css/SelectorChecker.cpp [modify] https://crrev.com/0e2caa4b6dc7715e9d08e77f46e1dcdf28825405/third_party/WebKit/Source/core/css/resolver/MatchRequest.h [modify] https://crrev.com/0e2caa4b6dc7715e9d08e77f46e1dcdf28825405/third_party/WebKit/Source/core/css/resolver/SharedStyleFinderTest.cpp
,
Apr 20 2017
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by samli@chromium.org
, Apr 14 2017