[Webkit-unassigned] [Bug 84048] ShadowRoot needs resetStyleInheritance

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 18 14:25:50 PDT 2012


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





--- Comment #11 from Takashi Sakamoto <tasak at google.com>  2012-04-18 14:25:49 PST ---
(In reply to comment #10)
> (From update of attachment 137623 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=137623&action=review
> 
> > Source/WebCore/ChangeLog:7
> > +        http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-root-attributes
> 
> Could you explain the change itself briefly?
> 
> > Source/WebCore/css/CSSStyleSelector.cpp:1638
> > +void CSSStyleSelector::applyResetStyleInheritance(MatchResult& result)
> 
> This isn't the right approach.
> - The flag should affect not only for direct children of the shadow boundary
> - Allocating properties for each style resolution is too expensive.
> 
> I think this "reset" thing should be handled at where we compute the inheritance in RenderStyle object
> because RenderStyle is responsible for style inheritance in WebKit.
> You can find such places by seeing the callers of RenderStyle::inheritFrom().

I think, the best place to implement resetStyleInheritance is CSSStyleSelector::applyProperty, because RenderStyle::inheritFrom is just initializing RenderStyle (by copying the given render style to this render style).
For example, CSSStyleSelector::styleForElement() has the following code:
----
m_style = RenderStyle::create();
if (m_parentStyle) 
  m_style->inheritFrom(m_parentStyle);

...
----

If modifying CSSStyleSelector::applyProperty is not good, I have the following idea:
(1) create a custom CSSStyleApplyProperty, which has only applyInitial and applyValue (applyInherit is the same as applyInitial).
(2) modifying matchResult (I agree that this approach is very expensive).

I think, class RenderStyle is for just holding final style values (I mean, no 'inherit' and no 'initial') for rendering, because CSSStyleApplyProperty's applyInherit handlers always look up at parent styles. 
e.g.
----
class ApplyPropertyDefaultBase {
...
   static void applyInheritValue(CSSStyleSelector* selector) { setValue(selector->style(), value(selector->parentStyle()));
...
----

-- 
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