[Webkit-unassigned] [Bug 92899] Dynamically styling ShadowDom content on a node distributed to another shadow insertion point fails.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 6 04:28:26 PDT 2012


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


Takashi Sakamoto <tasak at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tasak at google.com




--- Comment #2 from Takashi Sakamoto <tasak at google.com>  2012-08-06 04:28:23 PST ---
I will explain this bug by using the attached test case example. The DOM tree of the test case looks like:

#box ------------ sr1
  |                             |
  |                            +--<content>
  |
  +---#item ------ sr2
                                |
                                +---<style> 
                                |
                                +---<div> 

To render the test case, ElementShadow::invalidateDistribution is invoked because of <content>.
In ElementShadow::invalidateDistribution for sr1's <content>, #box->detach() and #box->lazyAttach(...) are invoked. So, all children of the host have childNeedsStyleRecalc, i.e. #item has childNeedsStyleRecalc true.
As #box was detached, #box's Element::recalcStyle invokes reattach() and only clears #box's childNeedsStyleRecalc. 

When the class attribute of <div> in sr2 is changed to be "selected", Node::setNeedsStyleRecalc is invoked and Node::markAncestorsWithChildNeedsStyleRecalc is invoked.

In Node::markAncestorsWithChildNeedsStyleRecalc, walk up from <div> and set childNeedsStyleRecalc until childNeedsStyleRecalc has been already set or no parent is found. i.e.

   <sr2> --> #item --> #box --> ... 

As #item's childNeedsStyleRecalc is not cleared, so document()'s childNeedsStyleRecalc is not updated.
So,

    if (document()->childNeedsStyleRecalc())
        document()->scheduleStyleRecalc();

Document::scheduleStyleRecalc is not invoked.

No re-layout will be executed. 

Best regards,
Takashi Sakamoto

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