Only report resource timing to parent frame for the first iframe load
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2018 18:49:03 +0000 (18:49 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2018 18:49:03 +0000 (18:49 +0000)
commit0709602ed87b8085d02587ccda14b59ca322d608
tree6347c8ef44686b2eea6fea9c2bd7da340a033de3
parentaa978e22b43ef078df661b3409ca665b29b2dd2a
Only report resource timing to parent frame for the first iframe load
https://bugs.webkit.org/show_bug.cgi?id=190498
<rdar://problem/44347398>

Reviewed by Youenn Fablet.

Source/WebCore:

Only the first iframe navigation or the first iframe navigation after about:blank should be reported.
https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface

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

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):
* loader/FrameLoader.h:
(WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
(WebCore::FrameLoader::setShouldReportResourceTimingToParentFrame): Deleted.
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::addResourceTiming):

LayoutTests:

The layout test is from Chromium change:
https://chromium-review.googlesource.com/c/chromium/src/+/1186215.

* http/tests/misc/resource-timing-navigation-in-restored-iframe-expected.txt: Added.
* http/tests/misc/resource-timing-navigation-in-restored-iframe.html: Added.
* http/tests/misc/resources/alert-then-back.html: Added.
* http/tests/misc/resources/navigate-on-message.html: Added.
* http/tests/misc/resources/post-message-to-parent.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/misc/resource-timing-navigation-in-restored-iframe.html [new file with mode: 0644]
LayoutTests/http/tests/misc/resources/alert-then-back.html [new file with mode: 0644]
LayoutTests/http/tests/misc/resources/navigate-on-message.html [new file with mode: 0644]
LayoutTests/http/tests/misc/resources/post-message-to-parent.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/ResourceTimingInformation.cpp