https://trac.webkit.org/changeset/202227 fixed the case where :host rule applies to itself, but not any rules that apply styles to its descendants.
See http://jsbin.com/masaxeq/edit?html,output
<rdar://problem/31572668>
Experiencing the same issue with my custom element (game-card) but with an attribute selector: :host([unrevealed]) #flipper > We can see the rule appear and match in the dev tools (transform: rotateY...), but the styles are not really applied to the #flipper element (the card should rotate on the Y axis, like it was flipped). You can inspect it there: https://www.webcomponents.org/element/vpusher/game-card > Click on the card to toggle the 'unrevealed' attribute on the host, then check the #flipper styles. The thing is, if you uncheck, then check the rule in the dev tools, it applies properly. Hope I helped.
*** Bug 169706 has been marked as a duplicate of this bug. ***
Created attachment 309710 [details] patch
Comment on attachment 309710 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=309710&action=review > Source/WebCore/css/RuleSet.cpp:208 > + return leftmostSelector->match() == CSSSelector::PseudoClass && leftmostSelector->pseudoClassType() ==CSSSelector::PseudoClassHost; Nit: Need a space after the second ==. > Source/WebCore/css/RuleSet.h:218 > + bool m_hasHostPseudoClassRulesMatchingInShadowTree { false }; You might wanna put this next to another boolean for better packing not that it matters much. > LayoutTests/fast/shadow-dom/css-scoping-host-class-and-attribute-mutation.html:108 > +test("#host4", "#shadow4", (host) => { > + host.setAttribute('id','green'); > +}); Could you also add a variant for modifying ID/class/attribute of a node inside the shadow tree?
Created attachment 309889 [details] patch
Comment on attachment 309889 [details] patch Clearing flags on attachment: 309889 Committed r216761: <http://trac.webkit.org/changeset/216761>
All reviewed patches have been landed. Closing bug.
_legacyUndefinedCheck: true