Title: [201416] trunk/Source/WebCore
Revision
201416
Author
[email protected]
Date
2016-05-25 23:50:26 -0700 (Wed, 25 May 2016)

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (201415 => 201416)


--- trunk/Source/WebCore/ChangeLog	2016-05-26 05:34:27 UTC (rev 201415)
+++ trunk/Source/WebCore/ChangeLog	2016-05-26 06:50:26 UTC (rev 201416)
@@ -1,3 +1,24 @@
+2016-05-25  Antti Koivisto  <[email protected]>
+
+        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.
+
 2016-05-25  Yoav Weiss  <[email protected]>
 
         Fix ResourceTiming multiple entries per resource and test initiator

Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (201415 => 201416)


--- trunk/Source/WebCore/dom/ContainerNode.cpp	2016-05-26 05:34:27 UTC (rev 201415)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp	2016-05-26 06:50:26 UTC (rev 201416)
@@ -376,8 +376,6 @@
     newChild.updateAncestorConnectedSubframeCountForInsertion();
 
     notifyChildInserted(newChild, ChildChangeSourceParser);
-
-    newChild.setNeedsStyleRecalc(ReconstructRenderTree);
 }
 
 bool ContainerNode::replaceChild(Node& newChild, Node& oldChild, ExceptionCode& ec)
@@ -721,8 +719,6 @@
     newChild.updateAncestorConnectedSubframeCountForInsertion();
 
     notifyChildInserted(newChild, ChildChangeSourceParser);
-
-    newChild.setNeedsStyleRecalc(ReconstructRenderTree);
 }
 
 void ContainerNode::childrenChanged(const ChildChange& change)
@@ -814,8 +810,6 @@
 
     notifyChildInserted(child, ChildChangeSourceAPI);
 
-    child.setNeedsStyleRecalc(ReconstructRenderTree);
-
     dispatchChildInsertionEvents(child);
 }
 

Modified: trunk/Source/WebCore/dom/Node.cpp (201415 => 201416)


--- trunk/Source/WebCore/dom/Node.cpp	2016-05-26 05:34:27 UTC (rev 201415)
+++ trunk/Source/WebCore/dom/Node.cpp	2016-05-26 06:50:26 UTC (rev 201416)
@@ -1162,6 +1162,9 @@
         setFlag(InDocumentFlag);
     if (parentOrShadowHostNode()->isInShadowTree())
         setFlag(IsInShadowTreeFlag);
+
+    setNeedsStyleRecalc(ReconstructRenderTree);
+
     return InsertionDone;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to