Summary: | Updating class name of a shadow host does not update the style applied by descendants of :host() | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||||
Component: | CSS | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, florian.maffini, ijaltllu, jan, koivisto, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | Other | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | 158900 | ||||||||
Bug Blocks: | 148695 | ||||||||
Attachments: |
|
Description
Ryosuke Niwa
2017-04-11 21:28:49 PDT
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 |