Title: [239085] branches/safari-606-branch
- Revision
- 239085
- Author
- [email protected]
- Date
- 2018-12-11 13:12:11 -0800 (Tue, 11 Dec 2018)
Log Message
Cherry-pick r238877. rdar://problem/45997440
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Added Paths
Diff
Modified: branches/safari-606-branch/LayoutTests/ChangeLog (239084 => 239085)
--- branches/safari-606-branch/LayoutTests/ChangeLog 2018-12-11 21:12:07 UTC (rev 239084)
+++ branches/safari-606-branch/LayoutTests/ChangeLog 2018-12-11 21:12:11 UTC (rev 239085)
@@ -1,3 +1,47 @@
+2018-12-11 Alan Coon <[email protected]>
+
+ Cherry-pick r238877. rdar://problem/45997440
+
+ 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:
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 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-12-05 Alan Coon <[email protected]>
Apply patch. rdar://problem/45997392
Added: branches/safari-606-branch/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2-expected.txt (0 => 239085)
--- branches/safari-606-branch/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2-expected.txt (rev 0)
+++ branches/safari-606-branch/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2-expected.txt 2018-12-11 21:12:11 UTC (rev 239085)
@@ -0,0 +1,12 @@
+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: branches/safari-606-branch/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html (from rev 239084, branches/safari-606-branch/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe.html) (0 => 239085)
--- branches/safari-606-branch/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html (rev 0)
+++ branches/safari-606-branch/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html 2018-12-11 21:12:11 UTC (rev 239085)
@@ -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: branches/safari-606-branch/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe.html (239084 => 239085)
--- branches/safari-606-branch/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe.html 2018-12-11 21:12:07 UTC (rev 239084)
+++ branches/safari-606-branch/LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe.html 2018-12-11 21:12:11 UTC (rev 239085)
@@ -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: branches/safari-606-branch/Source/WebCore/ChangeLog (239084 => 239085)
--- branches/safari-606-branch/Source/WebCore/ChangeLog 2018-12-11 21:12:07 UTC (rev 239084)
+++ branches/safari-606-branch/Source/WebCore/ChangeLog 2018-12-11 21:12:11 UTC (rev 239085)
@@ -1,5 +1,57 @@
2018-12-11 Alan Coon <[email protected]>
+ Cherry-pick r238877. rdar://problem/45997440
+
+ 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:
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 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-12-11 Alan Coon <[email protected]>
+
Cherry-pick r238582. rdar://problem/46085283
Refactor duplicate code for calling into media controls
Modified: branches/safari-606-branch/Source/WebCore/loader/FrameLoader.cpp (239084 => 239085)
--- branches/safari-606-branch/Source/WebCore/loader/FrameLoader.cpp 2018-12-11 21:12:07 UTC (rev 239084)
+++ branches/safari-606-branch/Source/WebCore/loader/FrameLoader.cpp 2018-12-11 21:12:11 UTC (rev 239085)
@@ -3572,6 +3572,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