* SUMMARY The first “:host()” context in a template seems to dictate the the “host” styles for all shadow context in the document. Quoting draft from here https://drafts.csswg.org/css-scoping/#host-selector (if it is up-to-date),: “The :host pseudo-class, when evaluated in the context of a shadow tree, matches the shadow tree’s host element. In any other context, it matches nothing.” * STEPS TO REPRODUCE 1. Open included test-case * RESULTS Expected: Host 2 from test case shold have a black border instead of pink. Actual: Both hosts have pink borders.
Created attachment 275668 [details] test
<rdar://problem/24668206>
Created attachment 275669 [details] patch
Comment on attachment 275669 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=275669&action=review r=me > Source/WebCore/style/StyleSharingResolver.cpp:100 > + if (element.shadowRoot() && !element.shadowRoot()->styleResolver().ruleSets().authorStyle()->hostPseudoClassRules().isEmpty()) This would look so nice if we made authorStyle() return a reference, too. > Source/WebCore/style/StyleSharingResolver.cpp:287 > + if (element.shadowRoot() && !element.shadowRoot()->styleResolver().ruleSets().authorStyle()->hostPseudoClassRules().isEmpty()) Mhm.
https://trac.webkit.org/r199060
Comment on attachment 275669 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=275669&action=review > Source/WebCore/style/StyleSharingResolver.cpp:288 > + return nullptr; nullptr -> false :(
> nullptr -> false > :( http://trac.webkit.org/changeset/199584