[Webkit-unassigned] [Bug 88606] [Shadow DOM] Needs @host rule for ShadowDOM styling

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 22 15:06:46 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=88606


Dimitri Glazkov (Google) <dglazkov at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #159626|review?                     |review-
               Flag|                            |




--- Comment #16 from Dimitri Glazkov (Google) <dglazkov at chromium.org>  2012-08-22 15:06:44 PST ---
(From update of attachment 159626)
View in context: https://bugs.webkit.org/attachment.cgi?id=159626&action=review

> Source/WebCore/css/StyleResolver.cpp:1046
> +    for (ShadowRoot* shadowRoot = shadow->youngestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->olderShadowRoot()) {
> +        if (atHostRuleSetForScope(shadowRoot))
> +            return true;
> +        if (!shadowRoot->hasShadowInsertionPoint())
> +            break;
> +    }

Can we cache this value on ElementShadow?

> Source/WebCore/css/StyleResolver.cpp:1069
> +    Vector<RuleSet*, 16> matchedRules; 
> +    for (ShadowRoot* shadowRoot = shadow->youngestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->olderShadowRoot()) { 
> +        if (RuleSet* ruleSet = atHostRuleSetForScope(shadowRoot))
> +            matchedRules.append(ruleSet);
> +        if (!shadowRoot->hasShadowInsertionPoint())
> +            break;
> +    }
> +    if (matchedRules.isEmpty())
> +        return;

Ah, this could be on ElementShadow, just as I suggested above. Basically, maintain a list of activeShadowRoots (the interesting bit is that you only need to store one value, the last visible shadow root from the stack). This should allow you to make the patch neatly splittable into the section where we first expose the ElementShadow::activeShadowRoots along with window.internals tests for it, and then a trivial patch of adding the support @host rules. WDYT?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list