Changeset 201416 in webkit


Ignore:
Timestamp:
May 25, 2016, 11:50:26 PM (9 years ago)
Author:
Antti Koivisto
Message:

Invalidate style for newly added nodes in Node::insertedInto
https://bugs.webkit.org/show_bug.cgi?id=158088

Reviewed by Darin Adler.

  • dom/ContainerNode.cpp:

(WebCore::ContainerNode::parserInsertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::parserAppendChild):
(WebCore::ContainerNode::childrenChanged):
(WebCore::ContainerNode::updateTreeAfterInsertion):

  • dom/Node.cpp:

(WebCore::Node::insertedInto):

Consolidate setNeedsStyleRecalc(ReconstructRenderTree) here.

This also now happens earliest possible time, right after inserting the node and can avoid
some unneeded style invalidation work in subclass insertion handlers.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r201415 r201416  
     12016-05-25  Antti Koivisto  <antti@apple.com>
     2
     3        Invalidate style for newly added nodes in Node::insertedInto
     4        https://bugs.webkit.org/show_bug.cgi?id=158088
     5
     6        Reviewed by Darin Adler.
     7
     8        * dom/ContainerNode.cpp:
     9        (WebCore::ContainerNode::parserInsertBefore):
     10        (WebCore::ContainerNode::replaceChild):
     11        (WebCore::ContainerNode::parserAppendChild):
     12        (WebCore::ContainerNode::childrenChanged):
     13        (WebCore::ContainerNode::updateTreeAfterInsertion):
     14        * dom/Node.cpp:
     15        (WebCore::Node::insertedInto):
     16
     17        Consolidate setNeedsStyleRecalc(ReconstructRenderTree) here.
     18
     19        This also now happens earliest possible time, right after inserting the node and can avoid
     20        some unneeded style invalidation work in subclass insertion handlers.
     21
    1222016-05-25  Yoav Weiss  <yoav@yoav.ws>
    223
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r200895 r201416  
    377377
    378378    notifyChildInserted(newChild, ChildChangeSourceParser);
    379 
    380     newChild.setNeedsStyleRecalc(ReconstructRenderTree);
    381379}
    382380
     
    722720
    723721    notifyChildInserted(newChild, ChildChangeSourceParser);
    724 
    725     newChild.setNeedsStyleRecalc(ReconstructRenderTree);
    726722}
    727723
     
    815811    notifyChildInserted(child, ChildChangeSourceAPI);
    816812
    817     child.setNeedsStyleRecalc(ReconstructRenderTree);
    818 
    819813    dispatchChildInsertionEvents(child);
    820814}
  • trunk/Source/WebCore/dom/Node.cpp

    r201410 r201416  
    11631163    if (parentOrShadowHostNode()->isInShadowTree())
    11641164        setFlag(IsInShadowTreeFlag);
     1165
     1166    setNeedsStyleRecalc(ReconstructRenderTree);
     1167
    11651168    return InsertionDone;
    11661169}
Note: See TracChangeset for help on using the changeset viewer.