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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 15 22:05:01 PDT 2012


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





--- Comment #23 from Hajime Morrita <morrita at google.com>  2012-05-15 22:04:05 PST ---
(From update of attachment 141840)
View in context: https://bugs.webkit.org/attachment.cgi?id=141840&action=review

I think we don't need to compute m_parentNodeForRenderingAndStyleAtShadowBoundary at the constructor
but we can compute it on the fly.

How about to have NodeRenderingContext::resetStyleInheritance() ?

>> Source/WebCore/css/StyleResolver.cpp:1642
>> +    bool resetStyleInheritance = element && element->treeScope()->resetStyleInheritance() && element->parentNodeForRenderingAndStyleAtShadowBoundary();
> 
> in this statement, the first two clauses are cheap, and the third one is expensive. What impact will this have on this hot function? Perhaps we could get rid of it somehow?

in initElement(), we call parentNodeForRendering().
That means we compute NodeRenderingContext behind that. 
Instead of calling parentNodeForRendering() there, we can use NodeRenderingContext directly to retrieve what we need.
Both finding style reset boundary and finding the parent for rendering are (or should be) parts of same computation process.

> Source/WebCore/dom/NodeRenderingContext.cpp:58
> +    , m_parentNodeForRenderingAndStyleAtShadowBoundary(0)

Should be false.

> Source/WebCore/dom/NodeRenderingContext.cpp:86
> +                    m_parentNodeForRenderingAndStyleAtShadowBoundary = NodeRenderingContext(m_insertionPoint).parentNodeForRenderingAndStyleAtShadowBoundary();

Please don't create NodeRenderingContext twice. It's expensive.

> Source/WebCore/dom/NodeRenderingContext.cpp:93
> +            m_parentNodeForRenderingAndStyleAtShadowBoundary = false;

It looks we don't need this because it's the fault value.

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