Title: [238978] releases/WebKitGTK/webkit-2.22
Revision
238978
Author
[email protected]
Date
2018-12-07 16:25:03 -0800 (Fri, 07 Dec 2018)

Log Message

Merge r238877 - Don't report resource timing to parent frame for history items
https://bugs.webkit.org/show_bug.cgi?id=192273
<rdar://problem/45163764>

Reviewed by Youenn Fablet.

Source/WebCore:

We should not report history items to its parent frame as those are less
interested to its parent and might not be the first navigation in the iframes.

This change aligns the behavior when a cached document is not available for the
history item with the available case as we don't report resource timing for any
cached main document.

Test: http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadDifferentDocumentItem):

LayoutTests:

* http/tests/misc/resource-timing-navigation-in-restored-iframe-2-expected.txt: Added.
* http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html: Copied from LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe.html.
* http/tests/misc/resource-timing-navigation-in-restored-iframe.html:

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/ChangeLog (238977 => 238978)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/ChangeLog	2018-12-08 00:24:59 UTC (rev 238977)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/ChangeLog	2018-12-08 00:25:03 UTC (rev 238978)
@@ -1,3 +1,15 @@
+2018-11-30  Jiewen Tan  <[email protected]>
+
+        Don't report resource timing to parent frame for history items
+        https://bugs.webkit.org/show_bug.cgi?id=192273
+        <rdar://problem/45163764>
+
+        Reviewed by Youenn Fablet.
+
+        * http/tests/misc/resource-timing-navigation-in-restored-iframe-2-expected.txt: Added.
+        * http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html: Copied from LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe.html.
+        * http/tests/misc/resource-timing-navigation-in-restored-iframe.html:
+
 2018-08-27  Mark Lam  <[email protected]>
 
         Fix exception throwing code so that topCallFrame and topEntryFrame stay true to their names.

Added: releases/WebKitGTK/webkit-2.22/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2-expected.txt (0 => 238978)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2-expected.txt	2018-12-08 00:25:03 UTC (rev 238978)
@@ -0,0 +1,11 @@
+ALERT: Going back.
+Tests that an iframe restored from history does not report resource timing.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS resources.length is 1
+PASS resources[0].name is "http://127.0.0.1:8000/js-test-resources/js-test.js"
+PASS successfullyParsed is true
+
+TEST COMPLETE

Copied: releases/WebKitGTK/webkit-2.22/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html (from rev 238977, releases/WebKitGTK/webkit-2.22/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe.html) (0 => 238978)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html	2018-12-08 00:25:03 UTC (rev 238978)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<script src=""
+<script>
+    description('Tests that an iframe restored from history does not report resource timing.');
+    window.jsTestIsAsync = true;
+    if (window.internals)
+        internals.clearMemoryCache();
+
+    function runTest() {
+        if (!sessionStorage.didNav) {
+            sessionStorage.didNav = true;
+            window.addEventListener('message', (event) => {
+                location.href = '';
+            });
+            document.getElementById('target-iframe').contentWindow.postMessage('navigate', '*');
+        } else {
+            delete sessionStorage.didNav;
+
+            resources = performance.getEntriesByType('resource');
+            shouldBe('resources.length', '1');
+            shouldBeEqualToString('resources[0].name', 'http://127.0.0.1:8000/js-test-resources/js-test.js');
+            if (window.testRunner)
+                finishJSTest();
+        }
+    }
+    window._onload_ = runTest;
+</script>
+<iframe id="target-iframe" src=""

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe.html (238977 => 238978)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe.html	2018-12-08 00:24:59 UTC (rev 238977)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe.html	2018-12-08 00:25:03 UTC (rev 238978)
@@ -14,7 +14,7 @@
             delete sessionStorage.didNav;
             window.addEventListener('message', (event) => {
                 resources = performance.getEntriesByType('resource');
-                shouldBe('resources.length', '1');
+                shouldBe('resources.length', '1'); // There is only one report as we don't report resource timing for cached main document.
                 shouldBeEqualToString('resources[0].name', 'http://127.0.0.1:8000/js-test-resources/js-test.js');
                 if (window.testRunner)
                     finishJSTest();

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog (238977 => 238978)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-12-08 00:24:59 UTC (rev 238977)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-12-08 00:25:03 UTC (rev 238978)
@@ -1,3 +1,23 @@
+2018-11-30  Jiewen Tan  <[email protected]>
+
+        Don't report resource timing to parent frame for history items
+        https://bugs.webkit.org/show_bug.cgi?id=192273
+        <rdar://problem/45163764>
+
+        Reviewed by Youenn Fablet.
+
+        We should not report history items to its parent frame as those are less
+        interested to its parent and might not be the first navigation in the iframes.
+
+        This change aligns the behavior when a cached document is not available for the
+        history item with the available case as we don't report resource timing for any
+        cached main document.
+
+        Test: http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadDifferentDocumentItem):
+
 2018-11-21  Michael Catanzaro  <[email protected]>
 
         [FreeType] Problem under WebCore::FontPlatformData::FontPlatformData

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/FrameLoader.cpp (238977 => 238978)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/FrameLoader.cpp	2018-12-08 00:24:59 UTC (rev 238977)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/FrameLoader.cpp	2018-12-08 00:25:03 UTC (rev 238978)
@@ -3586,6 +3586,9 @@
 // methods of FrameLoader.
 void FrameLoader::loadDifferentDocumentItem(HistoryItem& item, FrameLoadType loadType, FormSubmissionCacheLoadPolicy cacheLoadPolicy, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad)
 {
+    // History items should not be reported to the parent.
+    m_shouldReportResourceTimingToParentFrame = false;
+
     // Remember this item so we can traverse any child items as child frames load
     history().setProvisionalItem(&item);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to