[Webkit-unassigned] [Bug 88606] [Shadow DOM] Needs @host rule for ShadowDOM styling
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jul 31 11:29:09 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=88606
--- Comment #9 from Dimitri Glazkov (Google) <dglazkov at chromium.org> 2012-07-31 11:29:09 PST ---
(From update of attachment 155477)
View in context: https://bugs.webkit.org/attachment.cgi?id=155477&action=review
There are several patches in here, to be landed separately. It's fine to work on this as one patch for now, however.
ProTip: don't fill out the ChangeLog until you're ready to start landing. Otherwise, you'll end up rewriting it many times :)
> Source/WebCore/html/HTMLStyleElement.cpp:155
> + if (hasHostRule())
> + if (ShadowRoot* sr = shadowRoot())
> + if (Element* host = sr->host()) {
> + host->registerScopedHTMLStyleChild();
> + isHostRuleRegistered = true;
> + }
Wild to see this here. Why can't we do this when we're adding rules in StyleResolver, like all other machinery in CSS does?
> Source/WebCore/html/HTMLStyleElement.cpp:185
> + if (m_scopedStyleRegistrationState == RegisteredInShadowRootWithHostRule || m_scopedStyleRegistrationState == RegisteredAsScopedWithHostRule)
> + if (ShadowRoot* sr = shadowRoot())
> + if (Element* host = sr->host())
> + host->unregisterScopedHTMLStyleChild();
You won't need any of these when you move @host accounting in styleresolver.
> Source/WebCore/html/HTMLStyleElement.cpp:200
> +bool HTMLStyleElement::hasHostRule() const
> +{
> + if (CSSStyleSheet* styleSheet = const_cast<HTMLStyleElement*>(this)->sheet())
> + return styleSheet->contents()->hasHostRule();
> + return false;
> +}
Or these.
> Source/WebCore/html/shadow/HTMLShadowElement.h:56
> + bool m_registeredWithShadowRoot;
It seems we're building an extra set of machinery for something that already exists. We already _know_ which shadow trees are rendered or not by the time we've created the composed tree, which happens before style resolution. Please ask morrita@/hayato@ for guidance here.
--
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