[webkit-changes] [201416] trunk/Source/WebCore

2016-05-25 Thread antti
Title: [201416] trunk/Source/WebCore








Revision 201416
Author an...@apple.com
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

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/ContainerNode.cpp
trunk/Source/WebCore/dom/Node.cpp




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  
+
+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  
 
 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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [201415] trunk

2016-05-25 Thread yoav
Title: [201415] trunk








Revision 201415
Author y...@yoav.ws
Date 2016-05-25 22:34:27 -0700 (Wed, 25 May 2016)


Log Message
Fix ResourceTiming multiple entries per resource and test initiator
https://bugs.webkit.org/show_bug.cgi?id=158094

Reviewed by Alex Christensen.

Make sure that CachedResource that was needed by two different elements only adds one entry, with the right (first) initiatorType.

Source/WebCore:

Tests: http/tests/performance/performance-resource-timing-initiator-css.html
   http/tests/performance/performance-resource-timing-initiator-no-override.html

* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::addResourceTiming): Don't remove CachedResource when entry is added, but
mark it as added. Only add new entries for non-added resources.
(WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation): Initialize initiator info as NotYetAdded.
* loader/ResourceTimingInformation.h:

LayoutTests:

* http/tests/performance/performance-resource-timing-initiator-css.html: Added. Makes sure css has the right initiator type.
* http/tests/performance/performance-resource-timing-initiator-css-expected.txt: Added.
* http/tests/performance/performance-resource-timing-initiator-no-override.html: Added. Makes sure that only one entry is added and
that its initiator info doesn't get overriden.
* http/tests/performance/performance-resource-timing-initiator-no-override-expected.txt: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/loader/ResourceTimingInformation.cpp
trunk/Source/WebCore/loader/ResourceTimingInformation.h


Added Paths

trunk/LayoutTests/http/tests/performance/performance-resource-timing-initiator-css-expected.txt
trunk/LayoutTests/http/tests/performance/performance-resource-timing-initiator-css.html
trunk/LayoutTests/http/tests/performance/performance-resource-timing-initiator-no-override-expected.txt
trunk/LayoutTests/http/tests/performance/performance-resource-timing-initiator-no-override.html




Diff

Modified: trunk/LayoutTests/ChangeLog (201414 => 201415)

--- trunk/LayoutTests/ChangeLog	2016-05-26 05:33:58 UTC (rev 201414)
+++ trunk/LayoutTests/ChangeLog	2016-05-26 05:34:27 UTC (rev 201415)
@@ -1,5 +1,20 @@
 2016-05-25  Yoav Weiss  
 
+Fix ResourceTiming multiple entries per resource and test initiator
+https://bugs.webkit.org/show_bug.cgi?id=158094
+
+Reviewed by Alex Christensen.
+
+Make sure that CachedResource that was needed by two different elements only adds one entry, with the right (first) initiatorType.
+
+* http/tests/performance/performance-resource-timing-initiator-css.html: Added. Makes sure css has the right initiator type.
+* http/tests/performance/performance-resource-timing-initiator-css-expected.txt: Added.
+* http/tests/performance/performance-resource-timing-initiator-no-override.html: Added. Makes sure that only one entry is added and
+that its initiator info doesn't get overriden.
+* http/tests/performance/performance-resource-timing-initiator-no-override-expected.txt: Added.
+
+2016-05-25  Yoav Weiss  
+
 Fix ResourceTiming XHR flakiness
 https://bugs.webkit.org/show_bug.cgi?id=158019
 


Added: trunk/LayoutTests/http/tests/performance/performance-resource-timing-initiator-css-expected.txt (0 => 201415)

--- trunk/LayoutTests/http/tests/performance/performance-resource-timing-initiator-css-expected.txt	(rev 0)
+++ trunk/LayoutTests/http/tests/performance/performance-resource-timing-initiator-css-expected.txt	2016-05-26 05:34:27 UTC (rev 201415)
@@ -0,0 +1,2 @@
+PASS initiator is "css"
+


Added: trunk/LayoutTests/http/tests/performance/performance-resource-timing-initiator-css.html (0 => 201415)

--- trunk/LayoutTests/http/tests/performance/performance-resource-timing-initiator-css.html	(rev 0)
+++ trunk/LayoutTests/http/tests/performance/performance-resource-timing-initiator-css.html	2016-05-26 05:34:27 UTC (rev 201415)
@@ -0,0 +1,36 @@
+
+
+
+if (window.internals)
+internals.setResourceTimingSupport(true);
+if (window.testRunner) {
+testRunner.dumpAsText()
+testRunner.waitUntilDone();
+}
+
+
+
+