Diff
Modified: branches/safari-604.5.100-branch/LayoutTests/ChangeLog (225542 => 225543)
--- branches/safari-604.5.100-branch/LayoutTests/ChangeLog 2017-12-05 22:03:34 UTC (rev 225542)
+++ branches/safari-604.5.100-branch/LayoutTests/ChangeLog 2017-12-05 22:03:38 UTC (rev 225543)
@@ -1,3 +1,19 @@
+2017-12-04 Jason Marcell <jmarc...@apple.com>
+
+ Cherry-pick r225381. rdar://problem/35839452
+
+ 2017-11-30 Alex Christensen <achristen...@webkit.org>
+
+ Extra PerformanceEntryList entry after iframe navigation
+ https://bugs.webkit.org/show_bug.cgi?id=178433
+
+ Reviewed by Joseph Pecoraro.
+
+ * http/tests/security/PerformanceEntryList-parent-only-first-navigation-expected.txt: Added.
+ * http/tests/security/PerformanceEntryList-parent-only-first-navigation.html: Added.
+ * http/tests/security/resources/navigate-and-postMessage.html: Added.
+ * http/tests/security/resources/postMessage.html: Added.
+
2017-11-30 Jason Marcell <jmarc...@apple.com>
Cherry-pick r225141. rdar://problem/35732184
Added: branches/safari-604.5.100-branch/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation-expected.txt (0 => 225543)
--- branches/safari-604.5.100-branch/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation-expected.txt (rev 0)
+++ branches/safari-604.5.100-branch/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation-expected.txt 2017-12-05 22:03:38 UTC (rev 225543)
@@ -0,0 +1,2 @@
+ALERT: posting message 1 http://127.0.0.1:8000/security/resources/navigate-and-postMessage.html
+
Added: branches/safari-604.5.100-branch/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation.html (0 => 225543)
--- branches/safari-604.5.100-branch/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation.html (rev 0)
+++ branches/safari-604.5.100-branch/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation.html 2017-12-05 22:03:38 UTC (rev 225543)
@@ -0,0 +1,13 @@
+<script>
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ }
+ window.addEventListener("message", (e)=>{
+ var entries = performance.getEntriesByType("resource");
+ alert(e.data + " " + entries.length + " " + entries[0].name);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, false);
+</script>
+<iframe src=""
Added: branches/safari-604.5.100-branch/LayoutTests/http/tests/security/resources/navigate-and-postMessage.html (0 => 225543)
--- branches/safari-604.5.100-branch/LayoutTests/http/tests/security/resources/navigate-and-postMessage.html (rev 0)
+++ branches/safari-604.5.100-branch/LayoutTests/http/tests/security/resources/navigate-and-postMessage.html 2017-12-05 22:03:38 UTC (rev 225543)
@@ -0,0 +1,3 @@
+<script>
+ window.location = "postMessage.html";
+</script>
Added: branches/safari-604.5.100-branch/LayoutTests/http/tests/security/resources/postMessage.html (0 => 225543)
--- branches/safari-604.5.100-branch/LayoutTests/http/tests/security/resources/postMessage.html (rev 0)
+++ branches/safari-604.5.100-branch/LayoutTests/http/tests/security/resources/postMessage.html 2017-12-05 22:03:38 UTC (rev 225543)
@@ -0,0 +1,3 @@
+<script>
+ window.parent.postMessage("posting message", "*");
+</script>
Modified: branches/safari-604.5.100-branch/Source/WebCore/ChangeLog (225542 => 225543)
--- branches/safari-604.5.100-branch/Source/WebCore/ChangeLog 2017-12-05 22:03:34 UTC (rev 225542)
+++ branches/safari-604.5.100-branch/Source/WebCore/ChangeLog 2017-12-05 22:03:38 UTC (rev 225543)
@@ -1,3 +1,24 @@
+2017-12-04 Jason Marcell <jmarc...@apple.com>
+
+ Cherry-pick r225381. rdar://problem/35839452
+
+ 2017-11-30 Alex Christensen <achristen...@webkit.org>
+
+ Extra PerformanceEntryList entry after iframe navigation
+ https://bugs.webkit.org/show_bug.cgi?id=178433
+
+ Reviewed by Joseph Pecoraro.
+
+ Test: http/tests/security/PerformanceEntryList-parent-only-first-navigation.html
+
+ When an iframe is loaded, its main resource load should be reported to the parent frame's PerformanceEntryList.
+ Subsequent main resource loads should not.
+
+ * loader/FrameLoader.h:
+ (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
+ * loader/ResourceTimingInformation.cpp:
+ (WebCore::ResourceTimingInformation::addResourceTiming):
+
2017-11-30 Jason Marcell <jmarc...@apple.com>
Cherry-pick r225141. rdar://problem/35732184
Modified: branches/safari-604.5.100-branch/Source/WebCore/loader/FrameLoader.h (225542 => 225543)
--- branches/safari-604.5.100-branch/Source/WebCore/loader/FrameLoader.h 2017-12-05 22:03:34 UTC (rev 225542)
+++ branches/safari-604.5.100-branch/Source/WebCore/loader/FrameLoader.h 2017-12-05 22:03:38 UTC (rev 225543)
@@ -157,6 +157,9 @@
DocumentLoader* provisionalDocumentLoader() const { return m_provisionalDocumentLoader.get(); }
FrameState state() const { return m_state; }
+ void setShouldReportResourceTimingToParentFrame(bool value) { m_shouldReportResourceTimingToParentFrame = value; }
+ bool shouldReportResourceTimingToParentFrame() { return m_shouldReportResourceTimingToParentFrame; };
+
#if PLATFORM(IOS)
RetainPtr<CFDictionaryRef> connectionProperties(ResourceLoader*);
#endif
@@ -418,6 +421,7 @@
bool m_quickRedirectComing;
bool m_sentRedirectNotification;
bool m_inStopAllLoaders;
+ bool m_shouldReportResourceTimingToParentFrame { true };
String m_outgoingReferrer;
Modified: branches/safari-604.5.100-branch/Source/WebCore/loader/ResourceTimingInformation.cpp (225542 => 225543)
--- branches/safari-604.5.100-branch/Source/WebCore/loader/ResourceTimingInformation.cpp 2017-12-05 22:03:34 UTC (rev 225542)
+++ branches/safari-604.5.100-branch/Source/WebCore/loader/ResourceTimingInformation.cpp 2017-12-05 22:03:38 UTC (rev 225543)
@@ -71,8 +71,10 @@
return;
Document* initiatorDocument = &document;
- if (resource.type() == CachedResource::MainResource)
+ if (resource.type() == CachedResource::MainResource && document.frame() && document.frame()->loader().shouldReportResourceTimingToParentFrame()) {
+ document.frame()->loader().setShouldReportResourceTimingToParentFrame(false);
initiatorDocument = document.parentDocument();
+ }
if (!initiatorDocument)
return;
if (!initiatorDocument->domWindow())