<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[278738] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/278738">278738</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2021-06-10 16:29:57 -0700 (Thu, 10 Jun 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move Timing-Allow-Origin checks to the network process
https://bugs.webkit.org/show_bug.cgi?id=226678
<rdar://problem/45227788>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/resource-timing/CodingConventions.md: Added.
* web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https-expected.txt: Added.
* web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https.html: Added.
* web-platform-tests/resource-timing/SyntheticResponse.py:
(main):
* web-platform-tests/resource-timing/TAO-match-expected.txt: Added.
* web-platform-tests/resource-timing/TAO-match.html: Added.
* web-platform-tests/resource-timing/TAO-null-opaque-origin-expected.txt: Added.
* web-platform-tests/resource-timing/TAO-null-opaque-origin.html: Added.
* web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin-expected.txt: Added.
* web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin.html: Added.
* web-platform-tests/resource-timing/__init__.py: Added.
* web-platform-tests/resource-timing/buffer-full-add-after-full-event-expected.txt:
* web-platform-tests/resource-timing/buffer-full-add-after-full-event.html:
* web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-expected.txt:
* web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop.html:
* web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html:
* web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt:
* web-platform-tests/resource-timing/buffer-full-add-then-clear.html:
* web-platform-tests/resource-timing/buffer-full-decrease-buffer-during-callback.html:
* web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback-expected.txt:
* web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html:
* web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback-expected.txt:
* web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html:
* web-platform-tests/resource-timing/buffer-full-set-to-current-buffer-expected.txt:
* web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html:
* web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback-expected.txt:
* web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html:
* web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt:
* web-platform-tests/resource-timing/buffer-full-then-increased.html:
* web-platform-tests/resource-timing/buffer-full-when-populate-entries-expected.txt:
* web-platform-tests/resource-timing/buffer-full-when-populate-entries.html:
All these buffer-full tests start failing when I update them.
That is an unrelated bug.  Firefox has the same bug, and we had the same bug before and after this change.
* web-platform-tests/resource-timing/connection-reuse-expected.txt: Added.
* web-platform-tests/resource-timing/connection-reuse.html: Added.
* web-platform-tests/resource-timing/connection-reuse.https-expected.txt: Added.
* web-platform-tests/resource-timing/connection-reuse.https.html: Added.
* web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects-expected.txt: Added.
* web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects.html: Added.
* web-platform-tests/resource-timing/cross-origin-status-codes.html:
* web-platform-tests/resource-timing/document-domain-no-impact-opener-expected.txt: Added.
* web-platform-tests/resource-timing/document-domain-no-impact-opener.html: Added.
* web-platform-tests/resource-timing/entry-attributes-expected.txt: Added.
* web-platform-tests/resource-timing/entry-attributes.html: Added.
* web-platform-tests/resource-timing/fetch-cross-origin-redirect.https-expected.txt: Added.
* web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html: Added.
* web-platform-tests/resource-timing/font-timestamps-expected.txt: Added.
* web-platform-tests/resource-timing/font-timestamps.html: Added.
* web-platform-tests/resource-timing/iframe-failed-commit-expected.txt: Added.
* web-platform-tests/resource-timing/iframe-failed-commit.html: Added.
* web-platform-tests/resource-timing/initiator-type-for-script-expected.txt: Added.
* web-platform-tests/resource-timing/initiator-type-for-script.html: Added.
* web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https-expected.txt: Added.
* web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https.html: Added.
* web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect-expected.txt: Added.
* web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect.html: Added.
* web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect-expected.txt: Added.
* web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect.html: Added.
* web-platform-tests/resource-timing/redirects-expected.txt: Added.
* web-platform-tests/resource-timing/redirects.html: Added.
* web-platform-tests/resource-timing/resource-ignore-data-url-expected.txt: Added.
* web-platform-tests/resource-timing/resource-ignore-data-url.html: Added.
* web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain-expected.txt:
This apparent regression is actually a progression.
When this test is run from our test infrastructure, Chrome and Firefox fail the same tests that you see now failing here,
indicating that something is wrong with our test infrastructure.  When run on wpt.live, all browsers pass this test
after this change.
* web-platform-tests/resource-timing/resource_cached.html: Added.
* web-platform-tests/resource-timing/resource_initiator_types.html:
* web-platform-tests/resource-timing/resource_nested_dedicated_worker.worker.js:
(async_test):
(async_test.async const): Deleted.
* web-platform-tests/resource-timing/resource_timing_content_length-expected.txt: Added.
* web-platform-tests/resource-timing/resource_timing_content_length.html: Added.
* web-platform-tests/resource-timing/resources/200_empty.asis: Added.
* web-platform-tests/resource-timing/resources/TAOResponse.py:
(main):
* web-platform-tests/resource-timing/resources/all_resource_types.html: Added.
* web-platform-tests/resource-timing/resources/buffer-full-utilities.js:
(const.waitForNextTask):
(const.forceBufferFullEvent.async clearBufferAndSetSize):
(const.forceBufferFullEvent):
(const.fillUpTheBufferWithTwoResources.async clearBufferAndSetSize):
(async const.fillUpTheBufferWithSingleResource.async clearBufferAndSetSize):
(async const):
(let.appendScript): Deleted.
(let.waitForNextTask): Deleted.
(let.waitUntilConditionIsMet.cond.return.new.Promise.resolve.let.checkCondition): Deleted.
(let.waitForEventToFire.return.new.Promise): Deleted.
(let.waitForEventToFire): Deleted.
(let.fillUpTheBufferWithTwoResources.async src): Deleted.
* web-platform-tests/resource-timing/resources/cacheable-and-validated.py: Added.
(main):
* web-platform-tests/resource-timing/resources/connection-reuse-test.js: Added.
(attribute_test.async client):
(attribute_test):
* web-platform-tests/resource-timing/resources/csp-default-none.html: Added.
* web-platform-tests/resource-timing/resources/csp-default-none.html.headers: Added.
* web-platform-tests/resource-timing/resources/document-domain-no-impact.html: Added.
* web-platform-tests/resource-timing/resources/document-refreshed.html: Added.
* web-platform-tests/resource-timing/resources/document-that-refreshes.html: Added.
* web-platform-tests/resource-timing/resources/embed-refresh.html: Added.
* web-platform-tests/resource-timing/resources/green-frame.html: Added.
* web-platform-tests/resource-timing/resources/green.html: Added.
* web-platform-tests/resource-timing/resources/green.html.headers: Added.
* web-platform-tests/resource-timing/resources/gzip_xml.py:
* web-platform-tests/resource-timing/resources/iframe-refresh.html: Added.
* web-platform-tests/resource-timing/resources/iframe-reload-TAO.sub.html:
* web-platform-tests/resource-timing/resources/multi_redirect.py:
(main):
* web-platform-tests/resource-timing/resources/object-refresh.html: Added.
* web-platform-tests/resource-timing/resources/redirect-cors.py: Added.
(main):
* web-platform-tests/resource-timing/resources/resource-timing-content-length.py: Added.
(main):
* web-platform-tests/resource-timing/resources/resource_timing_test0.xml:
* web-platform-tests/resource-timing/resources/sizes-helper.js: Added.
(const.checkSizeFields):
* web-platform-tests/resource-timing/resources/status-code.py:
(main):
* web-platform-tests/resource-timing/resources/webperftestharness.js:
(test_namespace):
(test_attribute_exists):
(test_enum):
* web-platform-tests/resource-timing/resources/webperftestharnessextension.js:
(test_method_exists):
* web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect-expected.txt: Added.
* web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect.html: Added.
* web-platform-tests/resource-timing/sizes-cache.any.js: Added.
(const.accumulateEntries):
(const.checkResourceSizes.list.let.entry.of.entries.else):
(promise_test):
* web-platform-tests/resource-timing/sizes-redirect-img-expected.txt: Added.
* web-platform-tests/resource-timing/sizes-redirect-img.html: Added.
* web-platform-tests/resource-timing/sizes-redirect.any.js: Added.
(const.accumulateEntry):
(const.checkResourceSizes):
(const.redirectUrl):
(promise_test):
* web-platform-tests/resource-timing/status-codes-create-entry.html:
* web-platform-tests/resource-timing/test_resource_timing-expected.txt:
* web-platform-tests/resource-timing/test_resource_timing.https-expected.txt:
* web-platform-tests/resource-timing/workerStart-tao-protected.https.html:

Source/WebCore:

We tried hard to do it in the web process by keeping track of whether the last redirect was cross-origin
and checking the final response and original security origin.  We got many tests to pass, but to get the rest
and be correct, we need to check the Timing-Allow-Origin header field of each redirect against the original security origin.

Tests: imported/w3c/web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https.html
       imported/w3c/web-platform-tests/resource-timing/TAO-match.html
       imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin.html
       imported/w3c/web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin.html
       imported/w3c/web-platform-tests/resource-timing/connection-reuse.html
       imported/w3c/web-platform-tests/resource-timing/connection-reuse.https.html
       imported/w3c/web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects.html
       imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-opener.html
       imported/w3c/web-platform-tests/resource-timing/entry-attributes.html
       imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html
       imported/w3c/web-platform-tests/resource-timing/font-timestamps.html
       imported/w3c/web-platform-tests/resource-timing/iframe-failed-commit.html
       imported/w3c/web-platform-tests/resource-timing/initiator-type-for-script.html
       imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https.html
       imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect.html
       imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect.html
       imported/w3c/web-platform-tests/resource-timing/redirects.html
       imported/w3c/web-platform-tests/resource-timing/resource-ignore-data-url.html
       imported/w3c/web-platform-tests/resource-timing/resource_cached.html
       imported/w3c/web-platform-tests/resource-timing/resource_timing_content_length.html
       imported/w3c/web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect.html
       imported/w3c/web-platform-tests/resource-timing/sizes-redirect-img.html

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::start):
Get a SecurityOrigin for our WebKitLegacy ResourceHandle use like we do in WebLoaderStrategy::scheduleLoadFromNetworkProcess
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::initServerTiming):
(WebCore::ResourceTiming::isolatedCopy const):
(WebCore::passesTimingAllowCheck): Deleted.
* loader/ResourceTiming.h:
(WebCore::ResourceTiming::networkLoadMetrics const):
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::allowTimingDetails const): Deleted.
(): Deleted.
* page/PerformanceNavigation.cpp:
(WebCore::PerformanceNavigation::redirectCount const):
* page/PerformanceNavigationTiming.cpp:
(WebCore::PerformanceNavigationTiming::sameOriginCheckFails const):
(WebCore::PerformanceNavigationTiming::redirectCount const):
* page/PerformanceResourceTiming.cpp:
(WebCore::entryStartTime):
(WebCore::entryEndTime):
(WebCore::PerformanceResourceTiming::redirectStart const):
(WebCore::PerformanceResourceTiming::redirectEnd const):
(WebCore::PerformanceResourceTiming::domainLookupStart const):
(WebCore::PerformanceResourceTiming::domainLookupEnd const):
(WebCore::PerformanceResourceTiming::connectStart const):
(WebCore::PerformanceResourceTiming::connectEnd const):
(WebCore::PerformanceResourceTiming::secureConnectionStart const):
(WebCore::PerformanceResourceTiming::requestStart const):
(WebCore::PerformanceResourceTiming::responseStart const):
(WebCore::PerformanceResourceTiming::transferSize const):
(WebCore::PerformanceResourceTiming::encodedBodySize const):
(WebCore::PerformanceResourceTiming::decodedBodySize const):
* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::unloadEventStart const):
(WebCore::PerformanceTiming::unloadEventEnd const):
(WebCore::PerformanceTiming::redirectStart const):
(WebCore::PerformanceTiming::redirectEnd const):
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::BlobResourceHandle):
* platform/network/NetworkLoadMetrics.h:
(WebCore::NetworkLoadMetrics::isolatedCopy const):
(WebCore::NetworkLoadMetrics::operator== const):
(WebCore::NetworkLoadMetrics::encode const):
(WebCore::NetworkLoadMetrics::decode):
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::ResourceHandle):
(WebCore::ResourceHandle::create):
(WebCore::ResourceHandle::loadResourceSynchronously):
(WebCore::ResourceHandle::isCrossOriginWithoutTAO const):
(WebCore::ResourceHandle::markAsCrossOriginWithoutTAO):
(WebCore::ResourceHandle::sourceOrigin const):
(WebCore::ResourceHandle::hasCrossOriginRedirect const): Deleted.
(WebCore::ResourceHandle::setHasCrossOriginRedirect): Deleted.
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/TimingAllowOrigin.cpp: Added.
(WebCore::passesTimingAllowOriginCheck):
* platform/network/TimingAllowOrigin.h: Added.
* platform/network/cocoa/NetworkLoadMetrics.mm:
(WebCore::packageTimingData):
(WebCore::copyTimingData):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):

Source/WebKit:

* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::sendReplyToSynchronousRequest):
Pass complete metrics with sync xhr responses.  Many of the tests use sync xhr.
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::didFailLoading):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):

Source/WebKitLegacy:

* WebCoreSupport/PingHandle.h:
* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::loadResourceSynchronously):

LayoutTests:

* TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingSyntheticResponsepy">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SyntheticResponse.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOnullopaqueoriginsubexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin.sub-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfulladdentriesduringcallbackhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfulladdthenclearexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfulladdthenclearhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullincreasebufferduringcallbackhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullinspectbufferduringcallbackexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullinspectbufferduringcallbackhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullsettocurrentbufferexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullsettocurrentbufferhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullstoreandclearduringcallbackexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullstoreandclearduringcallbackhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullthenincreasedexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullthenincreasedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullwhenpopulateentriesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullwhenpopulateentrieshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingcrossoriginstatuscodeshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-status-codes.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_TAO_cross_origin_redirect_chainexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_initiator_typeshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_initiator_types.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_nested_dedicated_workerworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_nested_dedicated_worker.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesTAOResponsepy">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/TAOResponse.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesbufferfullutilitiesjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/buffer-full-utilities.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesgzip_xmlpy">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/gzip_xml.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesiframereloadTAOsubhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-reload-TAO.sub.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesmulti_redirectpy">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/multi_redirect.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesresource_timing_test0xml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/resource_timing_test0.xml</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesstatuscodepy">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/status-code.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourceswebperftestharnessjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharness.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourceswebperftestharnessextensionjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharnessextension.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingstatuscodescreateentryhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingtest_resource_timingexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingtest_resource_timinghttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingworkerStarttaoprotectedhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/workerStart-tao-protected.https.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsnavigationtimingnav2_test_attributes_valuesexpectedtxt">trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsresourcetimingnextHopProtocoltaoprotectedhttpsexpectedtxt">trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-tao-protected.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreHeaderscmake">trunk/Source/WebCore/Headers.cmake</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadercpp">trunk/Source/WebCore/loader/ResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceTimingcpp">trunk/Source/WebCore/loader/ResourceTiming.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceTimingh">trunk/Source/WebCore/loader/ResourceTiming.h</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceNavigationcpp">trunk/Source/WebCore/page/PerformanceNavigation.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceNavigationTimingcpp">trunk/Source/WebCore/page/PerformanceNavigationTiming.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceResourceTimingcpp">trunk/Source/WebCore/page/PerformanceResourceTiming.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceTimingcpp">trunk/Source/WebCore/page/PerformanceTiming.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp">trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkNetworkLoadMetricsh">trunk/Source/WebCore/platform/network/NetworkLoadMetrics.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandlecpp">trunk/Source/WebCore/platform/network/ResourceHandle.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleh">trunk/Source/WebCore/platform/network/ResourceHandle.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleInternalh">trunk/Source/WebCore/platform/network/ResourceHandleInternal.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfResourceHandleCFNetcpp">trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcocoaNetworkLoadMetricsmm">trunk/Source/WebCore/platform/network/cocoa/NetworkLoadMetrics.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlCurlCacheEntrycpp">trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlCurlCacheManagercpp">trunk/Source/WebCore/platform/network/curl/CurlCacheManager.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlCurlResourceHandleDelegatecpp">trunk/Source/WebCore/platform/network/curl/CurlResourceHandleDelegate.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlResourceHandleCurlcpp">trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlSynchronousLoaderClientCurlcpp">trunk/Source/WebCore/platform/network/curl/SynchronousLoaderClientCurl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm">trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacWebCoreResourceHandleAsOperationQueueDelegatemm">trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworksoupCredentialStorageSoupcpp">trunk/Source/WebCore/platform/network/soup/CredentialStorageSoup.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworksoupResourceHandleSoupcpp">trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkLoadParametersh">trunk/Source/WebKit/NetworkProcess/NetworkLoadParameters.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkResourceLoadParametersh">trunk/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkResourceLoadercpp">trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscocoaNetworkDataTaskCocoah">trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscocoaNetworkDataTaskCocoamm">trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscocoaNetworkSessionCocoamm">trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesssoupNetworkDataTaskSoupcpp">trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp</a></li>
<li><a href="#trunkSourceWebKitLegacyChangeLog">trunk/Source/WebKitLegacy/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacyWebCoreSupportPingHandleh">trunk/Source/WebKitLegacy/WebCoreSupport/PingHandle.h</a></li>
<li><a href="#trunkSourceWebKitLegacyWebCoreSupportWebResourceLoadSchedulercpp">trunk/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingCodingConventionsmd">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/CodingConventions.md</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingSOXOSOredirectchaintaohttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingSOXOSOredirectchaintaohttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOmatchexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-match-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOmatchhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-match.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOnullopaqueoriginexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOnullopaqueoriginhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOportmismatchmeanscrossoriginexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOportmismatchmeanscrossoriginhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetiming__init__py">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/__init__.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingconnectionreuseexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingconnectionreusehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingconnectionreusehttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingconnectionreusehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingcrossoriginstartendtimewithredirectsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingcrossoriginstartendtimewithredirectshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingdocumentdomainnoimpactopenerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-opener-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingdocumentdomainnoimpactopenerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-opener.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingentryattributesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/entry-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingentryattributeshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/entry-attributes.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingfetchcrossoriginredirecthttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingfetchcrossoriginredirecthttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingfonttimestampsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/font-timestamps-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingfonttimestampshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/font-timestamps.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingiframefailedcommitexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-failed-commit-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingiframefailedcommithtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-failed-commit.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetiminginitiatortypeforscriptexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/initiator-type-for-script-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetiminginitiatortypeforscripthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/initiator-type-for-script.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingnextHopProtocolistaoprotectedhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingnextHopProtocolistaoprotectedhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingobjectnotfoundafterTAOcrossoriginredirectexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingobjectnotfoundafterTAOcrossoriginredirecthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingobjectnotfoundaftercrossoriginredirectexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingobjectnotfoundaftercrossoriginredirecthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingredirectsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/redirects-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingredirectshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/redirects.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourceignoredataurlexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-ignore-data-url-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourceignoredataurlhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-ignore-data-url.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_cachedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_cached.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_timing_content_lengthexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_content_length-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_timing_content_lengthhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_content_length.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresources200_emptyasis">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/200_empty.asis</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesall_resource_typeshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/all_resource_types.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcescacheableandvalidatedpy">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/cacheable-and-validated.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesconnectionreusetestjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/connection-reuse-test.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcescspdefaultnonehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/csp-default-none.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcescspdefaultnonehtmlheaders">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/csp-default-none.html.headers</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesdocumentdomainnoimpacthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-domain-no-impact.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesdocumentrefreshedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-refreshed.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesdocumentthatrefresheshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-that-refreshes.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesembedrefreshhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/embed-refresh.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesgreenframehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green-frame.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesgreenhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesgreenhtmlheaders">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green.html.headers</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesiframerefreshhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-refresh.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesobjectrefreshhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/object-refresh.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesredirectcorspy">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/redirect-cors.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesresourcetimingcontentlengthpy">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/resource-timing-content-length.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcessizeshelperjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/sizes-helper.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsameoriginfromcrossoriginredirectexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsameoriginfromcrossoriginredirecthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsizescacheanyjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-cache.any.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsizesredirectimgexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect-img-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsizesredirectimghtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect-img.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsizesredirectanyjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect.any.js</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsresourcetimingobjectnotfoundafterTAOcrossoriginredirectexpectedtxt">trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsresourcetimingobjectnotfoundaftercrossoriginredirectexpectedtxt">trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsresourcetimingredirectsexpectedtxt">trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/redirects-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkTimingAllowOrigincpp">trunk/Source/WebCore/platform/network/TimingAllowOrigin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkTimingAllowOriginh">trunk/Source/WebCore/platform/network/TimingAllowOrigin.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/ChangeLog 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2021-06-10  Alex Christensen  <achristensen@webkit.org>
+
+        Move Timing-Allow-Origin checks to the network process
+        https://bugs.webkit.org/show_bug.cgi?id=226678
+        <rdar://problem/45227788>
+
+        Reviewed by Chris Dumez.
+
+        * TestExpectations:
+
</ins><span class="cx"> 2021-06-10  Cameron McCormack  <heycam@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Move some Mac MathML test expectation files around
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/TestExpectations  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -933,6 +933,10 @@
</span><span class="cx"> imported/w3c/web-platform-tests/mediacapture-fromelement/capture.html [ Failure ]
</span><span class="cx"> imported/w3c/web-platform-tests/mediacapture-fromelement/ended.html [ Failure ]
</span><span class="cx"> imported/w3c/web-platform-tests/mediacapture-fromelement/creation.html [ Pass Failure ]
</span><ins>+imported/w3c/web-platform-tests/resource-timing/font-timestamps.html [ Failure ]
+imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html [ Pass Failure ]
+imported/w3c/web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https.html [ Failure ]
+imported/w3c/web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain.html [ Failure ]
</ins><span class="cx"> webkit.org/b/180240 imported/w3c/web-platform-tests/resource-timing/single-entry-per-resource.html [ Pass Failure ]
</span><span class="cx"> webkit.org/b/189906 imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_eventually.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/resource-timing/resource-reload-TAO.sub.html [ Skip ]
</span><span class="lines">@@ -942,8 +946,12 @@
</span><span class="cx"> imported/w3c/web-platform-tests/resource-timing/cors-preflight.any.html [ Failure Pass ]
</span><span class="cx"> imported/w3c/web-platform-tests/resource-timing/crossorigin-sandwich-TAO.sub.html [ Pass Failure ]
</span><span class="cx"> imported/w3c/web-platform-tests/resource-timing/crossorigin-sandwich-partial-TAO.sub.html [ Pass Failure ]
</span><ins>+imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values.html [ Pass Failure ]
</ins><span class="cx"> imported/w3c/web-platform-tests/navigation-timing/secure_connection_start_non_zero.https.html [ Pass Failure ]
</span><span class="cx"> imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values.html [ Pass Failure ]
</span><ins>+imported/w3c/web-platform-tests/resource-timing/TAO-match.html [ Pass Failure ]
+imported/w3c/web-platform-tests/resource-timing/iframe-failed-commit.html [ Pass Failure ]
+imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html [ Pass Failure ]
</ins><span class="cx"> 
</span><span class="cx"> imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https.html [ DumpJSConsoleLogInStdErr ]
</span><span class="cx"> imported/w3c/web-platform-tests/mediacapture-record/passthrough/MediaRecorder-passthrough.https.html [ Failure Timeout Pass ]
</span><span class="lines">@@ -1390,14 +1398,17 @@
</span><span class="cx"> imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https.html [ Pass Failure ]
</span><span class="cx"> imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/resource-timing/buffer-full-decrease-buffer-during-callback.html [ Skip ]
</span><ins>+imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html [ Skip ]
+imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html [ Skip ]
</ins><span class="cx"> imported/w3c/web-platform-tests/resource-timing/cross-origin-status-codes.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/resource-timing/nested-context-navigations-embed.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/resource-timing/nested-context-navigations-iframe.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/resource-timing/nested-context-navigations-object.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/resource-timing/resource_nested_dedicated_worker.worker.html [ Skip ]
</span><ins>+imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html [ Skip ]
+imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html [ Skip ]
+imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-opener.html [ Skip ]
</ins><span class="cx"> 
</span><del>-imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse.html [ Failure ]
-imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse.https.html [ Failure ]
</del><span class="cx"> imported/w3c/web-platform-tests/resource-timing/resource_reparenting.html [ Failure ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/168357 http/wpt/resource-timing/rt-initiatorType-media.html [ Failure ]
</span><span class="lines">@@ -4881,4 +4892,4 @@
</span><span class="cx"> imported/w3c/web-platform-tests/css/css-color/predefined-013.html [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/226884 imported/w3c/web-platform-tests/service-workers/service-worker/credentials.https.html [ Failure ]
</span><del>-webkit.org/b/226884 imported/w3c/web-platform-tests/content-security-policy/reporting/report-only-in-meta.sub.html [ Failure ]
</del><span class="cx">\ No newline at end of file
</span><ins>+webkit.org/b/226884 imported/w3c/web-platform-tests/content-security-policy/reporting/report-only-in-meta.sub.html [ Failure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,3 +1,156 @@
</span><ins>+2021-06-10  Alex Christensen  <achristensen@webkit.org>
+
+        Move Timing-Allow-Origin checks to the network process
+        https://bugs.webkit.org/show_bug.cgi?id=226678
+        <rdar://problem/45227788>
+
+        Reviewed by Chris Dumez.
+
+        * web-platform-tests/resource-timing/CodingConventions.md: Added.
+        * web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https-expected.txt: Added.
+        * web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https.html: Added.
+        * web-platform-tests/resource-timing/SyntheticResponse.py:
+        (main):
+        * web-platform-tests/resource-timing/TAO-match-expected.txt: Added.
+        * web-platform-tests/resource-timing/TAO-match.html: Added.
+        * web-platform-tests/resource-timing/TAO-null-opaque-origin-expected.txt: Added.
+        * web-platform-tests/resource-timing/TAO-null-opaque-origin.html: Added.
+        * web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin-expected.txt: Added.
+        * web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin.html: Added.
+        * web-platform-tests/resource-timing/__init__.py: Added.
+        * web-platform-tests/resource-timing/buffer-full-add-after-full-event-expected.txt:
+        * web-platform-tests/resource-timing/buffer-full-add-after-full-event.html:
+        * web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-expected.txt:
+        * web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop.html:
+        * web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html:
+        * web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt:
+        * web-platform-tests/resource-timing/buffer-full-add-then-clear.html:
+        * web-platform-tests/resource-timing/buffer-full-decrease-buffer-during-callback.html:
+        * web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback-expected.txt:
+        * web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html:
+        * web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback-expected.txt:
+        * web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html:
+        * web-platform-tests/resource-timing/buffer-full-set-to-current-buffer-expected.txt:
+        * web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html:
+        * web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback-expected.txt:
+        * web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html:
+        * web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt:
+        * web-platform-tests/resource-timing/buffer-full-then-increased.html:
+        * web-platform-tests/resource-timing/buffer-full-when-populate-entries-expected.txt:
+        * web-platform-tests/resource-timing/buffer-full-when-populate-entries.html:
+        All these buffer-full tests start failing when I update them.
+        That is an unrelated bug.  Firefox has the same bug, and we had the same bug before and after this change.
+        * web-platform-tests/resource-timing/connection-reuse-expected.txt: Added.
+        * web-platform-tests/resource-timing/connection-reuse.html: Added.
+        * web-platform-tests/resource-timing/connection-reuse.https-expected.txt: Added.
+        * web-platform-tests/resource-timing/connection-reuse.https.html: Added.
+        * web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects-expected.txt: Added.
+        * web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects.html: Added.
+        * web-platform-tests/resource-timing/cross-origin-status-codes.html:
+        * web-platform-tests/resource-timing/document-domain-no-impact-opener-expected.txt: Added.
+        * web-platform-tests/resource-timing/document-domain-no-impact-opener.html: Added.
+        * web-platform-tests/resource-timing/entry-attributes-expected.txt: Added.
+        * web-platform-tests/resource-timing/entry-attributes.html: Added.
+        * web-platform-tests/resource-timing/fetch-cross-origin-redirect.https-expected.txt: Added.
+        * web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html: Added.
+        * web-platform-tests/resource-timing/font-timestamps-expected.txt: Added.
+        * web-platform-tests/resource-timing/font-timestamps.html: Added.
+        * web-platform-tests/resource-timing/iframe-failed-commit-expected.txt: Added.
+        * web-platform-tests/resource-timing/iframe-failed-commit.html: Added.
+        * web-platform-tests/resource-timing/initiator-type-for-script-expected.txt: Added.
+        * web-platform-tests/resource-timing/initiator-type-for-script.html: Added.
+        * web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https-expected.txt: Added.
+        * web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https.html: Added.
+        * web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect-expected.txt: Added.
+        * web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect.html: Added.
+        * web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect-expected.txt: Added.
+        * web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect.html: Added.
+        * web-platform-tests/resource-timing/redirects-expected.txt: Added.
+        * web-platform-tests/resource-timing/redirects.html: Added.
+        * web-platform-tests/resource-timing/resource-ignore-data-url-expected.txt: Added.
+        * web-platform-tests/resource-timing/resource-ignore-data-url.html: Added.
+        * web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain-expected.txt:
+        This apparent regression is actually a progression.
+        When this test is run from our test infrastructure, Chrome and Firefox fail the same tests that you see now failing here,
+        indicating that something is wrong with our test infrastructure.  When run on wpt.live, all browsers pass this test
+        after this change.
+        * web-platform-tests/resource-timing/resource_cached.html: Added.
+        * web-platform-tests/resource-timing/resource_initiator_types.html:
+        * web-platform-tests/resource-timing/resource_nested_dedicated_worker.worker.js:
+        (async_test):
+        (async_test.async const): Deleted.
+        * web-platform-tests/resource-timing/resource_timing_content_length-expected.txt: Added.
+        * web-platform-tests/resource-timing/resource_timing_content_length.html: Added.
+        * web-platform-tests/resource-timing/resources/200_empty.asis: Added.
+        * web-platform-tests/resource-timing/resources/TAOResponse.py:
+        (main):
+        * web-platform-tests/resource-timing/resources/all_resource_types.html: Added.
+        * web-platform-tests/resource-timing/resources/buffer-full-utilities.js:
+        (const.waitForNextTask):
+        (const.forceBufferFullEvent.async clearBufferAndSetSize):
+        (const.forceBufferFullEvent):
+        (const.fillUpTheBufferWithTwoResources.async clearBufferAndSetSize):
+        (async const.fillUpTheBufferWithSingleResource.async clearBufferAndSetSize):
+        (async const):
+        (let.appendScript): Deleted.
+        (let.waitForNextTask): Deleted.
+        (let.waitUntilConditionIsMet.cond.return.new.Promise.resolve.let.checkCondition): Deleted.
+        (let.waitForEventToFire.return.new.Promise): Deleted.
+        (let.waitForEventToFire): Deleted.
+        (let.fillUpTheBufferWithTwoResources.async src): Deleted.
+        * web-platform-tests/resource-timing/resources/cacheable-and-validated.py: Added.
+        (main):
+        * web-platform-tests/resource-timing/resources/connection-reuse-test.js: Added.
+        (attribute_test.async client):
+        (attribute_test):
+        * web-platform-tests/resource-timing/resources/csp-default-none.html: Added.
+        * web-platform-tests/resource-timing/resources/csp-default-none.html.headers: Added.
+        * web-platform-tests/resource-timing/resources/document-domain-no-impact.html: Added.
+        * web-platform-tests/resource-timing/resources/document-refreshed.html: Added.
+        * web-platform-tests/resource-timing/resources/document-that-refreshes.html: Added.
+        * web-platform-tests/resource-timing/resources/embed-refresh.html: Added.
+        * web-platform-tests/resource-timing/resources/green-frame.html: Added.
+        * web-platform-tests/resource-timing/resources/green.html: Added.
+        * web-platform-tests/resource-timing/resources/green.html.headers: Added.
+        * web-platform-tests/resource-timing/resources/gzip_xml.py:
+        * web-platform-tests/resource-timing/resources/iframe-refresh.html: Added.
+        * web-platform-tests/resource-timing/resources/iframe-reload-TAO.sub.html:
+        * web-platform-tests/resource-timing/resources/multi_redirect.py:
+        (main):
+        * web-platform-tests/resource-timing/resources/object-refresh.html: Added.
+        * web-platform-tests/resource-timing/resources/redirect-cors.py: Added.
+        (main):
+        * web-platform-tests/resource-timing/resources/resource-timing-content-length.py: Added.
+        (main):
+        * web-platform-tests/resource-timing/resources/resource_timing_test0.xml:
+        * web-platform-tests/resource-timing/resources/sizes-helper.js: Added.
+        (const.checkSizeFields):
+        * web-platform-tests/resource-timing/resources/status-code.py:
+        (main):
+        * web-platform-tests/resource-timing/resources/webperftestharness.js:
+        (test_namespace):
+        (test_attribute_exists):
+        (test_enum):
+        * web-platform-tests/resource-timing/resources/webperftestharnessextension.js:
+        (test_method_exists):
+        * web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect-expected.txt: Added.
+        * web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect.html: Added.
+        * web-platform-tests/resource-timing/sizes-cache.any.js: Added.
+        (const.accumulateEntries):
+        (const.checkResourceSizes.list.let.entry.of.entries.else):
+        (promise_test):
+        * web-platform-tests/resource-timing/sizes-redirect-img-expected.txt: Added.
+        * web-platform-tests/resource-timing/sizes-redirect-img.html: Added.
+        * web-platform-tests/resource-timing/sizes-redirect.any.js: Added.
+        (const.accumulateEntry):
+        (const.checkResourceSizes):
+        (const.redirectUrl):
+        (promise_test):
+        * web-platform-tests/resource-timing/status-codes-create-entry.html:
+        * web-platform-tests/resource-timing/test_resource_timing-expected.txt:
+        * web-platform-tests/resource-timing/test_resource_timing.https-expected.txt:
+        * web-platform-tests/resource-timing/workerStart-tao-protected.https.html:
+
</ins><span class="cx"> 2021-06-10  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         CountQueuingStrategy.constructor misses checking the type of init param
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingCodingConventionsmd"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/CodingConventions.md (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/CodingConventions.md                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/CodingConventions.md      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+For [Resource Timing][1] tests, we want to have a consistent and clear coding
+style. The goals of this style are to:
+*   Make it easier for new contributors to find their way around
+*   Help improve readability and maintainability
+*   Help us understand which parts of the spec are tested or not
+Lots of the following rules are arbitrary but the value is realized in
+consistency instead of adhering to the 'perfect' style.
+
+We want the test suite to be navigable. Developers should be able to easily
+find the file or test that is relevant to their work.
+*   Tests should be arranged in files according to which piece of the spec they
+    test
+*   Files should be named using a consistent pattern
+*   HTML files should include useful meta tags
+    *   `<title>` for controlling labels in results pages
+    *   `<link rel="help">` to point at the relevant piece of the spec
+
+We want the test suite to run consistently. Flaky tests are counterproductive.
+*   Prefer `promise_test` to `async_test`
+    *   Note that there’s [still potential for some concurrency][2]; use
+        `add_cleanup()` if needed
+
+We want the tests to be readable. Tests should be written in a modern style
+with recurring patterns.
+*   80 character line limits where we can
+*   Consistent use of anonymous functions
+    *   prefer
+        ```
+        const func1 = param1 => {
+          body();
+        }
+        const func2 = (param1, param2) => {
+          body();
+        }
+        fn(param => {
+            body();
+        });
+        ```
+
+        over
+
+        ```
+        function func1(param1) {
+          body();
+        }
+        function func2(param1, param2) {
+          body();
+        }
+        fn(function(param) {
+            body();
+        });
+        ```
+
+*   Prefer `const` (or, if needed, `let`) to `var`
+*   Contain use of ‘.sub’ in filenames to known helper utilities where possible
+    *   E.g. prefer use of get-host-info.sub.js to `{{host}}` or `{{ports[0]}}`
+        expressions
+*   Avoid use of webperftestharness[extension].js as it’s a layer of cognitive
+    overhead between test content and test intent
+    *   Helper .js files are still encouraged where it makes sense but we want
+        to avoid a testing framework that is specific to Resource Timing (or
+        web performance APIs, in general).
+*   Prefer [`fetch_tests_from_window`][3] to collect test results from embedded
+    iframes instead of hand-rolled `postMessage` approaches
+*   Use the [`assert_*`][4] family of functions to check conformance to the spec
+    but throw exceptions explicitly when the test itself is broken.
+    *    A failed assert indicates "the implementation doesn't conform to the
+         spec"
+    *    Other uncaught exceptions indicate "the test case itself has a bug"
+*   Where possible, we want tests to be scalable - adding another test case
+    should be as simple as calling the tests with new parameters, rather than
+    copying an existing test and modifying it.
+
+[1]: https://www.w3.org/TR/resource-timing-2/
+[2]: https://web-platform-tests.org/writing-tests/testharness-api.html#promise-tests
+[3]: https://web-platform-tests.org/writing-tests/testharness-api.html#consolidating-tests-from-other-documents
+[4]: https://web-platform-tests.org/writing-tests/testharness-api.html#list-of-assertions
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingSOXOSOredirectchaintaohttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https-expected.txt                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https-expected.txt    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+
+FAIL Verify that cross origin resources' timings are not exposed when same-origin=>cross-origin=>same-origin redirects have no `Timing-Allow-Origin:` headers. assert_equals: domainLookupStart should be 0 expected 0 but got <nondeterministic test output>
+FAIL Verify that cross origin resources' timings are not exposed when same-origin=>cross-origin=>same-origin redirects have `Timing-Allow-Origin:` headers only on some of the responses. assert_equals: domainLookupStart should be 0 expected 0 but got <nondeterministic test output>
+FAIL Verify that cross origin resources' timings are exposed when cross-origin redirects have `Timing-Allow-Origin: *` headers assert_greater_than: redirectStart should be greater than 0 expected a number greater than 0 but got 0
+PASS Verify that cross origin resources' timings are not exposed when same-origin=>cross-origin=>same-origin redirects have `Timing-Allow-Origin:` headers with a specific origin.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingSOXOSOredirectchaintaohttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https.html    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>This test validates resource timing information for a same-origin=>cross-origin=>same-origin redirect chain without Timing-Allow-Origin.</title>
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-cross-origin-resources"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/resource-loaders.js"></script>
+<script src="resources/entry-invariants.js"></script>
+</head>
+<body>
+<script>
+const {HTTPS_REMOTE_ORIGIN} = get_host_info();
+const SAME_ORIGIN = location.origin;
+// Same-Origin => Cross-Origin => Same-Origin => Same-Origin redirect chain
+let destUrl = `${SAME_ORIGIN}/resource-timing/resources/multi_redirect.py?`;
+destUrl += `page_origin=${SAME_ORIGIN}`;
+destUrl += `&cross_origin=${HTTPS_REMOTE_ORIGIN}`;
+destUrl += `&final_resource=/resource-timing/resources/blank_page_green.htm`;
+
+// No TAO in the redirect chain
+attribute_test(
+  load.iframe, destUrl,
+  invariants.assert_cross_origin_redirected_resource,
+  "Verify that cross origin resources' timings are not exposed when " +
+  "same-origin=>cross-origin=>same-origin redirects have no " +
+  "`Timing-Allow-Origin:` headers.");
+
+// Partial TAO in the redirect chain
+destUrl += '&tao_steps=2';
+attribute_test(
+  load.iframe, destUrl,
+  invariants.assert_cross_origin_redirected_resource,
+  "Verify that cross origin resources' timings are not exposed when " +
+  "same-origin=>cross-origin=>same-origin redirects have " +
+  "`Timing-Allow-Origin:` headers only on some of the responses.");
+
+// Cross-origin => Cross-Origin => Same-Origin => Same-Origin redirect chain.
+destUrl = `${HTTPS_REMOTE_ORIGIN}/resource-timing/resources/multi_redirect.py?`;
+destUrl += `page_origin=${SAME_ORIGIN}`;
+destUrl += `&cross_origin=${HTTPS_REMOTE_ORIGIN}`;
+destUrl += `&final_resource=/resource-timing/resources/blue-with-tao.png`;
+destUrl += `&tao_steps=3`;
+
+// Full redirect chain with `TAO: *`.
+attribute_test(
+  load.image, destUrl,
+  invariants.assert_tao_enabled_cross_origin_redirected_resource,
+  "Verify that cross origin resources' timings are exposed when cross-origin " +
+  "redirects have `Timing-Allow-Origin: *` headers");
+
+// TAO with a specific origin
+destUrl += `&tao_value=${SAME_ORIGIN}`;
+attribute_test(
+  load.image, destUrl,
+  invariants.assert_cross_origin_redirected_resource,
+  "Verify that cross origin resources' timings are not exposed when " +
+  "same-origin=>cross-origin=>same-origin redirects have " +
+  "`Timing-Allow-Origin:` headers with a specific origin.");
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingSyntheticResponsepy"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SyntheticResponse.py (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SyntheticResponse.py   2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SyntheticResponse.py      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,8 +1,9 @@
</span><del>-from six.moves.urllib.parse import unquote
</del><ins>+from urllib.parse import unquote
</ins><span class="cx"> 
</span><span class="cx"> from wptserve.utils import isomorphic_decode, isomorphic_encode
</span><span class="cx"> 
</span><del>-import sleep
</del><ins>+import importlib
+sleep = importlib.import_module("resource-timing.sleep")
</ins><span class="cx"> 
</span><span class="cx"> def main(request, response):
</span><span class="cx">     index = isomorphic_encode(request.request_path).index(b"?")
</span><span class="lines">@@ -43,8 +44,6 @@
</span><span class="cx">                 response.writer.end_headers()
</span><span class="cx">             else:
</span><span class="cx">                 statusSent = True
</span><del>-        elif arg == b"flush":
-            response.writer.flush()
</del><span class="cx"> 
</span><span class="cx"> #        else:
</span><span class="cx"> #            error "  INVALID ARGUMENT %s" % arg
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOmatchexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-match-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-match-expected.txt                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-match-expected.txt    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+
+PASS The timing allow check algorithm will pass when the Timing-Allow-Origin header value list contains a case-sensitive match.
+PASS The timing allow check algorithm will pass when the Timing-Allow-Origin header value list contains a wildcard.
+PASS The timing allow check algorithm will fail when the Timing-Allow-Origin header value list contains a null origin.
+PASS The timing allow check algorithm will pass when the Timing-Allow-Origin header value list contains the origin and a wildcard.
+PASS The timing allow check algorithm will pass when the Timing-Allow-Origin header value list contains multiple wildcards.
+PASS The timing allow check algorithm will pass when the Timing-Allow-Origin header value contains only the origin.
+PASS The timing allow check algorithm will fail when the Timing-Allow-Origin header value contains only the uppercased origin.
+PASS The timing allow check algorithm will fail when the Timing-Allow-Origin header value contains only a space.
+PASS The timing allow check algorithm will fail when the Timing-Allow-Origin header value contains only a wildcard.
+PASS The timing allow check algorithm will fail when the Timing-Allow-Origin header is not present.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOmatchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-match.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-match.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-match.html    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing TAO tests</title>
+<link rel="author" title="Google" href="http://www.google.com/" />
+<link rel="help"
+      href="https://www.w3.org/TR/resource-timing-2/#timing-allow-origin"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/entry-invariants.js"></script>
+<script src="resources/resource-loaders.js"></script>
+<script>
+const {REMOTE_ORIGIN} = get_host_info();
+const path = REMOTE_ORIGIN + '/resource-timing/resources/TAOResponse.py?tao=';
+
+attribute_test(load.xhr_sync, path + 'match_origin',
+  invariants.assert_tao_pass_no_redirect_http,
+'The timing allow check algorithm will pass when the Timing-Allow-Origin ' +
+'header value list contains a case-sensitive match.');
+
+attribute_test(load.xhr_sync, path + 'match_wildcard',
+  invariants.assert_tao_pass_no_redirect_http,
+'The timing allow check algorithm will pass when the Timing-Allow-Origin ' +
+'header value list contains a wildcard.');
+
+attribute_test(load.xhr_sync, path + 'null',
+  invariants.assert_tao_failure_resource,
+'The timing allow check algorithm will fail when the Timing-Allow-Origin ' +
+'header value list contains a null origin.');
+
+attribute_test(load.xhr_sync, path + 'multi',
+  invariants.assert_tao_pass_no_redirect_http,
+'The timing allow check algorithm will pass when the Timing-Allow-Origin ' +
+'header value list contains the origin and a wildcard.');
+
+attribute_test(load.xhr_sync, path + 'multi_wildcard',
+  invariants.assert_tao_pass_no_redirect_http,
+'The timing allow check algorithm will pass when the Timing-Allow-Origin ' +
+'header value list contains multiple wildcards.');
+
+attribute_test(load.xhr_sync, path + 'origin',
+  invariants.assert_tao_pass_no_redirect_http,
+'The timing allow check algorithm will pass when the Timing-Allow-Origin ' +
+'header value contains only the origin.');
+
+attribute_test(load.xhr_sync, path + 'uppercase',
+  invariants.assert_tao_failure_resource,
+'The timing allow check algorithm will fail when the Timing-Allow-Origin ' +
+'header value contains only the uppercased origin.');
+
+attribute_test(load.xhr_sync, path + 'space',
+  invariants.assert_tao_failure_resource,
+'The timing allow check algorithm will fail when the Timing-Allow-Origin ' +
+'header value contains only a space.');
+
+attribute_test(load.xhr_sync, path + 'wildcard',
+  invariants.assert_tao_pass_no_redirect_http,
+'The timing allow check algorithm will fail when the Timing-Allow-Origin ' +
+'header value contains only a wildcard.');
+
+attribute_test(load.xhr_sync, path + 'zero',
+  invariants.assert_tao_failure_resource,
+'The timing allow check algorithm will fail when the Timing-Allow-Origin ' +
+'header is not present.');
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOnullopaqueoriginexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin-expected.txt                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin-expected.txt       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+Description
+
+This test validates that, for a cross origin resource, the timing allow check algorithm will succeed when the value of Timing-Allow-Origin is null and the origin is an opaque origin.
+
+
+PASS An opaque origin should be authorized to see resource timings when the TAO header is the string 'null'
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOnullopaqueoriginhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin.html                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin.html       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing TAO - "null" and opaque origin</title>
+<link rel="author" title="Google" href="http://www.google.com/" />
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#timing-allow-origin"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+</head>
+<body>
+<h1>Description</h1>
+<p>This test validates that, for a cross origin resource, the timing allow
+check algorithm will succeed when the value of Timing-Allow-Origin is null and
+the origin is an opaque origin.</p>
+<div id="log"></div>
+<iframe id="frameContext"></iframe>
+<script>
+const origin = get_host_info()["ORIGIN"];
+const frame_content = `data:text/html;utf8,<body>
+  <script src="${origin}/resources/testharness.js"></` + `script>
+  <script>
+    const url = "${origin}/resource-timing/resources/TAOResponse.py?tao=null";
+    promise_test(() => { return new Promise((resolve, reject) => {
+      const run_test = entryList => {
+        const entry = entryList.getEntries()[0];
+        const sum = entry.redirectStart + entry.redirectEnd +
+                    entry.domainLookupStart + entry.domainLookupEnd +
+                    entry.connectStart + entry.connectEnd +
+                    entry.secureConnectionStart + entry.requestStart +
+                    entry.responseStart + entry.transferSize +
+                    entry.encodedBodySize + entry.decodedBodySize;
+        assert_not_equals(sum, 0, "Timings must be non-zero");
+      };
+      const observer = new PerformanceObserver(list => {
+        try {
+          run_test(list);
+          resolve();
+        } catch(e) {
+          reject(e);
+        }
+      });
+      observer.observe({ entryTypes: ["resource"] });
+      fetch(url);
+    })}, "An opaque origin should be authorized to see resource timings when" +
+         " the TAO header is the string 'null'");
+  </` + `script></body>`;
+
+frameContext.style = "display:none"
+frameContext.src = frame_content;
+fetch_tests_from_window(frameContext.contentWindow);
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOnullopaqueoriginsubexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin.sub-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin.sub-expected.txt        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin.sub-expected.txt   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -3,5 +3,5 @@
</span><span class="cx"> This test validates that for a cross origin resource, the timing allow check algorithm will succeed when the value of Timing-Allow-Origin is null and the origin is an opaque origin.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-FAIL Test null TAO value with opaque origins assert_equals: expected "PASS" but got "FAIL"
</del><ins>+PASS Test null TAO value with opaque origins
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOportmismatchmeanscrossoriginexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin-expected.txt                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin-expected.txt  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+Description
+
+This test validates that for a cross origin resource with different ports, the timing allow check algorithm will fail when the value of Timing-Allow-Origin value has the right host but the wrong port in it.
+
+
+FAIL A port mismatch must fail the TAO check promise_test: Unhandled rejection with value: object "TypeError: URL is not valid or contains user credentials."
+FAIL An identical port must pass the TAO check promise_test: Unhandled rejection with value: object "TypeError: URL is not valid or contains user credentials."
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingTAOportmismatchmeanscrossoriginhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin.html                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin.html  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>TAO - port mismatch must fail the check</title>
+<link rel="author" title="Google" href="http://www.google.com/" />
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-timing-allow-origin"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/entry-invariants.js"></script>
+<script>
+
+const {ORIGINAL_HOST, PORT, PORT2} = get_host_info();
+
+// The main page is being requested on the default port (PORT), while the
+// subresource will be requested on a separate port (PORT2). The response will
+// have a Timing-Allow-Origin header value with the second port so this page's
+// origin should not be a match.
+const port_mismatch_url = `${location.protocol}//${ORIGINAL_HOST}:${PORT2}` +
+                          `/resource-timing/resources/TAOResponse.py?` +
+                          `tao=origin_port_${PORT2}`;
+attribute_test(
+  fetch, port_mismatch_url, invariants.assert_tao_failure_resource,
+  "A port mismatch must fail the TAO check");
+
+// The same URL as above except the Timing-Allow-Origin header will have the
+// same port as this page's origin. Therefore, this page's origin will match
+// the Timing-Allow-Origin header's value. Therefore, the subresource's timings
+// must be exposed.
+const port_match_url = `${location.protocol}//${ORIGINAL_HOST}:${PORT2}` +
+                       `/resource-timing/resources/TAOResponse.py?` +
+                       `tao=origin_port_${PORT}`;
+attribute_test(
+  fetch, port_match_url, invariants.assert_tao_pass_no_redirect_http,
+  "An identical port must pass the TAO check");
+
+</script>
+</head>
+<body>
+<h1>Description</h1>
+<p>This test validates that for a cross origin resource with different ports,
+the timing allow check algorithm will fail when the value of
+Timing-Allow-Origin value has the right host but the wrong port in it.</p>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetiming__init__py"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/__init__.py ( => )</h4>
<pre class="diff"><span>
<span class="info">Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html
===================================================================
</span><del>--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html      2021-06-10 23:26:03 UTC (rev 278737)
</del><ins>+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html       2021-06-10 23:29:57 UTC (rev 278738)
</ins><span class="lines">@@ -6,6 +6,7 @@
</span><span class="cx"> <link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
</span><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><ins>+<script src="resources/resource-loaders.js"></script>
</ins><span class="cx"> <script src="resources/buffer-full-utilities.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfulladdthenclearexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx"> 
</span><del>-PASS Test that if the buffer is cleared after entries were added to the secondary buffer, those entries make it into the primary one
</del><ins>+FAIL Test that if the buffer is cleared after entries were added to the secondary buffer, those entries make it into the primary one assert_equals: the last 3 resources should be in the buffer, since the first one was cleared expected 3 but got 2
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfulladdthenclearhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear.html        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear.html   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -6,6 +6,7 @@
</span><span class="cx"> <link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
</span><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><ins>+<script src="resources/resource-loaders.js"></script>
</ins><span class="cx"> <script src="resources/buffer-full-utilities.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullincreasebufferduringcallbackhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -3,46 +3,23 @@
</span><span class="cx"> <head onload>
</span><span class="cx"> <meta charset="utf-8" />
</span><span class="cx"> <title>This test validates increasing the buffer size in onresourcetimingbufferfull callback of resource timing.</title>
</span><del>-<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
</del><ins>+<link rel="author" title="Google" href="http://www.google.com/" />
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#dom-performance-onresourcetimingbufferfull"/>
</ins><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><ins>+<script src="resources/resource-loaders.js"></script>
</ins><span class="cx"> <script src="resources/buffer-full-utilities.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script>
</span><del>-const resource_timing_buffer_size = 1;
-let eventFired = false;
-
-setup(() => {
-    // Get the browser into a consistent state.
-    clearBufferAndSetSize(resource_timing_buffer_size);
-    var increase = function() {
-        performance.setResourceTimingBufferSize(resource_timing_buffer_size * 2);
-        eventFired = true;
-    }
-    performance.addEventListener('resourcetimingbufferfull', increase);
-});
-
-let overflowTheBuffer = () => {
-    return new Promise(resolve => {
-        // This resource overflows the entry buffer, and goes into the secondary buffer.
-        appendScript('resources/empty_script.js', resolve);
</del><ins>+promise_test(async () => {
+    await fillUpTheBufferWithSingleResource();
+    performance.addEventListener('resourcetimingbufferfull', () => {
+        performance.setResourceTimingBufferSize(2);
</ins><span class="cx">     });
</span><del>-};
-
-let testThatBufferContainsTheRightResources = () => {
-    let entries = performance.getEntriesByType('resource');
-    assert_equals(entries.length, 2,
-                  'Both entries should be stored in resource timing buffer since its increases size once it overflows.');
-    assert_true(entries[0].name.includes('empty.js'), "empty.js is in the entries buffer");
-    assert_true(entries[1].name.includes('empty_script.js'), "empty_script.js is in the entries buffer");
-};
-
-promise_test(async () => {
-    await fillUpTheBufferWithSingleResource("resources/empty.js");
-    await overflowTheBuffer();
-    await waitForEventToFire();
-    testThatBufferContainsTheRightResources();
</del><ins>+    await load.script(scriptResources[1]);
+    await bufferFullFirePromise;
+    checkEntries(2);
</ins><span class="cx"> }, "Test that increasing the buffer during the callback is enough for entries not to be dropped");
</span><span class="cx"> </script>
</span><span class="cx"> </body>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullinspectbufferduringcallbackexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback-expected.txt        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback-expected.txt   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,3 +1,5 @@
</span><span class="cx"> 
</span><del>-PASS Test that entries in the secondary buffer are not exposed during the callback and before they are copied to the primary buffer
</del><ins>+Harness Error (TIMEOUT), message = null
</ins><span class="cx"> 
</span><ins>+TIMEOUT Test that entries in the secondary buffer are not exposed during the callback and before they are copied to the primary buffer Test timed out
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullinspectbufferduringcallbackhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -6,6 +6,7 @@
</span><span class="cx"> <link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
</span><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><ins>+<script src="resources/resource-loaders.js"></script>
</ins><span class="cx"> <script src="resources/buffer-full-utilities.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullsettocurrentbufferexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer-expected.txt 2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer-expected.txt    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,3 +1,5 @@
</span><span class="cx"> 
</span><del>-PASS Test that entries added and event firing happened in the right sequence
</del><ins>+Harness Error (TIMEOUT), message = null
</ins><span class="cx"> 
</span><ins>+TIMEOUT Test that adding entries and firing the buffer full event happen in the right order. Test timed out
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullsettocurrentbufferhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html 2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -2,81 +2,33 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <meta charset="utf-8">
</span><del>-<link rel="help" href="https://w3c.github.io/resource-timing/#dom-performance-setresourcetimingbuffersize">
</del><span class="cx"> <title>This test validates that setResourceTimingBufferFull behaves appropriately when set to the current buffer level.</title>
</span><ins>+<link rel="author" title="Google" href="http://www.google.com/" />
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#dom-performance-onresourcetimingbufferfull">
</ins><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><ins>+<script src="resources/resource-loaders.js"></script>
</ins><span class="cx"> <script src="resources/buffer-full-utilities.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script>
</span><del>-let eventFired = false;
-
-let loadRandomResource = () => {
-    return fetch(window.location.href + "?" + Math.random());
-};
-
-setup(() => {
-    // Get the browser into a consistent state.
-    clearBufferAndSetSize(100);
-    window.result = "";
-});
-
-let fillUpTheBuffer = () => {
-    return new Promise(resolve => {
-        // Gather up 3 Resource Entries to kick off the rest of test behavior.
-        let resources = 0;
-        let observer = new PerformanceObserver(list => {
-            resources += list.getEntriesByType("resource").length;
-            if (resources !== 3)
-                return;
-            observer.disconnect();
-            resolve();
-        });
-        observer.observe({entryTypes: ["resource"]});
-        for (let i = 0; i < 3; ++i)
-            loadRandomResource();
-    });
-};
-
-let setBufferSize = () => {
-    performance.onresourcetimingbufferfull = () => {
-        eventFired = true;
-        window.result += "Event Fired with "  + performance.getEntriesByType("resource").length + " entries. ";
</del><ins>+promise_test(async () => {
+    let result = '';
+    performance.addEventListener('resourcetimingbufferfull', () => {
+        result += 'Event Fired with '  +
+            performance.getEntriesByType('resource').length + ' entries.';
</ins><span class="cx">         performance.clearResourceTimings();
</span><del>-    };
-    window.result += "before setLimit(3). ";
-    performance.setResourceTimingBufferSize(3);
-    window.result += "after setLimit(3). ";
-};
-
-let overflowTheBuffer = () => {
-    return new Promise(resolve => {
-        loadRandomResource().then(() => {
-            window.result += "after loading 4th resource. ";
-            resolve();
-        });
</del><span class="cx">     });
</span><del>-};
-
-let checkResult = () => {
-    return new Promise((resolve, reject) => {
-        if (window.result != "before setLimit(3). after setLimit(3). after loading 4th resource. Event Fired with 3 entries. ") {
-            reject("Non matching value: " + window.result);
-        }
-        let entries = performance.getEntriesByType("resource");
-        if (entries.length != 1) {
-            reject("Number of entries in resource timing buffer is unexpected: " + entries.length);
-        }
-        resolve();
-    });
-};
-
-promise_test(async () => {
-    await fillUpTheBuffer();
-    setBufferSize();
-    await overflowTheBuffer();
-    await waitForEventToFire();
-    await checkResult();
-}, "Test that entries added and event firing happened in the right sequence");
</del><ins>+    result += 'Before adding entries. ';
+    await fillUpTheBufferWithTwoResources();
+    result += 'After adding entries. ';
+    load.script(scriptResources[2]);
+    await bufferFullFirePromise;
+    assert_equals(result, 'Before adding entries. After adding entries. Event Fired with 2 entries.');
+    const entries = performance.getEntriesByType('resource');
+    assert_equals(entries.length, 1,
+        'Number of entries in resource timing buffer is unexpected');
+    assert_true(entries[0].name.includes(scriptResources[2]),
+        'The entry must correspond to the last resource loaded.')
+}, "Test that adding entries and firing the buffer full event happen in the right order.");
</ins><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullstoreandclearduringcallbackexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback-expected.txt       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback-expected.txt  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,3 +1,5 @@
</span><span class="cx"> 
</span><del>-PASS Test that entries overflowing the buffer trigger the buffer full event, can be stored, and find themselves in the primary buffer after it's cleared.
</del><ins>+Harness Error (TIMEOUT), message = null
</ins><span class="cx"> 
</span><ins>+TIMEOUT Test that entries overflowing the buffer trigger the buffer full event, can be stored, and make their way to the primary buffer after it's cleared in the buffer full event. Test timed out
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullstoreandclearduringcallbackhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -4,52 +4,33 @@
</span><span class="cx"> <meta charset="utf-8" />
</span><span class="cx"> <title>This test validates the behavior of read and clear operation in onresourcetimingbufferfull callback of resource timing.</title>
</span><span class="cx"> <link rel="author" title="Intel" href="http://www.intel.com/" />
</span><del>-<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
</del><ins>+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#dom-performance-onresourcetimingbufferfull"/>
</ins><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><ins>+<script src="resources/resource-loaders.js"></script>
</ins><span class="cx"> <script src="resources/buffer-full-utilities.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script>
</span><del>-const resource_timing_buffer_size = 1;
-let global_buffer = [];
-let eventFired = false;
-
-setup(() => {
-    clearBufferAndSetSize(resource_timing_buffer_size);
-    let store_and_clear = function() {
-        const entryList = performance.getEntriesByType('resource');
-        entryList.forEach(function (entry) {
-            global_buffer.push(entry);
-        });
-        performance.clearResourceTimings();
-        eventFired = true;
-    }
-    performance.addEventListener('resourcetimingbufferfull', store_and_clear);
-});
-
-let overflowTheBuffer = () => {
-    return new Promise(resolve => {
-        // This resource overflows the entry buffer, and goes into the secondary buffer.
-        appendScript('resources/empty_script.js', resolve);
</del><ins>+promise_test(async () => {
+    await fillUpTheBufferWithSingleResource();
+    const entryBuffer = [];
+    performance.addEventListener('resourcetimingbufferfull', () => {
+      entryBuffer.push(...performance.getEntriesByType('resource'));
+      performance.clearResourceTimings();
</ins><span class="cx">     });
</span><del>-};
-
-let testThatBufferContainsTheRightResources = () => {
-    let entries = performance.getEntriesByType('resource');
</del><ins>+    load.script(scriptResources[1]);
+    await bufferFullFirePromise;
+    const entries = performance.getEntriesByType('resource');
</ins><span class="cx">     assert_equals(entries.length, 1,
</span><del>-                  "Only the last entry should be stored in resource timing buffer since it's cleared once it overflows.");
-    assert_equals(global_buffer.length, 1, '1 resource timing entry should be moved to global buffer.');
-    assert_true(global_buffer[0].name.includes('empty.js'), "empty.js is in the global buffer");
-    assert_true(entries[0].name.includes('empty_script.js'), "empty_script.js is in the entries buffer");
-};
-
-promise_test(async () => {
-    await fillUpTheBufferWithSingleResource("resources/empty.js");
-    await overflowTheBuffer();
-    await waitForEventToFire();
-    testThatBufferContainsTheRightResources();
-}, "Test that entries overflowing the buffer trigger the buffer full event, can be stored, and find themselves in the primary buffer after it's cleared.");
</del><ins>+        "Only the last entry should be stored in resource timing buffer since it's cleared once it overflows.");
+    assert_true(entries[0].name.includes(scriptResources[1]),
+        scriptResources[1]  + " is in the entries buffer");
+    assert_equals(entryBuffer.length, 1,
+        '1 resource timing entry should be moved to entryBuffer.');
+    assert_true(entryBuffer[0].name.includes(scriptResources[0]),
+        scriptResources[0] + ' is in the entryBuffer');
+}, "Test that entries overflowing the buffer trigger the buffer full event, can be stored, and make their way to the primary buffer after it's cleared in the buffer full event.");
</ins><span class="cx"> </script>
</span><span class="cx"> </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullthenincreasedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx"> 
</span><del>-PASS Test that overflowing the buffer and immediately increasing its limit does not trigger the resourcetimingbufferfull event
</del><ins>+FAIL Test that overflowing the buffer and immediately increasing its limit does not trigger the resourcetimingbufferfull event assert_equals: All resources should be in the buffer, since its size was increased expected 3 but got 2
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullthenincreasedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased.html        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased.html   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -6,6 +6,7 @@
</span><span class="cx"> <link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
</span><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><ins>+<script src="resources/resource-loaders.js"></script>
</ins><span class="cx"> <script src="resources/buffer-full-utilities.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullwhenpopulateentriesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries-expected.txt 2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries-expected.txt    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx"> 
</span><del>-PASS Test that a buffer full event does not bubble and that resourcetimingbufferfull is called only once per overflow
</del><ins>+FAIL Test that a buffer full event does not bubble and that resourcetimingbufferfull is called only once per overflow assert_equals: Number of entries does not match the expected value. expected 2 but got 0
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingbufferfullwhenpopulateentrieshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries.html 2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries.html    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -2,44 +2,28 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <meta charset="utf-8" />
</span><ins>+<title>This test validates the functionality of onresourcetimingbufferfull in resource timing.</title>
</ins><span class="cx"> <link rel="author" title="Intel" href="http://www.intel.com/" />
</span><del>-<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
-<title>This test validates the functionality of onresourcetimingbufferfull in resource timing.</title>
</del><ins>+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#dom-performance-onresourcetimingbufferfull"/>
</ins><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><ins>+<script src="resources/resource-loaders.js"></script>
</ins><span class="cx"> <script src="resources/buffer-full-utilities.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script>
</span><del>-const resource_timing_buffer_size = 2;
-let bufferFullCount = 0;
-let eventFired = false;
-setup(() => {
-    clearBufferAndSetSize(resource_timing_buffer_size);
</del><ins>+promise_test(async () => {
+    let bufferFullCount = 0;
</ins><span class="cx">     performance.addEventListener('resourcetimingbufferfull', e => {
</span><span class="cx">         assert_equals(e.bubbles, false, "Event bubbles attribute is false");
</span><span class="cx">         bufferFullCount++;
</span><del>-        eventFired = true;
</del><span class="cx">     });
</span><del>-});
-
-let overflowTheBuffer = () => {
-    return new Promise(resolve => {
-        // This resource overflows the entry buffer, and goes into the secondary buffer.
-        appendScript('resources/empty_script.js', resolve);
-    });
-};
-
-let testThatBufferContainsTheRightResources = () => {
-    assert_equals(performance.getEntriesByType('resource').length, resource_timing_buffer_size, 'There should only be |bufferSize| resource entries.');
</del><ins>+    await fillUpTheBufferWithTwoResources();
+    // Overflow the buffer
+    await load.script(scriptResources[2]);
+    await waitForNextTask();
+    checkEntries(2);
</ins><span class="cx">     assert_equals(bufferFullCount, 1, 'onresourcetimingbufferfull should have been invoked once.');
</span><del>-};
-
-promise_test(async () => {
-    await fillUpTheBufferWithTwoResources('resources/empty.js');
-    await overflowTheBuffer();
-    await waitForEventToFire();
-    testThatBufferContainsTheRightResources();
</del><span class="cx"> }, "Test that a buffer full event does not bubble and that resourcetimingbufferfull is called only once per overflow");
</span><span class="cx"> </script>
</span><span class="cx"> </body>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingconnectionreuseexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse-expected.txt                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse-expected.txt     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+Description
+
+See the included test script
+
+
+PASS PerformanceResrouceTiming entries need to conform to the spec when a distinct resource is fetched over a persistent connection
+PASS PerformanceResrouceTiming entries need to conform to the spec when the resource is cache-revalidated over a persistent connection
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingconnectionreusehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.html                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.html     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing connection reuse</title>
+<link rel="author" title="Google" href="http://www.google.com/" />
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/entry-invariants.js"></script>
+<script src="resources/connection-reuse-test.js"></script>
+</head>
+<body>
+<h1>Description</h1>
+<p>See <a href="resources/connection-reuse-test.js">the included test
+  script</a></p>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingconnectionreusehttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.https-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.https-expected.txt                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.https-expected.txt       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+Description
+
+See the included test script
+
+
+PASS PerformanceResrouceTiming entries need to conform to the spec when a distinct resource is fetched over a persistent connection
+PASS PerformanceResrouceTiming entries need to conform to the spec when the resource is cache-revalidated over a persistent connection
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingconnectionreusehttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.https.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.https.html                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/connection-reuse.https.html       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing connection reuse</title>
+<link rel="author" title="Google" href="http://www.google.com/" />
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/entry-invariants.js"></script>
+<script src="resources/connection-reuse-test.js"></script>
+</head>
+<body>
+<h1>Description</h1>
+<p>See <a href="resources/connection-reuse-test.js">the included test
+  script</a></p>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingcrossoriginstartendtimewithredirectsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects-expected.txt   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS Verify that cross-origin resources don't implicitly expose their redirect timings
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingcrossoriginstartendtimewithredirectshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects.html   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>This test validates the values in resource timing for cross-origin
+redirects.</title>
+<link rel="author" title="Noam Rosenthal" href="noam@webkit.org">
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/resource-loaders.js"></script>
+<script src="resources/entry-invariants.js"></script>
+</head>
+<body>
+<script>
+const {REMOTE_ORIGIN} = get_host_info();
+const delay = 2
+const blank_page = `/resource-timing/resources/blank_page_green.htm`;
+const destUrl = `/common/slow-redirect.py?delay=${delay}&location=${REMOTE_ORIGIN}/${blank_page}`;
+
+const timeBefore = performance.now()
+attribute_test(load.iframe, destUrl, entry => {
+    assert_equals(entry.startTime, entry.fetchStart, 'startTime and fetchStart should be equal');
+    assert_greater_than(entry.startTime, timeBefore, 'startTime and fetchStart should be greater than the time before fetching');
+    // See https://github.com/w3c/resource-timing/issues/264
+    assert_less_than(Math.round(entry.startTime - timeBefore), delay * 1000, 'startTime should not expose redirect delays');
+}, "Verify that cross-origin resources don't implicitly expose their redirect timings")
+
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingcrossoriginstatuscodeshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-status-codes.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-status-codes.html 2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cross-origin-status-codes.html    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,6 +1,9 @@
</span><span class="cx"> <!doctype html>
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><ins>+<title>Resource Timing: PerformanceResourceTiming attributes shouldn't change
+  if the HTTP status code changes</title>
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/>
</ins><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><span class="cx"> <script src=/common/get-host-info.sub.js></script>
</span><span class="lines">@@ -15,34 +18,53 @@
</span><span class="cx"> <script id="script_404"></script>
</span><span class="cx"> <script id="script_502"></script>
</span><span class="cx"> <script>
</span><del>-async_test(t => {
-  let destUrl = get_host_info().HTTP_REMOTE_ORIGIN + '/resource-timing/resources/';
-  let statusCodes = ['200', '307', '404', '502'];
</del><ins>+
+const listenForPerformanceEntries = num_expected => {
+  return new Promise(resolve => {
+    let results = [];
+    new PerformanceObserver(entryList => {
+      entryList.getEntries().forEach(entry => {
+        if (!entry.name.includes("status-code"))
+          return;
+
+        results.push(entry);
+        if (results.length == num_expected) {
+          resolve(results);
+        }
+      });
+    }).observe({entryTypes: ['resource']});
+  });
+}
+
+promise_test(async t => {
+  const destUrl = get_host_info().HTTP_REMOTE_ORIGIN + '/resource-timing/resources/';
+  const statusCodes = ['200', '307', '404', '502'];
+
+  let expected_entry_count = 0;
</ins><span class="cx">   statusCodes.forEach(status => {
</span><del>-    document.getElementById('img_' + status).src = destUrl + 'status-code.py?status=' + status;
-    document.getElementById('script_' + status).src = destUrl + 'status-code.py?status=' + status + '&script=1';
</del><ins>+    document.getElementById(`img_${status}`).src = `${destUrl}status-code.py?status=${status}`;
+    document.getElementById(`script_${status}`).src = `${destUrl}status-code.py?status=${status}&script=1`;
+    expected_entry_count += 2;
</ins><span class="cx">   });
</span><del>-  let nameMap = {};
-  let firstEntry = null;
-  // We will check that the non-timestamp values of the entry match for all entries.
-  const keys = ['entryType', 'nextHopProtocol', 'transferSize', 'encodedBodySize', 'decodedBodySize'];
-  new PerformanceObserver(t.step_func(entryList => {
-    entryList.getEntries().forEach(entry => {
-      if (!entry.name.includes("status-code"))
-        return;
</del><span class="cx"> 
</span><del>-      nameMap[entry.name] = true;
-      if (!firstEntry) {
-        firstEntry = entry;
-      } else {
-        keys.forEach(key => {
-          assert_equals(entry[key], firstEntry[key], `Discernible difference in ${key} for ${entry.name}`);
-        });
-      }
-    });
-    if (Object.keys(nameMap).length === 8) {
-      t.done();
-    }
-  })).observe({entryTypes: ['resource']});
</del><ins>+  const entries = await listenForPerformanceEntries(expected_entry_count);
+
+  // We will check that the non-timestamp values of the entry match for all
+  // entries.
+  const keys = [
+    'entryType',
+    'nextHopProtocol',
+    'transferSize',
+    'encodedBodySize',
+    'decodedBodySize',
+  ];
+
+  const first = entries[0];
+  entries.slice(1).forEach(entry => {
+    keys.forEach(attribute => {
+      assert_equals(entry[attribute], first[attribute],
+        `There must be no discernible difference for the ${attribute} ` +
+        `attribute but found a difference for the ${entry.name} resource.`);
+  })});
</ins><span class="cx"> }, "Make sure cross origin resource fetch failures with different status codes are indistinguishable");
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingdocumentdomainnoimpactopenerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-opener-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-opener-expected.txt                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-opener-expected.txt     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+Harness Error (TIMEOUT), message = null
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingdocumentdomainnoimpactopenerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-opener.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-opener.html                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-opener.html     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script>
+// Open a document on one of hosts on the web-platform test domain, so that
+// document.domain will set a valid domain, turning the frame into a
+// cross-origin frame.
+const {OTHER_ORIGIN} = get_host_info();
+const openee = window.open(OTHER_ORIGIN +
+               "/resource-timing/resources/document-domain-no-impact.html");
+fetch_tests_from_window(openee);
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingentryattributesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/entry-attributes-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/entry-attributes-expected.txt                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/entry-attributes-expected.txt     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Description
+
+This test validates that PerformanceResourceTiming entries' attributes are populated with the correct values.
+
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Image resources should generate conformant entries Test timed out
+NOTRUN Font resources should generate conformant entries
+NOTRUN Same-origin redirects should populate redirectStart/redirectEnd
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingentryattributeshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/entry-attributes.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/entry-attributes.html                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/entry-attributes.html     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing: PerformanceResourceTiming attributes</title>
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/resource-loaders.js"></script>
+<script src="resources/entry-invariants.js"></script>
+<script>
+attribute_test(
+  load.image, "resources/fake_responses.py#hash=1",
+  entry => {
+    assert_true(entry.name.includes('#hash=1'),
+      "There should be a hash in the resource name");
+    invariants.assert_tao_pass_no_redirect_http(entry);
+  },
+  "Image resources should generate conformant entries");
+
+attribute_test(
+  load.font, "/fonts/Ahem.ttf",
+  invariants.assert_tao_pass_no_redirect_http,
+  "Font resources should generate conformant entries");
+
+attribute_test(
+  load.image, "/common/redirect.py?location=resources/fake_responses.py",
+  invariants.assert_same_origin_redirected_resource,
+  "Same-origin redirects should populate redirectStart/redirectEnd");
+</script>
+</head>
+<body>
+<h1>Description</h1>
+<p>This test validates that PerformanceResourceTiming entries' attributes are
+populated with the correct values.</p>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingfetchcrossoriginredirecthttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https-expected.txt                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https-expected.txt    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+PASS Test fetching through a cross-origin redirect URL
+PASS Test fetching through a same-origin redirect URL
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingfetchcrossoriginredirecthttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Test cross-origin fetch redirects have the right values.</title>
+<link rel="author" title="Google" href="http://www.google.com/" />
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/entry-invariants.js"></script>
+<script src="resources/resource-loaders.js"></script>
+<script>
+
+const {REMOTE_ORIGIN, ORIGIN} = get_host_info();
+const redirect = "/common/redirect.py?" +
+                 "location=/resource-timing/resources/green.html";
+const cross_origin_redirect = REMOTE_ORIGIN + redirect;
+const same_origin_redirect = ORIGIN + redirect;
+
+attribute_test(
+  url => fetch(url, {mode: "no-cors", credentials: "include"}),
+  new URL(cross_origin_redirect).href,
+  invariants.assert_cross_origin_redirected_resource,
+  "Test fetching through a cross-origin redirect URL"
+);
+
+attribute_test(
+  url => fetch(url, {mode: "no-cors", credentials: "include"}),
+  new URL(same_origin_redirect).href,
+  invariants.assert_same_origin_redirected_resource,
+  "Test fetching through a same-origin redirect URL"
+);
+
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingfonttimestampsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/font-timestamps-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/font-timestamps-expected.txt                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/font-timestamps-expected.txt      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+This fetches ahem font.
+
+FAIL Test a font's timestamps assert_greater_than_equal: domainLookupStart should be more than 0 in same-origin redirect. expected a number greater than or equal to <nondeterministic test output> but got 0
+PASS Test a font's timestamps with delays
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingfonttimestampshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/font-timestamps.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/font-timestamps.html                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/font-timestamps.html      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Test cross-origin fetch redirects have the right values.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<body>
+<script>
+const load_font = url => {
+  document.body.innerHTML = `
+    <style>
+    @font-face {
+        font-family: ahem;
+        src: url('${url}');
+    }
+    </style>
+    <div style="font-family: ahem;">This fetches ahem font.</div>
+  `;
+  return document.fonts.ready;
+};
+
+const run_test = async (t, url) => {
+  // Set up PerformanceObserver
+  const href = new URL(url).href;
+  const setPerformanceObserver = new Promise(resolve => {
+    const po = new PerformanceObserver(resolve);
+    po.observe({type: "resource"});
+  });
+
+  // Load the font resource and wait for it to be fetched.
+  await load_font(href);
+
+  // Wait for an entry
+  const timeout = new Promise(resolve => t.step_timeout(resolve, 3000));
+  const list = await Promise.race([setPerformanceObserver, timeout]);
+  assert_equals(typeof(list), "object", "No iframe entry was fired");
+  const entries = list.getEntriesByName(url);
+  assert_equals(entries.length, 1);
+
+  // Test entry values
+  const entry = entries[0];
+  assert_greater_than(entry.fetchStart, 0, "fetchStart should be greater than 0 in redirects.");
+  assert_greater_than_equal(entry.domainLookupStart, entry.fetchStart, "domainLookupStart should be more than 0 in same-origin redirect.");
+  assert_greater_than_equal(entry.domainLookupEnd, entry.domainLookupStart, "domainLookupEnd should be more than 0 in same-origin redirect.");
+  assert_greater_than_equal(entry.connectStart, entry.domainLookupEnd, "connectStart should be more than 0 in same-origin redirect.");
+  assert_greater_than_equal(entry.secureConnectionStart, entry.connectStart, "secureConnectionStart should be more than 0 in same-origin redirect.");
+  assert_greater_than_equal(entry.connectEnd, entry.secureConnectionStart, "connectEnd should be more than 0 in same-origin redirect.");
+  assert_greater_than_equal(entry.requestStart, entry.connectEnd, "requestStart should be more than 0 in same-origin redirect.");
+  assert_greater_than_equal(entry.responseStart, entry.requestStart, "responseStart should be more than 0 in same-origin redirect.");
+  assert_greater_than_equal(entry.responseEnd, entry.responseStart, "responseEnd should be greater than 0 in redirects.");
+  assert_greater_than_equal(entry.duration, 0, "duration should be greater than 0 in redirects.");
+}
+
+const {HTTPS_REMOTE_ORIGIN} = get_host_info();
+promise_test(t => {
+  return run_test(t, HTTPS_REMOTE_ORIGIN + "/fonts/Ahem.ttf");
+}, "Test a font's timestamps");
+
+promise_test(t => {
+  return run_test(t, HTTPS_REMOTE_ORIGIN + "/resource-timing/resources/cors-ahem.py?pipe=trickle(d1)");
+}, "Test a font's timestamps with delays");
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingiframefailedcommitexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-failed-commit-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-failed-commit-expected.txt                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-failed-commit-expected.txt 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Blocked access to external URL https://nonexistent.localhost:9443/
+Blocked access to external URL https://nonexistent.localhost:9443/
+
+
+PASS Precondition
+FAIL Test iframe from non-existent host assert_equals: No iframe entry was fired expected "object" but got "undefined"
+FAIL Test iframe redirecting to non-existent host assert_equals: No iframe entry was fired expected "object" but got "undefined"
+PASS Same-origin iframe that complies with CSP attribute gets reported
+PASS Same-origin iframe that doesn't comply with CSP attribute gets reported
+PASS Cross-origin iframe that complies with CSP attribute gets reported
+PASS Cross-origin iframe that doesn't comply with CSP attribute gets reported
+FAIL Same-origin empty iframe with a 200 status gets reported assert_equals: No iframe entry was fired expected "object" but got "undefined"
+FAIL Cross-origin empty iframe with a 200 status gets reported assert_equals: No iframe entry was fired expected "object" but got "undefined"
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingiframefailedcommithtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-failed-commit.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-failed-commit.html                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-failed-commit.html 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing - test that unsuccessful iframes create entries</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<body>
+<script>
+test(() => {
+  const entries = performance.getEntriesByType("resource");
+  assert_equals(entries.length, 3, "Precondition - Entries for blocking scripts fired");
+}, "Precondition");
+
+const run_test = async (t, url, csp) => {
+  const setPerformanceObserver = new Promise(resolve => {
+    const po = new PerformanceObserver(resolve);
+    po.observe({type: "resource"});
+  });
+  const timeout = new Promise(resolve => t.step_timeout(resolve, 1000));
+  const frame = document.createElement("iframe");
+  frame.src = url;
+  if (csp) {
+    frame.csp = csp;
+  }
+  document.body.appendChild(frame);
+  const list = await Promise.race([setPerformanceObserver, timeout]);
+  assert_equals(typeof(list), "object", "No iframe entry was fired");
+  const entries = list.getEntriesByName(url);
+  assert_equals(entries.length, 1);
+  assert_greater_than(entries[0].duration, 0, "Duration greater than 0");
+}
+
+const {REMOTE_ORIGIN, ORIGINAL_HOST, HTTPS_PORT} = get_host_info();
+const nonexistent_url = "https://nonexistent." + ORIGINAL_HOST + ":" + HTTPS_PORT + "/";
+
+promise_test(t => {
+  return run_test(t, nonexistent_url);
+}, "Test iframe from non-existent host");
+
+promise_test(t => {
+  const url = new URL("resources/fake_responses.py?redirect=" + nonexistent_url, location.href);
+  return run_test(t, url.toString());
+}, "Test iframe redirecting to non-existent host");
+
+const csp_directive = "default-src 'none'";
+promise_test(t => {
+  const url = new URL("/resource-timing/resources/csp-default-none.html", location.href);
+  return run_test(t, url, csp_directive);
+}, "Same-origin iframe that complies with CSP attribute gets reported");
+
+promise_test(t => {
+  const url = new URL("/resource-timing/resources/green-frame.html", location.href);
+  return run_test(t, url.toString(), csp_directive);
+}, "Same-origin iframe that doesn't comply with CSP attribute gets reported");
+
+promise_test(t => {
+  const url = new URL("/resource-timing/resources/csp-default-none.html", REMOTE_ORIGIN);
+  return run_test(t, url.toString(), csp_directive);
+}, "Cross-origin iframe that complies with CSP attribute gets reported");
+
+promise_test(t => {
+  const url = new URL("/resource-timing/resources/green-frame.html", REMOTE_ORIGIN);
+  return run_test(t, url.toString(), csp_directive);
+}, "Cross-origin iframe that doesn't comply with CSP attribute gets reported");
+
+promise_test(t => {
+  const url = new URL("/resource-timing/resources/200_empty.asis", location.href);
+  return run_test(t, url.toString(), csp_directive);
+}, "Same-origin empty iframe with a 200 status gets reported");
+
+promise_test(t => {
+  const url = new URL("/resource-timing/resources/200_empty.asis", REMOTE_ORIGIN);
+  return run_test(t, url.toString(), csp_directive);
+}, "Cross-origin empty iframe with a 200 status gets reported");
+
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetiminginitiatortypeforscriptexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/initiator-type-for-script-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/initiator-type-for-script-expected.txt                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/initiator-type-for-script-expected.txt    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS Validate initiatorType for scripts is 'script'
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetiminginitiatortypeforscripthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/initiator-type-for-script.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/initiator-type-for-script.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/initiator-type-for-script.html    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>This test validates that the initiatorType information for various
+Resource Timing entries is accurate for scripts.</title>
+<link rel="help"
+      href="https://www.w3.org/TR/resource-timing-2/#dom-performanceresourcetiming-initiatortype"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/resource-loaders.js"></script>
+<script src="resources/entry-invariants.js"></script>
+<!-- Tested resources -->
+<script src="resources/empty_script.js?id=blocking"></script>
+<script src="resources/empty_script.js?id=async" async></script>
+<script src="resources/empty_script.js?id=async_false" async=false></script>
+<script src="resources/empty_script.js?id=defer" defer></script>
+<script>
+document.write("<script src='resources/empty_script.js?id=doc_written'></scr"
+               + "ipt>");
+
+const head = document.getElementsByTagName("head")[0];
+const s1 = document.createElement("script");
+s1.src = "empty_script.js?id=appended";
+head.appendChild(s1);
+
+const s2 = document.createElement("script");
+s2.src = "empty_script.js?id=appended_async";
+s2.async = true;
+head.appendChild(s2);
+
+const s3 = document.createElement("script");
+s3.src = "empty_script.js?id=appended_aync_false";
+s3.async = false;
+head.appendChild(s3);
+
+const s4 = document.createElement("script");
+s4.src = "empty_script.js?id=appended_defer";
+s4.defer = true;
+head.appendChild(s4);
+</script>
+</head>
+<body>
+<script>
+
+const wait_for_onload = () => {
+  return new Promise(resolve => {
+    window.addEventListener("load", resolve);
+})};
+
+promise_test(
+  async () => {
+    await wait_for_onload();
+
+    const entry_list = performance.getEntriesByType("resource");
+    for (entry of entry_list) {
+      if (entry.name.includes("empty_script.js")) {
+        assert_equals(entry.initiatorType, "script",
+                      "initiatorType should be 'script' for " + entry.name);
+      }
+    }
+}, "Validate initiatorType for scripts is 'script'");
+</script>
+</body>
+</html>
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingnextHopProtocolistaoprotectedhttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https-expected.txt                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https-expected.txt       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+FAIL Add TAO-less iframe from remote origin. Make sure nextHopProtocol is the empty string assert_equals: nextHopProtocol should be the empty string expected "" but got "http/1.1"
+PASS Add TAO'd iframe from remote origin. Make sure nextHopProtocol is not the empty string
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingnextHopProtocolistaoprotectedhttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https.html                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https.html       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing - Check that nextHopProtocol is TAO protected</title>
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/entry-invariants.js"></script>
+<script src="resources/resource-loaders.js"></script>
+</head>
+<body>
+<script>
+
+const {HTTPS_REMOTE_ORIGIN} = get_host_info();
+const remote_resources = `${HTTPS_REMOTE_ORIGIN}/resource-timing/resources`;
+
+// Add iframe to remote origin - page without TAO
+attribute_test(
+  load.iframe, `${remote_resources}/green.htm`,
+  entry => assert_equals(entry.nextHopProtocol, "",
+    "nextHopProtocol should be the empty string"),
+  "Add TAO-less iframe from remote origin. Make sure nextHopProtocol is the " +
+  "empty string"
+);
+
+// Add iframe to remote origin - page with TAO
+attribute_test(
+  load.iframe, `${remote_resources}/blank-with-tao.html`,
+  entry => assert_not_equals(entry.nextHopProtocol, "",
+    "nextHopProtocol should not be the empty string"),
+  "Add TAO'd iframe from remote origin. Make sure nextHopProtocol is not " +
+  "the empty string"
+);
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingobjectnotfoundafterTAOcrossoriginredirectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect-expected.txt                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect-expected.txt     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+
+
+Harness Error (TIMEOUT), message = null
+
+PASS window.performance is defined
+PASS window.performance.getEntriesByName is defined
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingobjectnotfoundafterTAOcrossoriginredirecthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect.html                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect.html     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>This test validates resource timing information for a timing allowed cross-origin redirect chain.</title>
+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src=/common/get-host-info.sub.js></script>
+<script src="resources/webperftestharness.js"></script>
+<script src="resources/webperftestharnessextension.js"></script>
+
+<script>
+    setup({explicit_done: true});
+    test_namespace('getEntriesByName');
+
+    function onload_test()
+    {
+        const context = new PerformanceContext(performance);
+        const entries = context.getEntriesByName(document.querySelector('object').data, 'resource');
+        test_equals(entries.length, 1, 'There should be one entry.');
+        const entry = entries[0];
+
+        test_greater_than(entry.redirectStart, 0, 'redirectStart > 0 in timing allowed cross-origin redirect.');
+        test_equals(entry.redirectStart, entry.startTime, 'redirectStart == startTime in timing allowed cross-origin redirect.');
+        test_greater_than(entry.redirectEnd, entry.redirectStart, 'redirectEnd > redirectStart in timing allowed cross-origin redirect.');
+        test_greater_or_equals(entry.fetchStart, entry.redirectEnd, 'fetchStart >= redirectEnd in timing allowed cross-origin redirect.');
+        done();
+    }
+</script>
+
+</head>
+<body>
+<script>
+    let destUrl = get_host_info().HTTP_REMOTE_ORIGIN + '/resource-timing/resources/multi_redirect.py?';
+    destUrl += 'page_origin=' + 'http://' + document.location.host;
+    destUrl += '&cross_origin=' + get_host_info().HTTP_REMOTE_ORIGIN;
+    destUrl += '&final_resource=' + encodeURIComponent("/resource-timing/resources/status-code.py?status=404&tao_value=*");
+    destUrl += '&tao_steps=3';
+    const objElement = document.createElement('object');
+    objElement.style = 'width: 0px; height: 0px;';
+    objElement.data = destUrl;
+    objElement.onerror = onload_test;
+    document.body.appendChild(objElement);
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingobjectnotfoundaftercrossoriginredirectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect-expected.txt                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect-expected.txt 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+
+
+Harness Error (TIMEOUT), message = null
+
+PASS window.performance is defined
+PASS window.performance.getEntriesByName is defined
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingobjectnotfoundaftercrossoriginredirecthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect.html                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect.html 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>This test validates resource timing information for a cross-origin redirect chain.</title>
+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src=/common/get-host-info.sub.js></script>
+<script src="resources/webperftestharness.js"></script>
+<script src="resources/webperftestharnessextension.js"></script>
+
+<script>
+    setup({explicit_done: true});
+    test_namespace('getEntriesByName');
+
+    function onload_test()
+    {
+        const context = new PerformanceContext(performance);
+        const entries = context.getEntriesByName(document.querySelector('object').data, 'resource');
+        test_equals(entries.length, 1, 'There should be one entry.');
+        const entry = entries[0];
+
+        test_equals(entry.redirectStart, 0, 'redirectStart == 0 in cross-origin redirect.');
+        test_equals(entry.redirectEnd, 0, 'redirectEnd == 0 in cross-origin redirect.');
+        test_greater_than(entry.fetchStart, 0, 'fetchStart > 0 in cross-origin redirect.');
+        test_equals(entry.startTime, entry.fetchStart, 'startTime == fetchStart in cross-origin redirect.');
+        done();
+    }
+</script>
+
+</head>
+<body>
+<script>
+    let destUrl = get_host_info().HTTP_REMOTE_ORIGIN + '/resource-timing/resources/multi_redirect.py?';
+    destUrl += 'page_origin=' + 'http://' + document.location.host;
+    destUrl += '&cross_origin=' + get_host_info().HTTP_REMOTE_ORIGIN;
+    destUrl += '&final_resource=' + encodeURIComponent("/resource-timing/resources/status-code.py?status=404");
+    const objElement = document.createElement('object');
+    objElement.style = 'width: 0px; height: 0px;';
+    objElement.data = destUrl;
+    objElement.onerror = onload_test;
+    document.body.appendChild(objElement);
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingredirectsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/redirects-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/redirects-expected.txt                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/redirects-expected.txt    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Description
+
+This test validates that, when a fetching resources that encounter same-origin redirects, attributes of the PerformanceResourceTiming entry conform to the specification.
+
+
+PASS Verify attributes of a redirected stylesheet's PerformanceResourceTiming
+PASS Verify attributes of a redirected image's PerformanceResourceTiming
+PASS Verify attributes of a redirected iframe's PerformanceResourceTiming
+PASS Verify attributes of a redirected script's PerformanceResourceTiming
+PASS Verify attributes of a redirected synchronous XMLHttpRequest's PerformanceResourceTiming
+PASS Verify attributes of a synchronous XMLHttpRequest's PerformanceResourceTiming where the initial HTTP request is redirected to a cross-origin HTTPS resource.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingredirectshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/redirects.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/redirects.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/redirects.html    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing: resources fetched through same-origin redirects</title>
+<link rel="author" title="Google" href="http://www.google.com/" />
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/resource-loaders.js"></script>
+<script src="resources/entry-invariants.js"></script>
+<script>
+const {HTTPS_NOTSAMESITE_ORIGIN} = get_host_info();
+const redirect_url = `/common/redirect.py`;
+const url_prefix = `${redirect_url}?location=/resource-timing/resources/`;
+const https_url_prefix = `${redirect_url}?location=${HTTPS_NOTSAMESITE_ORIGIN}/resource-timing/resources/`;
+
+attribute_test(
+  load.stylesheet, url_prefix + "resource_timing_test0.css",
+  invariants.assert_same_origin_redirected_resource,
+  "Verify attributes of a redirected stylesheet's PerformanceResourceTiming");
+
+attribute_test(
+  load.image, url_prefix + "blue.png",
+  invariants.assert_same_origin_redirected_resource,
+  "Verify attributes of a redirected image's PerformanceResourceTiming");
+
+attribute_test(
+  load.iframe, url_prefix + "green.html",
+  invariants.assert_same_origin_redirected_resource,
+  "Verify attributes of a redirected iframe's PerformanceResourceTiming");
+
+attribute_test(
+  load.script, url_prefix + "empty_script.js",
+  invariants.assert_same_origin_redirected_resource,
+  "Verify attributes of a redirected script's PerformanceResourceTiming");
+
+attribute_test(
+  load.xhr_sync, url_prefix + "green.html?id=xhr",
+  invariants.assert_same_origin_redirected_resource,
+  "Verify attributes of a redirected synchronous XMLHttpRequest's " +
+  "PerformanceResourceTiming");
+
+attribute_test(
+  load.xhr_sync, https_url_prefix + "green.html?id=xhr",
+  invariants.assert_cross_origin_redirected_resource,
+  "Verify attributes of a synchronous XMLHttpRequest's " +
+  "PerformanceResourceTiming where the initial HTTP request is redirected " +
+  "to a cross-origin HTTPS resource."
+);
+
+</script>
+</head>
+<body>
+<h1>Description</h1>
+<p>This test validates that, when a fetching resources that encounter
+same-origin redirects, attributes of the PerformanceResourceTiming entry
+conform to the specification.</p>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourceignoredataurlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-ignore-data-url-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-ignore-data-url-expected.txt                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-ignore-data-url-expected.txt     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+
+PASS Resources with data: URIs must not be surfaced in Resource Timing
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourceignoredataurlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-ignore-data-url.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-ignore-data-url.html                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-ignore-data-url.html     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing ignores resources with data: URIs</title>
+<link rel="author" title="Google" href="http://www.google.com/" />
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/resource-loaders.js"></script>
+</head>
+<body>
+<img src="data:image/gif;base64,R0lGODlhAQABAIAAAOTm7AAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="></img>
+<script>
+  promise_test(async t => {
+    const promise = new Promise(resolve => {
+      new PerformanceObserver(t.step_func(list => {
+        const entries = list.getEntries();
+        const dataEntries = entries.filter(e => e.name.includes('data:'));
+        assert_equals(dataEntries.length, 0, 'There must be no entry for `data: URL`.');
+        const blueEntries = entries.filter(e => e.name.includes('blue.png'));
+        if (blueEntries.length) {
+          // We can finish the test once we see the entry with blue.png.
+          resolve();
+        }
+      })).observe({entryTypes: ['resource']});
+    });
+    // Wait until the document is loaded.
+    await new Promise(resolve => {
+      window.addEventListener('load', resolve);
+    });
+    // Add the blue.png image after document is loaded to ensure we've received
+    // all of the previous Resource Timing entries.
+    load.image('blue.png');
+    return promise;
+  }, 'Resources with data: URIs must not be surfaced in Resource Timing');
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_TAO_cross_origin_redirect_chainexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain-expected.txt  2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain-expected.txt     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -3,8 +3,8 @@
</span><span class="cx"> PASS window.performance is defined
</span><span class="cx"> PASS window.performance.getEntriesByName is defined
</span><span class="cx"> PASS There should be one entry.
</span><del>-PASS redirectStart > 0 in timing allowed cross-origin redirect.
-PASS redirectStart == startTime in timing allowed cross-origin redirect.
-PASS redirectEnd > redirectStart in timing allowed cross-origin redirect.
</del><ins>+FAIL redirectStart > 0 in timing allowed cross-origin redirect. assert_true: redirectStart > 0 in timing allowed cross-origin redirect. expected true got false
+FAIL redirectStart == startTime in timing allowed cross-origin redirect. assert_equals: redirectStart == startTime in timing allowed cross-origin redirect. expected <nondeterministic test output> but got 0
+FAIL redirectEnd > redirectStart in timing allowed cross-origin redirect. assert_true: redirectEnd > redirectStart in timing allowed cross-origin redirect. expected true got false
</ins><span class="cx"> PASS fetchStart >= redirectEnd in timing allowed cross-origin redirect.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_cachedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_cached.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_cached.html                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_cached.html      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing cached resources</title>
+<link rel="author" title="Google" href="http://www.google.com/" />
+<link rel="help" href="http://www.w3.org/TR/resource-timing/#dom-performanceresourcetiming-initiatortype"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/webperftestharness.js"></script>
+<script src="resources/webperftestharnessextension.js"></script>
+<script>
+setup({explicit_done: true});
+
+// explicitly test the namespace before we start testing
+test_namespace("getEntriesByType");
+
+var d;
+var iframe;
+var iframeBody;
+var image;
+var random = Math.random();
+
+function setup_iframe() {
+    iframe = document.getElementById('frameContext');
+    d = iframe.contentWindow.document;
+    iframeBody = d.body;
+    iframe.addEventListener('load', onload_test, false);
+}
+function onload_test() {
+    if (window.performance.getEntriesByType === undefined) {
+      done();
+      return;
+    }
+    var context = new PerformanceContext(iframe.contentWindow.performance);
+    var entries = context.getEntriesByType('resource');
+    test_equals(entries.length, 2, "There should be two entries");
+    if (entries.length >= 2) {
+        test_equals(entries[0].name, entries[1].name, "Both entries should have the same name");
+    }
+    done();
+}
+window.setup_iframe = setup_iframe;
+</script>
+</head>
+<body>
+<h1>Description</h1>
+<p>This test validates that a 304 Not Modified resource appears in the buffer.</p>
+<div id="log"></div>
+<iframe id="frameContext" src="resources/fake_responses.html"></iframe>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_initiator_typeshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_initiator_types.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_initiator_types.html  2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_initiator_types.html     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -95,8 +95,8 @@
</span><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.png', 'img');
</span><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.png?id=srcset-srcset', 'img');
</span><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.png?id=srcset-src', 'img');
</span><del>-    addEntryIfExists(entries, expected_entries, pathname + 'blank_page_green.htm', 'iframe');
-    addEntryIfExists(entries, expected_entries, pathname + 'blank_page_green.htm?id=frame', 'frame');
</del><ins>+    addEntryIfExists(entries, expected_entries, pathname + 'green.html', 'iframe');
+    addEntryIfExists(entries, expected_entries, pathname + 'green.html?id=frame', 'frame');
</ins><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'empty_script.js', 'script');
</span><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.css?id=embed', 'embed');
</span><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.css?id=n1', 'css');
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'nested.css', 'link');
</span><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'nested.css?id=prefetch', 'link');
</span><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'nested.css?id=preload', 'link');
</span><del>-    addEntryIfExists(entries, expected_entries, pathname + 'blank_page_green.htm?id=prerender', 'link');
</del><ins>+    addEntryIfExists(entries, expected_entries, pathname + 'green.html?id=prerender', 'link');
</ins><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'manifest.json', 'link');
</span><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'empty.py?id=beacon', 'beacon');
</span><span class="cx">     addEntryIfExists(entries, expected_entries, pathname + 'empty.py?id=fetch', 'fetch');
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx"> <h1>Description</h1>
</span><span class="cx"> <p>This test validates that all of the initiator types are represented.</p>
</span><span class="cx"> <div id="log"></div>
</span><del>-<iframe id="frameContext" onload="onload_test();" src="resources/all_resource_types.htm" style="width: 250px; height: 250px;"></iframe>
-<iframe id="frameContext2" onload="frameset_onload();" src="resources/green_frame.htm" style="width: 250px; height: 250px;"></iframe>
</del><ins>+<iframe id="frameContext" onload="onload_test();" src="resources/all_resource_types.html" style="width: 250px; height: 250px;"></iframe>
+<iframe id="frameContext2" onload="frameset_onload();" src="resources/green-frame.html" style="width: 250px; height: 250px;"></iframe>
</ins><span class="cx"> </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_nested_dedicated_workerworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_nested_dedicated_worker.worker.js (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_nested_dedicated_worker.worker.js     2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_nested_dedicated_worker.worker.js        2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> importScripts("/resources/testharness.js");
</span><span class="cx"> 
</span><del>-async_test(async function() {
</del><ins>+async_test(function() {
</ins><span class="cx">   const worker = new Worker('resources/worker_with_images.js');
</span><span class="cx">   worker.onmessage = this.step_func_done((event) => {
</span><span class="cx">     const childNumEntries = event.data;
</span><span class="lines">@@ -14,4 +14,4 @@
</span><span class="cx">     worker.terminate();
</span><span class="cx">   });
</span><span class="cx"> }, "Resource timing for nested dedicated workers");
</span><del>-done();
</del><span class="cx">\ No newline at end of file
</span><ins>+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_timing_content_lengthexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_content_length-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_content_length-expected.txt                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_content_length-expected.txt       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+
+Harness Error (TIMEOUT), message = null
+
+PASS encodedBodySize should be equal to the actual byte size of the content
+PASS encodedBodySize should be equal to the actual byte size of the content when no header present
+PASS encodedBodySize should be equal to the actual byte size of the content when header value is lower than actual content
+TIMEOUT encodedBodySize should be equal to the actual byte size of the content when header value is higher than actual content Test timed out
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_timing_content_lengthhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_content_length.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_content_length.html                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_content_length.html       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>This test validates the value of encodedBodySize in certain situations.</title>
+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<script>
+    function test_resource_timing_for_content_length({actualContentLength, lengthHeader}, title) {
+        promise_test(async t => {
+            const content = new Array(actualContentLength).fill('x').join('')
+            const url = `resources/resource-timing-content-length.py?content=${content}&length=${lengthHeader}`
+            fetch(url)
+            const entry = await new Promise(resolve => new PerformanceObserver((entryList, observer) => {
+                observer.disconnect()
+                resolve(entryList.getEntries()[0])
+            }).observe({entryTypes: ['resource']}))
+
+            const expectedContentLength = Number.isInteger(lengthHeader) ? Math.min(actualContentLength, lengthHeader) : actualContentLength
+            assert_equals(entry.encodedBodySize, expectedContentLength)
+        }, title);
+    }
+
+    test_resource_timing_for_content_length({actualContentLength: 3, lengthHeader: 'auto'},
+        "encodedBodySize should be equal to the actual byte size of the content")
+    test_resource_timing_for_content_length({actualContentLength: 13, lengthHeader: 'none'},
+        "encodedBodySize should be equal to the actual byte size of the content when no header present")
+    test_resource_timing_for_content_length({actualContentLength: 7, lengthHeader: 3},
+        "encodedBodySize should be equal to the actual byte size of the content when header value is lower than actual content")
+    test_resource_timing_for_content_length({actualContentLength: 8, lengthHeader: 40},
+        "encodedBodySize should be equal to the actual byte size of the content when header value is higher than actual content")
+</script>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresources200_emptyasis"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/200_empty.asis (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/200_empty.asis                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/200_empty.asis  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+HTTP/1.0 200 OK
+Content-Length: 0
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesTAOResponsepy"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/TAOResponse.py (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/TAOResponse.py       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/TAOResponse.py  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,8 +1,12 @@
</span><ins>+import os
+
</ins><span class="cx"> def main(request, response):
</span><del>-    origin = request.headers[b'origin']
-    response.headers.set(b'Access-Control-Allow-Origin', origin)
</del><ins>+    if b'origin' in request.headers:
+      origin = request.headers[b'origin']
+      response.headers.set(b'Access-Control-Allow-Origin', origin)
</ins><span class="cx"> 
</span><span class="cx">     tao = request.GET.first(b'tao')
</span><ins>+    img = request.GET.first(b'img') if b'img' in request.GET else None
</ins><span class="cx"> 
</span><span class="cx">     if tao == b'zero':
</span><span class="cx">     # zero TAO value, fail
</span><span class="lines">@@ -14,7 +18,7 @@
</span><span class="cx">     # null, fail unless it's an opaque origin
</span><span class="cx">         response.headers.set(b'Timing-Allow-Origin', b'null')
</span><span class="cx">     elif tao == b'Null':
</span><del>-    # case-insentive null, fail
</del><ins>+    # case-insensitive null, fail
</ins><span class="cx">         response.headers.set(b'Timing-Allow-Origin', b'Null')
</span><span class="cx">     elif tao == b'origin':
</span><span class="cx">     # case-sensitive match for origin, pass
</span><span class="lines">@@ -49,3 +53,12 @@
</span><span class="cx">         response.headers.set(b'Timing-Allow-Origin', origin.upper())
</span><span class="cx">     else:
</span><span class="cx">         pass
</span><ins>+    response.status = 200
+    if img:
+      response.headers.set(b"Content-Type", b"image/png")
+      with open(request.doc_root + "/resource-timing/resources/blue.png", "rb") as f:
+        response.content = f.read()
+        f.close()
+    else:
+      response.headers.set(b"Content-Type", b"text/plain")
+      response.content = "TEST"
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesall_resource_typeshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/all_resource_types.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/all_resource_types.html                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/all_resource_types.html 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,107 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+    <head>
+        <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+        <title>All Resource Types Test Page</title>
+        <link rel="shortcut icon" href="empty.py?favicon">
+    </head>
+    <body background='blue.png?id=body'>
+        <script>
+            if (window.parent.hasOwnProperty('on_test_body_created'))
+                window.parent.on_test_body_created();
+        </script>
+        <link rel="stylesheet" href="nested.css"></link>
+        <link rel="prefetch" href="nested.css?id=prefetch"></link>
+        <link rel="preload" href="nested.css?id=preload" as="style"></link>
+        <link rel="prerender" href="green.html?id=prerender"></link>
+        <link rel="manifest" href="manifest.json"></link>
+        <img src="resource_timing_test0.png"></img>
+        <img src="resource_timing_test0.png?id=srcset-src"
+            srcset="resource_timing_test0.png?id=srcset-srcset 67w"
+            sizes="67px"></img>
+        <iframe src="green.html" width="100px" height="100px"></iframe>
+        <script src="empty_script.js"></script>
+        <script>
+            var async_xhr = new XMLHttpRequest;
+            async_xhr.open('GET', 'blue.png?id=async_xhr', true);
+            async_xhr.onreadystatechange = function() {
+                if (async_xhr.readyState == 4 && async_xhr.status == 200 && parent.hasOwnProperty('on_async_xhr_done'))
+                    parent.on_async_xhr_done();
+            }
+            async_xhr.send();
+
+            if (window.navigator && navigator.sendBeacon) {
+                navigator.sendBeacon('empty.py?id=beacon');
+            }
+
+            if (window.fetch) {
+                fetch('empty.py?id=fetch');
+            }
+
+            if (window.EventSource) {
+                var evtSource = new EventSource('eventsource.py?id=eventsource');
+            }
+        </script>
+        <style>
+            @font-face {
+                font-family: remoteFontAhem;
+                src: url('/fonts/Ahem.ttf');
+            }
+            iframe {
+                background: url('blue.png?id=1');
+            }
+            body {
+                cursor: url('blue.png?id=cursor'), pointer;
+            }
+            ul {
+                font-family: remoteFontAhem;
+                list-style-image: url('blue.png?id=2');
+            }
+        </style>
+        <ul>
+            <li>Test</li>
+        </ul>
+        <ol>
+            <li>Test</li>
+        </ol>
+        <embed src="resource_timing_test0.css?id=embed" type="text/css"></embed>
+        <input type="image" src="blue.png?id=input"></input>
+        <object type="image/png" data="blue.png?id=object"></object>
+        <video poster="blue.png?id=video-poster"></video>
+        <video src="/media/test.mp4?id=video-src" autoplay="true"></video>
+        <video autoplay="true">
+            <source src="/media/test.mp4?id=video-source" type="video/mp4">
+            <source src="/media/test.ogv?id=video-source" type="video/ogg">
+            <track kind="subtitles" src="empty.py?id=video-track" srclang="en" default>
+        </video>
+        <audio src="empty.py?id=audio-src"></audio>
+        <audio>
+            <source src="empty.py?id=audio-source-wav" type="audio/wav" />
+            <source src="empty.py?id=audio-source-mpeg" type="audio/mpeg" />
+            <source src="empty.py?id=audio-source-ogg" type="audio/ogg" />
+        </audio>
+        <svg width=200 height=200
+            xmlns="http://www.w3.org/2000/svg"
+            xmlns:xlink="http://www.w3.org/1999/xlink">
+            <image href="blue.png?id=svg-image" height="200" width="200"/>
+        </svg>
+        <picture>
+            <source srcset="blue.png?id=picture-source" type="image/png" />
+            <img src="blue.png?id=picture-img" />
+        </picture>
+        <picture>
+            <source srcset="blue.png?id=picture-notsupported-source" type="image/notsupported" />
+            <img src="blue.png?id=picture-notsupported-img" />
+        </picture>
+        <picture>
+            <img src="blue.png?id=picture-img-src"
+                srcset="blue.png?id=picture-img-srcset"
+                sizes="67px"></img>
+        </picture>
+        <picture>
+            <img src="blue.png?id=picture-99x-img-src"
+                srcset="blue.png?id=picture-99x-img-srcset 99x"
+                sizes="67px"></img>
+        </picture>
+    </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesbufferfullutilitiesjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/buffer-full-utilities.js (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/buffer-full-utilities.js     2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/buffer-full-utilities.js        2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -12,12 +12,27 @@
</span><span class="cx">     xhr.send(null);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-let waitForNextTask = () => {
</del><ins>+// This script relies on resources/resource-loaders.js. Include it before in order for the below
+// methods to work properly.
+
+// The resources used to trigger new entries.
+const scriptResources = [
+    'resources/empty.js',
+    'resources/empty_script.js',
+    'resources/empty.js?id'
+];
+
+const waitForNextTask = () => {
</ins><span class="cx">     return new Promise(resolve => {
</span><span class="cx">         step_timeout(resolve, 0);
</span><span class="cx">     });
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+const clearBufferAndSetSize = size => {
+  performance.clearResourceTimings();
+  performance.setResourceTimingBufferSize(size);
+}
+
</ins><span class="cx"> let waitUntilConditionIsMet = cond => {
</span><span class="cx">     return new Promise(resolve => {
</span><span class="cx">         let checkCondition = function() {
</span><span class="lines">@@ -45,27 +60,57 @@
</span><span class="cx">     });
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-let clearBufferAndSetSize = size => {
-    performance.clearResourceTimings();
-    performance.setResourceTimingBufferSize(size);
-}
</del><ins>+const forceBufferFullEvent = async () => {
+  clearBufferAndSetSize(1);
+  return new Promise(async resolve => {
+    performance.addEventListener('resourcetimingbufferfull', resolve);
+    // Load 2 resources to ensure onresourcetimingbufferfull is fired.
+    // Load them in order in order to get the entries in that order!
+    await load.script(scriptResources[0]);
+    await load.script(scriptResources[1]);
+  });
+};
</ins><span class="cx"> 
</span><del>-let fillUpTheBufferWithSingleResource = src => {
-    return new Promise(resolve => {
-        // This resource gets buffered in the resource timing entry buffer.
-        appendScript(src, resolve);
-    });
</del><ins>+const fillUpTheBufferWithSingleResource = async (src = scriptResources[0]) => {
+  clearBufferAndSetSize(1);
+  await load.script(src);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-let loadResource = src => {
-    return new Promise(resolve => {
-        appendScript(src, resolve);
-    });
</del><ins>+const fillUpTheBufferWithTwoResources = async () => {
+    clearBufferAndSetSize(2);
+    // Load them in order in order to get the entries in that order!
+    await load.script(scriptResources[0]);
+    await load.script(scriptResources[1]);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-let fillUpTheBufferWithTwoResources = async src => {
-    // These resources get buffered in the resource timing entry buffer.
-    await loadResource(src);
-    await loadResource(src + '?second');
</del><ins>+const addAssertUnreachedBufferFull = t => {
+  performance.addEventListener('resourcetimingbufferfull', t.step_func(() => {
+    assert_unreached("resourcetimingbufferfull should not fire")
+  }));
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+const checkEntries = numEntries => {
+  const entries = performance.getEntriesByType('resource');
+  assert_equals(entries.length, numEntries,
+      'Number of entries does not match the expected value.');
+  assert_true(entries[0].name.includes(scriptResources[0]),
+      scriptResources[0] + " is in the entries buffer");
+  if (entries.length > 1) {
+    assert_true(entries[1].name.includes(scriptResources[1]),
+        scriptResources[1] + " is in the entries buffer");
+  }
+  if (entries.length > 2) {
+    assert_true(entries[2].name.includes(scriptResources[2]),
+        scriptResources[2] + " is in the entries buffer");
+  }
+}
+
+const bufferFullFirePromise = new Promise(resolve => {
+  performance.addEventListener('resourcetimingbufferfull', async () => {
+    // Wait for the next task just to ensure that all bufferfull events have fired, and to ensure
+    // that the secondary buffer is copied (as this is an event, there may be microtask checkpoints
+    // right after running an event handler).
+    await waitForNextTask();
+    resolve();
+  });
+});
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcescacheableandvalidatedpy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/cacheable-and-validated.py (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/cacheable-and-validated.py                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/cacheable-and-validated.py      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+def main(request, response):
+    revalidation = 'Cache-Control' in request.headers
+    content = request.GET.first(b'content')
+    response.headers.set(b'Cache-Control', b'max-age=60')
+    response.headers.set(b'ETag', b'assdfsdfe')
+    if revalidation:
+      response.status = (304, b'NotModified')
+    else:
+      response.status = (200, b'OK');
+      response.write_status_headers()
+      response.writer.write(content);
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesconnectionreusetestjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/connection-reuse-test.js (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/connection-reuse-test.js                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/connection-reuse-test.js        2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+// This script is loaded in HTTP and HTTPS contexts to validate
+// PerformanceResourceTiming entries' attributes when reusing connections.
+
+// Make the first request before calling 'attribute_test' so that only the
+// second request's PerformanceResourceTiming entry will be interrogated.
+// We don't check the first request's PerformanceResourceTiming entry because
+// that's not what this test is trying to validate.
+//
+// Note: to ensure that we reuse the connection to fetch multiple resources,
+// we use the same XMLHttpRequest object for each request. Although it doesn't
+// seem to be specified, each browser tested by WPT will reuse the underlying
+// TCP connection with this approach. Pre-establishing the XHR's connection
+// helps us to test connection reuse also in browsers that may key their
+// connections on the related request's credentials mode.
+const client = new XMLHttpRequest();
+const identifier = Math.random();
+const path = `resources/fake_responses.py?tag=${identifier}`;
+client.open("GET", path, false);
+client.send();
+
+attribute_test(
+  async () => {
+    client.open("GET", path + "&same_resource=false", false);
+    client.send();
+
+    // We expect to get a 200 Ok response because we've requested a different
+    // resource than previous requests.
+    if (client.status != 200) {
+      throw new Error(`Got something other than a 200 response. ` +
+                      `client.status: ${client.status}`);
+    }
+  }, path, entry => {
+    invariants.assert_connection_reused(entry);
+
+    // The entry must also follow the specification for any entry corresponding
+    // to a 'typical' 200 Ok response.
+    if (self.location.protocol == 'https:') {
+      invariants.assert_tao_pass_no_redirect_https(entry);
+    } else {
+      invariants.assert_tao_pass_no_redirect_http(entry);
+    }
+  },
+  "PerformanceResrouceTiming entries need to conform to the spec when a " +
+  "distinct resource is fetched over a persistent connection");
+
+attribute_test(
+  async () => {
+    client.open("GET", path, false);
+    client.setRequestHeader("If-None-Match", identifier);
+    client.send();
+
+    // We expect to get a 304 Not Modified response because we've used a
+    // matching 'identifier' for the If-None-Match header.
+    if (client.status != 304) {
+      throw new Error(`Got something other than a 304 response. ` +
+                      `client.status: ${client.status}`);
+    }
+  }, path, entry => {
+    invariants.assert_connection_reused(entry);
+
+    // The entry must also follow the specification for any entry corresponding
+    // to a 'typical' 304 Not Modified response.
+    if (self.location.protocol == 'https:') {
+      invariants.assert_tao_pass_304_not_modified_https(entry);
+    } else {
+      invariants.assert_tao_pass_304_not_modified_http(entry);
+    }
+  },
+  "PerformanceResrouceTiming entries need to conform to the spec when the " +
+  "resource is cache-revalidated over a persistent connection");
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcescspdefaultnonehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/csp-default-none.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/csp-default-none.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/csp-default-none.html   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>empty page</title>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcescspdefaultnonehtmlheaders"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/csp-default-none.html.headers (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/csp-default-none.html.headers                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/csp-default-none.html.headers   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+Content-Security-Policy: default-src 'none'
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesdocumentdomainnoimpacthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-domain-no-impact.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-domain-no-impact.html                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-domain-no-impact.html  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="/resources/testharness.js"></script>
+<script src="resource-loaders.js"></script>
+<script src="entry-invariants.js"></script>
+<body>
+<script>
+const path = location.origin +
+             "/resource-timing/resources/iframe-setdomain.sub.html";
+attribute_test_with_validator(load.iframe, path,
+  el => {
+    try {
+      el.contentWindow.document;
+      throw new Error("iframe document.domain was not set");
+    } catch(error) {
+      if (error.name != "SecurityError") {
+        throw(error);
+      }
+    }
+  },
+  invariants.assert_tao_pass_no_redirect_http,
+  "test that document.domain being set doesn't have an impact on the " +
+  "resource timing entry."
+);
+</script>
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesdocumentrefreshedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-refreshed.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-refreshed.html                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-refreshed.html 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+</head>
+<body>
+    Refreshed document!
+<script>
+    top.postMessage("refreshed", "*");
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesdocumentthatrefresheshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-that-refreshes.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-that-refreshes.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-that-refreshes.html    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<meta http-equiv="refresh" content="0;document-refreshed.html">
+</head>
+<body></body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesembedrefreshhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/embed-refresh.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/embed-refresh.html                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/embed-refresh.html      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing embed refresh</title>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="nested-contexts.js"></script>
+<script>
+    setup_refresh_test();
+</script>
+<div id=log></div>
+<embed type="text/html">
+<script>
+    document.getElementsByTagName("embed")[0].src = pre_refresh_url;
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesgreenframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green-frame.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green-frame.html                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green-frame.html        2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<html>
+  <head>
+    <frameset>
+      <frame src="green.html?id=frame">
+    </frameset>
+  </head>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesgreenhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green.html                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green.html      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+    <head>
+        <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+        <title>Green Test Page</title>
+    </head>
+    <body style="background-color:#00FF00;">
+        <h1>Placeholder</h1>
+    </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesgreenhtmlheaders"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green.html.headers (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green.html.headers                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green.html.headers      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Access-Control-Allow-Origin: *
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesgzip_xmlpy"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/gzip_xml.py (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/gzip_xml.py  2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/gzip_xml.py     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> import gzip as gzip_module
</span><span class="cx"> import os
</span><span class="cx"> 
</span><del>-from six import BytesIO
</del><ins>+from io import BytesIO
</ins><span class="cx"> 
</span><span class="cx"> from wptserve.utils import isomorphic_decode
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesiframerefreshhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-refresh.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-refresh.html                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-refresh.html     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing iframe refresh</title>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="nested-contexts.js"></script>
+<script>
+    setup_refresh_test();
+</script>
+<div id=log></div>
+<iframe></iframe>
+<script>
+    document.getElementsByTagName("iframe")[0].src = pre_refresh_url;
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesiframereloadTAOsubhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-reload-TAO.sub.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-reload-TAO.sub.html   2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-reload-TAO.sub.html      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> <style>
</span><span class="cx"> @font-face {
</span><span class="cx">     font-family: ahem;
</span><del>-    src: url(http://{{hosts[alt][]}}:{{ports[http][1]}}/resource-timing/resources/cors-ahem.py);
</del><ins>+    src: url(http://{{domains[www]}}:{{ports[http][1]}}/resource-timing/resources/cors-ahem.py);
</ins><span class="cx"> }
</span><span class="cx"> </style>
</span><span class="cx"> <div style="font-family: ahem;">This fetches ahem font.</div>
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> <script>
</span><span class="cx">   if (location.hash === '#check') {
</span><span class="cx">       document.fonts.ready.then(()=> {
</span><del>-        const entries = performance.getEntriesByName('http://{{hosts[alt][]}}:{{ports[http][1]}}/resource-timing/resources/cors-ahem.py');
</del><ins>+        const entries = performance.getEntriesByName('http://{{domains[www]}}:{{ports[http][1]}}/resource-timing/resources/cors-ahem.py');
</ins><span class="cx">         if (entries.length != 1)
</span><span class="cx">           return;
</span><span class="cx">         const entry = entries[0];
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesmulti_redirectpy"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/multi_redirect.py (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/multi_redirect.py    2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/multi_redirect.py       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+import urllib.parse
</ins><span class="cx"> from wptserve.utils import isomorphic_encode
</span><span class="cx"> 
</span><span class="cx"> def main(request, response):
</span><span class="lines">@@ -37,7 +38,7 @@
</span><span class="cx">     redirect_url_path = b"/resource-timing/resources/multi_redirect.py?"
</span><span class="cx">     redirect_url_path += b"page_origin=" + page_origin
</span><span class="cx">     redirect_url_path += b"&cross_origin=" + cross_origin
</span><del>-    redirect_url_path += b"&final_resource=" + final_resource
</del><ins>+    redirect_url_path += b"&final_resource=" + urllib.parse.quote(final_resource).encode('ascii')
</ins><span class="cx">     redirect_url_path += b"&tao_value=" + tao_value
</span><span class="cx">     redirect_url_path += b"&tao_steps=" + isomorphic_encode(str(next_tao_steps))
</span><span class="cx">     redirect_url_path += b"&step="
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesobjectrefreshhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/object-refresh.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/object-refresh.html                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/object-refresh.html     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing object refresh</title>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="nested-contexts.js"></script>
+<script>
+    setup_refresh_test();
+</script>
+<div id=log></div>
+<object type="text/html"></object>
+<script>
+    document.getElementsByTagName("object")[0].data = pre_refresh_url;
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesredirectcorspy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/redirect-cors.py (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/redirect-cors.py                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/redirect-cors.py        2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+def main(request, response):
+    location = request.GET.first(b"location")
+    response.status = 302
+    response.headers.set(b"Location", location)
+
+    if b"allow_origin" in request.GET:
+        response.headers.set(b"Access-Control-Allow-Origin", request.GET.first(b"allow_origin"))
+
+    if b"timing_allow_origin" in request.GET:
+        response.headers.set(b"Timing-Allow-Origin", request.GET.first(b"timing_allow_origin"))
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesresourcetimingcontentlengthpy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/resource-timing-content-length.py (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/resource-timing-content-length.py                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/resource-timing-content-length.py       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+def main(request, response):
+    content = request.GET.first(b"content")
+    length = request.GET.first(b"length").decode("ascii")
+    response.add_required_headers = False
+
+    output =  b"HTTP/1.1 200 OK\r\n"
+    output += b"Content-Type: text/plain;charset=UTF-8\r\n"
+    if length == b"auto" :
+        output += b"Content-Length:"
+        output += "{0}".format(len(content)).encode("ascii")
+        output += b"\r\n"
+    elif length != b"none" :
+        output += b"Content-Length:"
+        output += "{0}".format(length).encode("ascii")
+        output += b"\r\n"
+    output += b"\r\n"
+    output += content
+    response.writer.write(output)
+    response.close_connection = True
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesresource_timing_test0xml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/resource_timing_test0.xml (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/resource_timing_test0.xml    2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/resource_timing_test0.xml       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> <?xml version="1.0" encoding="ISO-8859-1"?>
</span><span class="cx"> <TESTDATA>
</span><span class="cx">     <ITEM>
</span><del>-        <DATA>Test XML Data</data>
-    </item>
-</testdata>
</del><ins>+        <DATA>Test XML Data</DATA>
+    </ITEM>
+</TESTDATA>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcessizeshelperjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/sizes-helper.js (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/sizes-helper.js                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/sizes-helper.js 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+// Header size is a fixed constant.
+// https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-transfersize
+const headerSize = 300;
+
+const cacheBustUrl = url => {
+  return url + '&unique=' + Math.random().toString().substring(2);
+}
+
+const checkSizeFields = (entry, bodySize, transferSize) => {
+  assert_equals(entry.decodedBodySize, bodySize,
+                'decodedBodySize');
+  assert_equals(entry.encodedBodySize, bodySize,
+                'encodedBodySize');
+  assert_equals(entry.transferSize, transferSize,
+                'transferSize');
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesstatuscodepy"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/status-code.py (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/status-code.py       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/status-code.py  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,4 +1,6 @@
</span><span class="cx"> def main(request, response):
</span><span class="cx">     status = request.GET.first(b'status')
</span><span class="cx">     response.status = (status, b"");
</span><ins>+    if b'tao_value' in request.GET:
+      response.headers.set(b'timing-allow-origin', request.GET.first(b'tao_value'))
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourceswebperftestharnessjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharness.js (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharness.js        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharness.js   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -62,13 +62,13 @@
</span><span class="cx">     if (skip_root === undefined) {
</span><span class="cx">         var msg = 'window.performance is defined';
</span><span class="cx">         // The window.performance attribute provides a hosting area for performance related attributes.
</span><del>-        wp_test(function () { assert_true(performanceNamespace !== undefined, msg); }, msg);
</del><ins>+        wp_test(function () { assert_not_equals(performanceNamespace, undefined, msg); }, msg);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (child_name !== undefined) {
</span><span class="cx">         var msg2 = 'window.performance.' + child_name + ' is defined';
</span><span class="cx">         // The window.performance attribute provides a hosting area for performance related attributes.
</span><del>-        wp_test(function() { assert_true(performanceNamespace[child_name] !== undefined, msg2); }, msg2);
</del><ins>+        wp_test(function() { assert_not_equals(performanceNamespace[child_name], undefined, msg2); }, msg2);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -75,13 +75,13 @@
</span><span class="cx"> function test_attribute_exists(parent_name, attribute_name, properties)
</span><span class="cx"> {
</span><span class="cx">     var msg = 'window.performance.' + parent_name + '.' + attribute_name + ' is defined.';
</span><del>-    wp_test(function() { assert_true(performanceNamespace[parent_name][attribute_name] !== undefined, msg); }, msg, properties);
</del><ins>+    wp_test(function() { assert_not_equals(performanceNamespace[parent_name][attribute_name], undefined, msg); }, msg, properties);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function test_enum(parent_name, enum_name, value, properties)
</span><span class="cx"> {
</span><span class="cx">     var msg = 'window.performance.' + parent_name + '.' + enum_name + ' is defined.';
</span><del>-    wp_test(function() { assert_true(performanceNamespace[parent_name][enum_name] !== undefined, msg); }, msg, properties);
</del><ins>+    wp_test(function() { assert_not_equals(performanceNamespace[parent_name][enum_name], undefined, msg); }, msg, properties);
</ins><span class="cx"> 
</span><span class="cx">     msg = 'window.performance.' + parent_name + '.' + enum_name + ' = ' + value;
</span><span class="cx">     wp_test(function() { assert_equals(performanceNamespace[parent_name][enum_name], value, msg); }, msg, properties);
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx"> 
</span><span class="cx"> function test_not_equals(value, notequals, msg, properties)
</span><span class="cx"> {
</span><del>-    wp_test(function() { assert_true(value !== notequals, msg); }, msg, properties);
</del><ins>+    wp_test(function() { assert_not_equals(value, notequals, msg); }, msg, properties);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function test_tao_pass(entry) {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourceswebperftestharnessextensionjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharnessextension.js (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharnessextension.js       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharnessextension.js  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,13 +1,7 @@
</span><del>-/*
-Distributed under both the W3C Test Suite License [1] and the W3C
-3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
-policies and contribution forms [3].
</del><ins>+//
+// Helper functions for Resource Timing tests
+//
</ins><span class="cx"> 
</span><del>-[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
-[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
-[3] http://www.w3.org/2004/10/27-testcases
- */
-
</del><span class="cx"> var mark_names = [
</span><span class="cx">     '',
</span><span class="cx">     '1',
</span><span class="lines">@@ -27,7 +21,7 @@
</span><span class="cx">         msg = 'performance.' + method.name + ' is supported!';
</span><span class="cx">     else
</span><span class="cx">         msg = 'performance.' + method_name + ' is supported!';
</span><del>-    wp_test(function() { assert_true(typeof method === 'function', msg); }, msg, properties);
</del><ins>+    wp_test(function() { assert_equals(typeof method, 'function', msg); }, msg, properties);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function test_noless_than(value, greater_than, msg, properties)
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsameoriginfromcrossoriginredirectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect-expected.txt                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect-expected.txt       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS Verify that cross origin resources' timings are exposed when the final resource at the end of an HTTP redirect chain is same-origin.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsameoriginfromcrossoriginredirecthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect.html                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect.html       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>This test validates resource timing information for a same-origin
+resource fetched through a cross-origin redirect chain.</title>
+<link rel="author" title="Google" href="https://google.com/" />
+<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/resource-loaders.js"></script>
+<script src="resources/entry-invariants.js"></script>
+</head>
+<body>
+<script>
+const {HTTP_REMOTE_ORIGIN} = get_host_info();
+let destUrl = `${HTTP_REMOTE_ORIGIN}/resource-timing/resources/multi_redirect.py?`;
+destUrl += `page_origin=http://${document.location.host}`;
+destUrl += `&cross_origin=${HTTP_REMOTE_ORIGIN}`;
+destUrl += `&final_resource=/resource-timing/resources/blank-with-tao.html`;
+
+attribute_test(
+  load.iframe, destUrl,
+  invariants.assert_same_origin_redirected_from_cross_origin_resource,
+  "Verify that cross origin resources' timings are exposed when the final " +
+  "resource at the end of an HTTP redirect chain is same-origin.");
+
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsizescacheanyjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-cache.any.js (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-cache.any.js                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-cache.any.js        2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+// META: global=window,worker
+// META: script=/resource-timing/resources/sizes-helper.js
+// META: script=/resource-timing/resources/resource-loaders.js
+
+let url = new URL(
+  '/resource-timing/resources/cacheable-and-validated.py' +
+  '?content=loremipsumblablabla',
+  location.href).href;
+const bodySize = 19;
+
+const accumulateEntries = () => {
+  return new Promise(resolve => {
+    const po = new PerformanceObserver(list => {
+      resolve(list);
+    });
+    po.observe({type: "resource", buffered: true});
+  });
+};
+
+const checkResourceSizes = list => {
+  const entries = list.getEntriesByName(url);
+  assert_equals(entries.length, 3, 'Wrong number of entries');
+  let seenCount = 0;
+  for (let entry of entries) {
+    if (seenCount === 0) {
+      // 200 response
+      checkSizeFields(entry, bodySize, bodySize + headerSize);
+    } else if (seenCount === 1) {
+      // from cache
+      checkSizeFields(entry, bodySize, 0);
+    } else if (seenCount === 2) {
+      // 304 response
+      checkSizeFields(entry, bodySize, headerSize);
+    } else {
+      assert_unreached('Too many matching entries');
+    }
+    ++seenCount;
+  }
+};
+
+promise_test(() => {
+  // Use a different URL every time so that the cache behaviour does not
+  // depend on execution order.
+  url = load.cache_bust(url);
+  const eatBody = response => response.arrayBuffer();
+  const mustRevalidate = {headers: {'Cache-Control': 'max-age=0'}};
+  return fetch(url)
+    .then(eatBody)
+    .then(() => fetch(url))
+    .then(eatBody)
+    .then(() => fetch(url, mustRevalidate))
+    .then(eatBody)
+    .then(accumulateEntries)
+    .then(checkResourceSizes);
+}, 'PerformanceResourceTiming sizes caching test');
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsizesredirectimgexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect-img-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect-img-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect-img-expected.txt   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+
+PASS PerformanceResourceTiming sizes redirect image - direct URL
+PASS PerformanceResourceTiming sizes redirect image - same origin redirect
+PASS PerformanceResourceTiming sizes redirect image - cross origin redirect
+PASS PerformanceResourceTiming sizes redirect image - cross origin to same origin redirect
+PASS PerformanceResourceTiming sizes redirect image - same origin to remote origin to same origin redirect
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsizesredirectimghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect-img.html (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect-img.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect-img.html   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/sizes-helper.js"></script>
+<script src="resources/resource-loaders.js"></script>
+<script src="resources/entry-invariants.js"></script>
+<script>
+// Redirects for fetch() always apply CORS rules, whereas normal resources
+// don't, so this test covers extra code paths beyond those covered by
+// resource-timing-sizes-redirect.html.
+
+const baseUrl = new URL('/resource-timing/resources/TAOResponse.py?tao=wildcard&img=true', location.href).href;
+
+const expectedSize = 1010;
+
+const hostInfo = get_host_info();
+
+const redirectUrl = (redirectSourceOrigin, targetUrl) => {
+  return redirectSourceOrigin +
+    '/resource-timing/resources/redirect-cors.py?timing_allow_origin=*' +
+    '&location=' + encodeURIComponent(targetUrl);
+};
+
+const verify_entry = entry => {
+  checkSizeFields(entry, expectedSize, expectedSize + headerSize);
+};
+
+attribute_test(load.image, baseUrl,
+  verify_entry,
+  "PerformanceResourceTiming sizes redirect image - direct URL");
+
+attribute_test(load.image,
+  redirectUrl(hostInfo.HTTP_ORIGIN, baseUrl),
+  verify_entry,
+  "PerformanceResourceTiming sizes redirect image - same origin redirect");
+
+attribute_test(load.image,
+  redirectUrl(hostInfo.HTTP_REMOTE_ORIGIN, baseUrl),
+  verify_entry,
+  "PerformanceResourceTiming sizes redirect image - cross origin redirect");
+
+attribute_test(load.image,
+  redirectUrl(hostInfo.HTTP_REMOTE_ORIGIN,
+    redirectUrl(hostInfo.HTTP_ORIGIN, baseUrl)),
+  verify_entry,
+  "PerformanceResourceTiming sizes redirect image - cross origin to same origin redirect");
+
+attribute_test(load.image,
+  redirectUrl(hostInfo.HTTP_ORIGIN,
+    redirectUrl(hostInfo.HTTP_REMOTE_ORIGIN,
+      redirectUrl(hostInfo.HTTP_ORIGIN,
+        baseUrl))),
+  verify_entry,
+  "PerformanceResourceTiming sizes redirect image - same origin to remote " +
+  "origin to same origin redirect");
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingsizesredirectanyjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect.any.js (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect.any.js                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/sizes-redirect.any.js     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+// META: global=window,worker
+// META: script=/common/get-host-info.sub.js
+// META: script=/resource-timing/resources/sizes-helper.js
+
+const baseUrl =
+  new URL('/resource-timing/resources/TAOResponse.py?tao=wildcard', location.href).href;
+const expectedSize = 4;
+
+const hostInfo = get_host_info();
+performance.clearResourceTimings();
+
+const accumulateEntry = () => {
+  return new Promise(resolve => {
+    const po = new PerformanceObserver(list => {
+      resolve(list);
+    });
+    po.observe({type: "resource", buffered: true});
+  });
+};
+
+const checkResourceSizes = () => {
+  const entries = performance.getEntriesByType('resource');
+  for (let entry of entries) {
+    checkSizeFields(entry, expectedSize, expectedSize + headerSize);
+  }
+}
+
+const redirectUrl = (redirectSourceOrigin, allowOrigin, targetUrl) => {
+  return redirectSourceOrigin +
+    '/resource-timing/resources/redirect-cors.py?allow_origin=' +
+    encodeURIComponent(allowOrigin) +
+    '&timing_allow_origin=*' +
+    '&location=' + encodeURIComponent(targetUrl);
+}
+
+promise_test(() => {
+  // Use a different URL every time so that the cache behaviour does not
+  // depend on execution order.
+  const directUrl = cacheBustUrl(baseUrl);
+  const sameOriginRedirect = redirectUrl(hostInfo.ORIGIN, '*', directUrl);
+  const crossOriginRedirect = redirectUrl(hostInfo.REMOTE_ORIGIN,
+    hostInfo.ORIGIN, directUrl);
+  const mixedRedirect = redirectUrl(hostInfo.REMOTE_ORIGIN,
+    hostInfo.ORIGIN, sameOriginRedirect);
+  const complexRedirect = redirectUrl(hostInfo.ORIGIN,
+    hostInfo.REMOTE_ORIGIN, mixedRedirect);
+  let eatBody = response => response.arrayBuffer();
+  return fetch(directUrl)
+    .then(eatBody)
+    .then(() => fetch(sameOriginRedirect))
+    .then(eatBody)
+    .then(() => fetch(crossOriginRedirect))
+    .then(eatBody)
+    .then(() => fetch(mixedRedirect))
+    .then(eatBody)
+    .then(() => fetch(complexRedirect))
+    .then(eatBody)
+    .then(accumulateEntry)
+    .then(checkResourceSizes);
+}, 'PerformanceResourceTiming sizes Fetch with redirect test');
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingstatuscodescreateentryhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html 2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -18,13 +18,17 @@
</span><span class="cx">   window.addEventListener("load", t.step_func_done(() => {
</span><span class="cx">     const images = document.getElementsByTagName("img");
</span><span class="cx">     for (let img of images) {
</span><del>-      assert_greater_than(performance.getEntriesByName(img.src).length, 0, img.src);
</del><ins>+      const entries = performance.getEntriesByName(img.src);
+      assert_greater_than(entries.length, 0, img.src);
+      assert_greater_than(entries[0].duration, 0, img.src);
</ins><span class="cx">     }
</span><span class="cx">     const scripts = document.getElementsByTagName("script");
</span><span class="cx">     let noSrcScriptFound = false;
</span><span class="cx">     for (let script of scripts) {
</span><span class="cx">       if (script.src) {
</span><del>-        assert_greater_than(performance.getEntriesByName(script.src).length, 0, script.src);
</del><ins>+        const entries = performance.getEntriesByName(script.src);
+        assert_greater_than(entries.length, 0, script.src);
+        assert_greater_than(entries[0].duration, 0, script.src);
</ins><span class="cx">       } else {
</span><span class="cx">         // Ignore this script, which has no src value. There should only be one such script.
</span><span class="cx">         assert_false(noSrcScriptFound);
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingtest_resource_timingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing-expected.txt      2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing-expected.txt 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -6,28 +6,28 @@
</span><span class="cx"> PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (iframe)
</span><span class="cx"> PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (iframe)
</span><span class="cx"> PASS PerformanceEntry has correct order of timing attributes (iframe)
</span><del>-FAIL PerformanceEntry has correct network transfer attributes (iframe) assert_equals: encodedBodySize size expected (number) 215 but got (undefined) undefined
-FAIL PerformanceEntry has correct protocol attribute (iframe) assert_equals: expected protocol expected (string) "http/1.1" but got (undefined) undefined
</del><ins>+PASS PerformanceEntry has correct network transfer attributes (iframe)
+PASS PerformanceEntry has correct protocol attribute (iframe)
</ins><span class="cx"> PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (img)
</span><span class="cx"> PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (img)
</span><span class="cx"> PASS PerformanceEntry has correct order of timing attributes (img)
</span><del>-FAIL PerformanceEntry has correct network transfer attributes (img) assert_equals: encodedBodySize size expected (number) 249 but got (undefined) undefined
-FAIL PerformanceEntry has correct protocol attribute (img) assert_equals: expected protocol expected (string) "http/1.1" but got (undefined) undefined
</del><ins>+PASS PerformanceEntry has correct network transfer attributes (img)
+PASS PerformanceEntry has correct protocol attribute (img)
</ins><span class="cx"> PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (link)
</span><span class="cx"> PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (link)
</span><span class="cx"> PASS PerformanceEntry has correct order of timing attributes (link)
</span><del>-FAIL PerformanceEntry has correct network transfer attributes (link) assert_equals: encodedBodySize size expected (number) 44 but got (undefined) undefined
-FAIL PerformanceEntry has correct protocol attribute (link) assert_equals: expected protocol expected (string) "http/1.1" but got (undefined) undefined
</del><ins>+PASS PerformanceEntry has correct network transfer attributes (link)
+PASS PerformanceEntry has correct protocol attribute (link)
</ins><span class="cx"> PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (script)
</span><span class="cx"> PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (script)
</span><span class="cx"> PASS PerformanceEntry has correct order of timing attributes (script)
</span><del>-FAIL PerformanceEntry has correct network transfer attributes (script) assert_equals: encodedBodySize size expected (number) 133 but got (undefined) undefined
-FAIL PerformanceEntry has correct protocol attribute (script) assert_equals: expected protocol expected (string) "http/1.1" but got (undefined) undefined
</del><ins>+PASS PerformanceEntry has correct network transfer attributes (script)
+PASS PerformanceEntry has correct protocol attribute (script)
</ins><span class="cx"> PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (xmlhttprequest)
</span><span class="cx"> PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (xmlhttprequest)
</span><span class="cx"> PASS PerformanceEntry has correct order of timing attributes (xmlhttprequest)
</span><del>-FAIL PerformanceEntry has correct network transfer attributes (xmlhttprequest) assert_equals: encodedBodySize size expected (number) 112 but got (undefined) undefined
-FAIL PerformanceEntry has correct protocol attribute (xmlhttprequest) assert_equals: expected protocol expected (string) "http/1.1" but got (undefined) undefined
</del><ins>+PASS PerformanceEntry has correct network transfer attributes (xmlhttprequest)
+PASS PerformanceEntry has correct protocol attribute (xmlhttprequest)
</ins><span class="cx"> PASS window.performance Resource Timing Entries exist
</span><span class="cx"> PASS window.performance Resource Timing Entries exist 1
</span><span class="cx"> PASS window.performance Resource Timing Entries exist 2
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingtest_resource_timinghttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https-expected.txt        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https-expected.txt   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (xmlhttprequest)
</span><span class="cx"> PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (xmlhttprequest)
</span><span class="cx"> PASS PerformanceEntry has correct order of timing attributes (xmlhttprequest)
</span><del>-FAIL PerformanceEntry has correct network transfer attributes (xmlhttprequest) assert_equals: encodedBodySize size expected 112 but got 120
</del><ins>+PASS PerformanceEntry has correct network transfer attributes (xmlhttprequest)
</ins><span class="cx"> PASS PerformanceEntry has correct protocol attribute (xmlhttprequest)
</span><span class="cx"> PASS window.performance Resource Timing Entries exist
</span><span class="cx"> PASS window.performance Resource Timing Entries exist 1
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingworkerStarttaoprotectedhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/workerStart-tao-protected.https.html (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/workerStart-tao-protected.https.html   2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/workerStart-tao-protected.https.html      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">     const observer = new PerformanceObserver(list => {
</span><span class="cx">       const entries = list.getEntries();
</span><span class="cx">       for (entry of entries) {
</span><del>-        if (entry.name.includes("blank_page_green.htm")) {
</del><ins>+        if (entry.name.includes("green.html")) {
</ins><span class="cx">           observer.disconnect();
</span><span class="cx">           // Observe its performance entry to make sure workerStart is zero
</span><span class="cx">           if (entry.workerStart != 0) {
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">       }
</span><span class="cx">     });
</span><span class="cx">     observer.observe({entryTypes: ["resource"]});
</span><del>-    addFrame(host_info.HTTPS_REMOTE_ORIGIN + "/resource-timing/resources/blank_page_green.htm");
</del><ins>+    addFrame(host_info.HTTPS_REMOTE_ORIGIN + "/resource-timing/resources/green.html");
</ins><span class="cx">   });
</span><span class="cx"> }, "Add TAO-less iframe to remote origin. Make sure workerStart is zero");
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsnavigationtimingnav2_test_attributes_valuesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt    2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -3,5 +3,5 @@
</span><span class="cx"> This test validates that the values of nav timing 2 instance's timing-related attributes are in certain order and the others are of expected values.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-FAIL Performance navigation timing instance's value is reasonable. assert_equals: expected "http/1.1" but got ""
</del><ins>+FAIL Performance navigation timing instance's value is reasonable. assert_greater_than: Expected domInteractive to be greater than 0 expected a number greater than 0 but got 0
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsresourcetimingnextHopProtocoltaoprotectedhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-tao-protected.https-expected.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-tao-protected.https-expected.txt      2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-tao-protected.https-expected.txt 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS Add TAO-less iframe to remote origin. Make sure nextHopProtocol is the empty string
-FAIL Add TAO iframe to remote origin. Make sure nextHopProtocol is not the empty string promise_test: Unhandled rejection with value: "nextHopProtocol should not be the empty string"
</del><ins>+FAIL Add TAO-less iframe to remote origin. Make sure nextHopProtocol is the empty string promise_test: Unhandled rejection with value: "nextHopProtocol should be the empty string"
+PASS Add TAO iframe to remote origin. Make sure nextHopProtocol is not the empty string
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsresourcetimingobjectnotfoundafterTAOcrossoriginredirectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect-expected.txt                         (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect-expected.txt    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+
+Harness Error (TIMEOUT), message = null
+
+PASS window.performance is defined
+PASS window.performance.getEntriesByName is defined
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsresourcetimingobjectnotfoundaftercrossoriginredirectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect-expected.txt                             (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect-expected.txt        2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+
+Harness Error (TIMEOUT), message = null
+
+PASS window.performance is defined
+PASS window.performance.getEntriesByName is defined
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsresourcetimingredirectsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/redirects-expected.txt (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/redirects-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/resource-timing/redirects-expected.txt   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Description
+
+This test validates that, when a fetching resources that encounter same-origin redirects, attributes of the PerformanceResourceTiming entry conform to the specification.
+
+
+PASS Verify attributes of a redirected stylesheet's PerformanceResourceTiming
+PASS Verify attributes of a redirected image's PerformanceResourceTiming
+PASS Verify attributes of a redirected iframe's PerformanceResourceTiming
+PASS Verify attributes of a redirected script's PerformanceResourceTiming
+FAIL Verify attributes of a redirected synchronous XMLHttpRequest's PerformanceResourceTiming assert_greater_than: redirectStart should be greater than 0 expected a number greater than 0 but got 0
+FAIL Verify attributes of a synchronous XMLHttpRequest's PerformanceResourceTiming where the initial HTTP request is redirected to a cross-origin HTTPS resource. promise_test: Unhandled rejection with value: object "NetworkError:  A network error occurred."
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations  2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/LayoutTests/platform/win/TestExpectations     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -4341,6 +4341,7 @@
</span><span class="cx"> webkit.org/b/202949 http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https.html [ Failure ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/202954 http/wpt/resource-timing/rt-resources-per-worker.html [ Failure ]
</span><ins>+http/wpt/resource-timing/rt-revalidate-requests-2.html [ Failure ]
</ins><span class="cx"> 
</span><span class="cx"> webkit.org/b/202951 fast/canvas/drawImage-animated-gif-draws-first-frame-and-no-reset-image.html [ Timeout ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/ChangeLog      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,5 +1,112 @@
</span><span class="cx"> 2021-06-10  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><ins>+        Move Timing-Allow-Origin checks to the network process
+        https://bugs.webkit.org/show_bug.cgi?id=226678
+        <rdar://problem/45227788>
+
+        Reviewed by Chris Dumez.
+
+        We tried hard to do it in the web process by keeping track of whether the last redirect was cross-origin
+        and checking the final response and original security origin.  We got many tests to pass, but to get the rest
+        and be correct, we need to check the Timing-Allow-Origin header field of each redirect against the original security origin.
+
+        Tests: imported/w3c/web-platform-tests/resource-timing/SO-XO-SO-redirect-chain-tao.https.html
+               imported/w3c/web-platform-tests/resource-timing/TAO-match.html
+               imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin.html
+               imported/w3c/web-platform-tests/resource-timing/TAO-port-mismatch-means-crossorigin.html
+               imported/w3c/web-platform-tests/resource-timing/connection-reuse.html
+               imported/w3c/web-platform-tests/resource-timing/connection-reuse.https.html
+               imported/w3c/web-platform-tests/resource-timing/cross-origin-start-end-time-with-redirects.html
+               imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-opener.html
+               imported/w3c/web-platform-tests/resource-timing/entry-attributes.html
+               imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html
+               imported/w3c/web-platform-tests/resource-timing/font-timestamps.html
+               imported/w3c/web-platform-tests/resource-timing/iframe-failed-commit.html
+               imported/w3c/web-platform-tests/resource-timing/initiator-type-for-script.html
+               imported/w3c/web-platform-tests/resource-timing/nextHopProtocol-is-tao-protected.https.html
+               imported/w3c/web-platform-tests/resource-timing/object-not-found-after-TAO-cross-origin-redirect.html
+               imported/w3c/web-platform-tests/resource-timing/object-not-found-after-cross-origin-redirect.html
+               imported/w3c/web-platform-tests/resource-timing/redirects.html
+               imported/w3c/web-platform-tests/resource-timing/resource-ignore-data-url.html
+               imported/w3c/web-platform-tests/resource-timing/resource_cached.html
+               imported/w3c/web-platform-tests/resource-timing/resource_timing_content_length.html
+               imported/w3c/web-platform-tests/resource-timing/same-origin-from-cross-origin-redirect.html
+               imported/w3c/web-platform-tests/resource-timing/sizes-redirect-img.html
+
+        * Headers.cmake:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::start):
+        Get a SecurityOrigin for our WebKitLegacy ResourceHandle use like we do in WebLoaderStrategy::scheduleLoadFromNetworkProcess
+        * loader/ResourceTiming.cpp:
+        (WebCore::ResourceTiming::ResourceTiming):
+        (WebCore::ResourceTiming::initServerTiming):
+        (WebCore::ResourceTiming::isolatedCopy const):
+        (WebCore::passesTimingAllowCheck): Deleted.
+        * loader/ResourceTiming.h:
+        (WebCore::ResourceTiming::networkLoadMetrics const):
+        (WebCore::ResourceTiming::ResourceTiming):
+        (WebCore::ResourceTiming::allowTimingDetails const): Deleted.
+        (): Deleted.
+        * page/PerformanceNavigation.cpp:
+        (WebCore::PerformanceNavigation::redirectCount const):
+        * page/PerformanceNavigationTiming.cpp:
+        (WebCore::PerformanceNavigationTiming::sameOriginCheckFails const):
+        (WebCore::PerformanceNavigationTiming::redirectCount const):
+        * page/PerformanceResourceTiming.cpp:
+        (WebCore::entryStartTime):
+        (WebCore::entryEndTime):
+        (WebCore::PerformanceResourceTiming::redirectStart const):
+        (WebCore::PerformanceResourceTiming::redirectEnd const):
+        (WebCore::PerformanceResourceTiming::domainLookupStart const):
+        (WebCore::PerformanceResourceTiming::domainLookupEnd const):
+        (WebCore::PerformanceResourceTiming::connectStart const):
+        (WebCore::PerformanceResourceTiming::connectEnd const):
+        (WebCore::PerformanceResourceTiming::secureConnectionStart const):
+        (WebCore::PerformanceResourceTiming::requestStart const):
+        (WebCore::PerformanceResourceTiming::responseStart const):
+        (WebCore::PerformanceResourceTiming::transferSize const):
+        (WebCore::PerformanceResourceTiming::encodedBodySize const):
+        (WebCore::PerformanceResourceTiming::decodedBodySize const):
+        * page/PerformanceTiming.cpp:
+        (WebCore::PerformanceTiming::unloadEventStart const):
+        (WebCore::PerformanceTiming::unloadEventEnd const):
+        (WebCore::PerformanceTiming::redirectStart const):
+        (WebCore::PerformanceTiming::redirectEnd const):
+        * platform/network/BlobResourceHandle.cpp:
+        (WebCore::BlobResourceHandle::BlobResourceHandle):
+        * platform/network/NetworkLoadMetrics.h:
+        (WebCore::NetworkLoadMetrics::isolatedCopy const):
+        (WebCore::NetworkLoadMetrics::operator== const):
+        (WebCore::NetworkLoadMetrics::encode const):
+        (WebCore::NetworkLoadMetrics::decode):
+        * platform/network/ResourceHandle.cpp:
+        (WebCore::ResourceHandle::ResourceHandle):
+        (WebCore::ResourceHandle::create):
+        (WebCore::ResourceHandle::loadResourceSynchronously):
+        (WebCore::ResourceHandle::isCrossOriginWithoutTAO const):
+        (WebCore::ResourceHandle::markAsCrossOriginWithoutTAO):
+        (WebCore::ResourceHandle::sourceOrigin const):
+        (WebCore::ResourceHandle::hasCrossOriginRedirect const): Deleted.
+        (WebCore::ResourceHandle::setHasCrossOriginRedirect): Deleted.
+        * platform/network/ResourceHandle.h:
+        * platform/network/ResourceHandleInternal.h:
+        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+        * platform/network/TimingAllowOrigin.cpp: Added.
+        (WebCore::passesTimingAllowOriginCheck):
+        * platform/network/TimingAllowOrigin.h: Added.
+        * platform/network/cocoa/NetworkLoadMetrics.mm:
+        (WebCore::packageTimingData):
+        (WebCore::copyTimingData):
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
+        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
+
+2021-06-10  Alex Christensen  <achristensen@webkit.org>
+
</ins><span class="cx">         Origin is null in http requests when baseURL has custom scheme on iOS 15.0
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=226760
</span><span class="cx">         <rdar://79027280>
</span></span></pre></div>
<a id="trunkSourceWebCoreHeaderscmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Headers.cmake (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Headers.cmake       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/Headers.cmake  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1478,6 +1478,7 @@
</span><span class="cx">     platform/network/StorageSessionProvider.h
</span><span class="cx">     platform/network/StoredCredentialsPolicy.h
</span><span class="cx">     platform/network/SynchronousLoaderClient.h
</span><ins>+    platform/network/TimingAllowOrigin.h
</ins><span class="cx"> 
</span><span class="cx">     platform/sql/SQLValue.h
</span><span class="cx">     platform/sql/SQLiteDatabase.h
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/Sources.txt    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -2189,6 +2189,7 @@
</span><span class="cx"> platform/network/SocketStreamHandle.cpp
</span><span class="cx"> platform/network/SocketStreamHandleImpl.cpp
</span><span class="cx"> platform/network/SynchronousLoaderClient.cpp
</span><ins>+platform/network/TimingAllowOrigin.cpp
</ins><span class="cx"> platform/sql/SQLiteAuthorizer.cpp
</span><span class="cx"> platform/sql/SQLiteDatabase.cpp
</span><span class="cx"> platform/sql/SQLiteDatabaseTracker.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1996,6 +1996,7 @@
</span><span class="cx">          5CB37FFF1C62D2A100F20188 /* ScrollAnimatorMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB37FFD1C62D27800F20188 /* ScrollAnimatorMock.h */; };
</span><span class="cx">          5CBC8DAD1AAA302200E1C803 /* MediaAccessibilitySoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CBC8DAB1AAA302200E1C803 /* MediaAccessibilitySoftLink.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5CBD59592280E926002B22AA /* CustomHeaderFields.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D2386227A077C000B9BDA /* CustomHeaderFields.cpp */; };
</span><ins>+               5CC7900E266AFA89006924FE /* TimingAllowOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CC7900B266AFA88006924FE /* TimingAllowOrigin.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           5CCC270922D5483A00964FA0 /* AutofillElements.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CCC270622D53B6800964FA0 /* AutofillElements.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5CD9F5661AA0F73C00DA45FF /* DFABytecode.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C39305D1AA0F6A90029C816 /* DFABytecode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5CD9F5671AA0F74200DA45FF /* DFABytecodeCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C39305F1AA0F6A90029C816 /* DFABytecodeCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -9712,6 +9713,8 @@
</span><span class="cx">          5CB37FFD1C62D27800F20188 /* ScrollAnimatorMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimatorMock.h; sourceTree = "<group>"; };
</span><span class="cx">          5CBC8DAA1AAA302200E1C803 /* MediaAccessibilitySoftLink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaAccessibilitySoftLink.cpp; sourceTree = "<group>"; };
</span><span class="cx">          5CBC8DAB1AAA302200E1C803 /* MediaAccessibilitySoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaAccessibilitySoftLink.h; sourceTree = "<group>"; };
</span><ins>+               5CC7900B266AFA88006924FE /* TimingAllowOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimingAllowOrigin.h; sourceTree = "<group>"; };
+               5CC7900D266AFA89006924FE /* TimingAllowOrigin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimingAllowOrigin.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           5CCC270622D53B6800964FA0 /* AutofillElements.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutofillElements.h; sourceTree = "<group>"; };
</span><span class="cx">          5CCC270722D53B6900964FA0 /* AutofillElements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AutofillElements.cpp; sourceTree = "<group>"; };
</span><span class="cx">          5CDCDDBF23D7B7BE00BA34A1 /* ContentFilterClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentFilterClient.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -22257,6 +22260,8 @@
</span><span class="cx">                          4682D1FF1F79782300C863DB /* StoredCredentialsPolicy.h */,
</span><span class="cx">                          E180811016FCF42E00B80D07 /* SynchronousLoaderClient.cpp */,
</span><span class="cx">                          E180811516FCF9CB00B80D07 /* SynchronousLoaderClient.h */,
</span><ins>+                               5CC7900D266AFA89006924FE /* TimingAllowOrigin.cpp */,
+                               5CC7900B266AFA88006924FE /* TimingAllowOrigin.h */,
</ins><span class="cx">                   );
</span><span class="cx">                  path = network;
</span><span class="cx">                  sourceTree = "<group>";
</span><span class="lines">@@ -35797,6 +35802,7 @@
</span><span class="cx">                          9305B24D098F1B6B00C28855 /* Timer.h in Headers */,
</span><span class="cx">                          E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */,
</span><span class="cx">                          2D7ED0AB1BAE99170043B3E5 /* TimerEventBasedMock.h in Headers */,
</span><ins>+                               5CC7900E266AFA89006924FE /* TimingAllowOrigin.h in Headers */,
</ins><span class="cx">                           49E912AE0EFAC906009D0CAF /* TimingFunction.h in Headers */,
</span><span class="cx">                          0F54DD081881D5F5003EEDBB /* Touch.h in Headers */,
</span><span class="cx">                          71B7EE0D21B5C6870031C1EF /* TouchAction.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.cpp   2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> #include "ResourceHandle.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "SharedBuffer.h"
</span><ins>+#include "SubresourceLoader.h"
</ins><span class="cx"> #include <wtf/CompletionHandler.h>
</span><span class="cx"> #include <wtf/Ref.h>
</span><span class="cx"> 
</span><span class="lines">@@ -241,7 +242,15 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    m_handle = ResourceHandle::create(frameLoader()->networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent == ContentSniffingPolicy::SniffContent, m_options.sniffContentEncoding == ContentEncodingSniffingPolicy::Sniff);
</del><ins>+    RefPtr<SecurityOrigin> sourceOrigin = is<SubresourceLoader>(*this) ? downcast<SubresourceLoader>(*this).origin() : nullptr;
+    if (!sourceOrigin && frameLoader()) {
+        auto* document = frameLoader()->frame().document();
+        sourceOrigin =  document ? &document->securityOrigin() : nullptr;
+    }
+
+    bool isMainFrameNavigation = frame() && frame()->isMainFrame() && options().mode == FetchOptions::Mode::Navigate;
+
+    m_handle = ResourceHandle::create(frameLoader()->networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent == ContentSniffingPolicy::SniffContent, m_options.sniffContentEncoding == ContentEncodingSniffingPolicy::Sniff, WTFMove(sourceOrigin), isMainFrameNavigation);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceLoader::setDefersLoading(bool defers)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceTimingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceTiming.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceTiming.cpp   2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/loader/ResourceTiming.cpp      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -35,28 +35,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static bool passesTimingAllowCheck(const ResourceResponse& response, const SecurityOrigin& initiatorSecurityOrigin)
-{
-    Ref<SecurityOrigin> resourceOrigin = SecurityOrigin::create(response.url());
-    if (resourceOrigin->isSameSchemeHostPort(initiatorSecurityOrigin))
-        return true;
-
-    const String& timingAllowOriginString = response.httpHeaderField(HTTPHeaderName::TimingAllowOrigin);
-    if (timingAllowOriginString.isEmpty() || equalLettersIgnoringASCIICase(timingAllowOriginString, "null"))
-        return false;
-
-    if (timingAllowOriginString == "*")
-        return true;
-
-    const String& securityOrigin = initiatorSecurityOrigin.toString();
-    for (auto& origin : timingAllowOriginString.split(',')) {
-        if (origin.stripWhiteSpace() == securityOrigin)
-            return true;
-    }
-
-    return false;
-}
-
</del><span class="cx"> ResourceTiming ResourceTiming::fromMemoryCache(const URL& url, const String& initiator, const ResourceLoadTiming& loadTiming, const ResourceResponse& response, const SecurityOrigin& securityOrigin)
</span><span class="cx"> {
</span><span class="cx">     return ResourceTiming(url, initiator, loadTiming, response, securityOrigin);
</span><span class="lines">@@ -72,21 +50,19 @@
</span><span class="cx">     return ResourceTiming(url, initiator, loadTiming, networkLoadMetrics, response, securityOrigin);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ResourceTiming::ResourceTiming(const URL& url, const String& initiator, const ResourceLoadTiming& loadTiming, const ResourceResponse& response, const SecurityOrigin& securityOrigin)
</del><ins>+ResourceTiming::ResourceTiming(const URL& url, const String& initiator, const ResourceLoadTiming& loadTiming, const ResourceResponse& response, const SecurityOrigin&)
</ins><span class="cx">     : m_url(url)
</span><span class="cx">     , m_initiator(initiator)
</span><span class="cx">     , m_resourceLoadTiming(loadTiming)
</span><del>-    , m_allowTimingDetails(passesTimingAllowCheck(response, securityOrigin))
</del><span class="cx"> {
</span><span class="cx">     initServerTiming(response);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ResourceTiming::ResourceTiming(const URL& url, const String& initiator, const ResourceLoadTiming& timing, const NetworkLoadMetrics& networkLoadMetrics, const ResourceResponse& response, const SecurityOrigin& securityOrigin)
</del><ins>+ResourceTiming::ResourceTiming(const URL& url, const String& initiator, const ResourceLoadTiming& timing, const NetworkLoadMetrics& networkLoadMetrics, const ResourceResponse& response, const SecurityOrigin&)
</ins><span class="cx">     : m_url(url)
</span><span class="cx">     , m_initiator(initiator)
</span><span class="cx">     , m_resourceLoadTiming(timing)
</span><span class="cx">     , m_networkLoadMetrics(networkLoadMetrics)
</span><del>-    , m_allowTimingDetails(passesTimingAllowCheck(response, securityOrigin))
</del><span class="cx"> {
</span><span class="cx">     initServerTiming(response);
</span><span class="cx"> }
</span><span class="lines">@@ -93,7 +69,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ResourceTiming::initServerTiming(const ResourceResponse& response)
</span><span class="cx"> {
</span><del>-    if (RuntimeEnabledFeatures::sharedFeatures().serverTimingEnabled() && m_allowTimingDetails)
</del><ins>+    if (RuntimeEnabledFeatures::sharedFeatures().serverTimingEnabled() && !m_networkLoadMetrics.failsTAOCheck)
</ins><span class="cx">         m_serverTiming = ServerTimingParser::parseServerTiming(response.httpHeaderField(HTTPHeaderName::ServerTiming));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -111,7 +87,6 @@
</span><span class="cx">         m_initiator.isolatedCopy(),
</span><span class="cx">         m_resourceLoadTiming.isolatedCopy(),
</span><span class="cx">         m_networkLoadMetrics.isolatedCopy(),
</span><del>-        m_allowTimingDetails,
</del><span class="cx">         crossThreadCopy(m_serverTiming)
</span><span class="cx">     );
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceTimingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceTiming.h (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceTiming.h     2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/loader/ResourceTiming.h        2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -49,7 +49,6 @@
</span><span class="cx">     const String& initiator() const { return m_initiator; }
</span><span class="cx">     const ResourceLoadTiming& resourceLoadTiming() const { return m_resourceLoadTiming; }
</span><span class="cx">     const NetworkLoadMetrics& networkLoadMetrics() const { return m_networkLoadMetrics; }
</span><del>-    bool allowTimingDetails() const { return m_allowTimingDetails; }
</del><span class="cx">     Vector<Ref<PerformanceServerTiming>> populateServerTiming() const;
</span><span class="cx">     ResourceTiming isolatedCopy() const;
</span><span class="cx"> 
</span><span class="lines">@@ -58,12 +57,11 @@
</span><span class="cx"> private:
</span><span class="cx">     ResourceTiming(const URL&, const String& initiator, const ResourceLoadTiming&, const NetworkLoadMetrics&, const ResourceResponse&, const SecurityOrigin&);
</span><span class="cx">     ResourceTiming(const URL&, const String& initiator, const ResourceLoadTiming&, const ResourceResponse&, const SecurityOrigin&);
</span><del>-    ResourceTiming(URL&& url, String&& initiator, const ResourceLoadTiming& resourceLoadTiming, NetworkLoadMetrics&& networkLoadMetrics, bool allowTimingDetails, Vector<ServerTiming>&& serverTiming)
</del><ins>+    ResourceTiming(URL&& url, String&& initiator, const ResourceLoadTiming& resourceLoadTiming, NetworkLoadMetrics&& networkLoadMetrics, Vector<ServerTiming>&& serverTiming)
</ins><span class="cx">         : m_url(WTFMove(url))
</span><span class="cx">         , m_initiator(WTFMove(initiator))
</span><span class="cx">         , m_resourceLoadTiming(resourceLoadTiming)
</span><span class="cx">         , m_networkLoadMetrics(WTFMove(networkLoadMetrics))
</span><del>-        , m_allowTimingDetails(allowTimingDetails)
</del><span class="cx">         , m_serverTiming(WTFMove(serverTiming))
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="lines">@@ -73,7 +71,6 @@
</span><span class="cx">     String m_initiator;
</span><span class="cx">     ResourceLoadTiming m_resourceLoadTiming;
</span><span class="cx">     NetworkLoadMetrics m_networkLoadMetrics;
</span><del>-    bool m_allowTimingDetails { false };
</del><span class="cx">     Vector<ServerTiming> m_serverTiming;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceNavigationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceNavigation.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceNavigation.cpp      2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/page/PerformanceNavigation.cpp 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">     if (!metrics)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    if (metrics->hasCrossOriginRedirect)
</del><ins>+    if (metrics->failsTAOCheck)
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     return metrics->redirectCount;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceNavigationTimingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceNavigationTiming.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceNavigationTiming.cpp        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/page/PerformanceNavigationTiming.cpp   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -68,8 +68,7 @@
</span><span class="cx"> bool PerformanceNavigationTiming::sameOriginCheckFails() const
</span><span class="cx"> {
</span><span class="cx">     // https://www.w3.org/TR/navigation-timing-2/#dfn-same-origin-check
</span><del>-    return !m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect
</del><ins>+    return m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect
</ins><span class="cx">         || !m_documentLoadTiming.hasSameOriginAsPreviousDocument();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -124,9 +123,6 @@
</span><span class="cx"> 
</span><span class="cx"> unsigned short PerformanceNavigationTiming::redirectCount() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails())
-        return 0;
-
</del><span class="cx">     if (m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceResourceTimingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceResourceTiming.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceResourceTiming.cpp  2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/page/PerformanceResourceTiming.cpp     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -64,8 +64,7 @@
</span><span class="cx"> 
</span><span class="cx"> static double entryStartTime(MonotonicTime timeOrigin, const ResourceTiming& resourceTiming)
</span><span class="cx"> {
</span><del>-    if (!resourceTiming.allowTimingDetails()
-        || resourceTiming.networkLoadMetrics().hasCrossOriginRedirect
</del><ins>+    if (resourceTiming.networkLoadMetrics().failsTAOCheck
</ins><span class="cx">         || !resourceTiming.networkLoadMetrics().redirectCount)
</span><span class="cx">         return fetchStart(timeOrigin, resourceTiming);
</span><span class="cx"> 
</span><span class="lines">@@ -77,9 +76,6 @@
</span><span class="cx"> 
</span><span class="cx"> static double entryEndTime(MonotonicTime timeOrigin, const ResourceTiming& resourceTiming)
</span><span class="cx"> {
</span><del>-    if (!resourceTiming.allowTimingDetails())
-        return entryStartTime(timeOrigin, resourceTiming);
-
</del><span class="cx">     if (resourceTiming.networkLoadMetrics().responseEnd)
</span><span class="cx">         return networkLoadTimeToDOMHighResTimeStamp(timeOrigin, resourceTiming.networkLoadMetrics().responseEnd);
</span><span class="cx"> 
</span><span class="lines">@@ -114,8 +110,7 @@
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::redirectStart() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><span class="cx">     if (!m_resourceTiming.networkLoadMetrics().redirectCount)
</span><span class="lines">@@ -126,8 +121,7 @@
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::redirectEnd() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><span class="cx">     if (!m_resourceTiming.networkLoadMetrics().redirectCount)
</span><span class="lines">@@ -145,8 +139,7 @@
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::domainLookupStart() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><span class="cx">     if (!m_resourceTiming.networkLoadMetrics().domainLookupStart)
</span><span class="lines">@@ -157,8 +150,7 @@
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::domainLookupEnd() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><span class="cx">     if (!m_resourceTiming.networkLoadMetrics().domainLookupEnd)
</span><span class="lines">@@ -169,8 +161,7 @@
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::connectStart() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><span class="cx">     if (!m_resourceTiming.networkLoadMetrics().connectStart)
</span><span class="lines">@@ -181,8 +172,7 @@
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::connectEnd() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><span class="cx">     if (!m_resourceTiming.networkLoadMetrics().connectEnd)
</span><span class="lines">@@ -193,8 +183,7 @@
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::secureConnectionStart() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><span class="cx">     if (m_resourceTiming.networkLoadMetrics().secureConnectionStart == reusedTLSConnectionSentinel)
</span><span class="lines">@@ -208,8 +197,7 @@
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::requestStart() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><span class="cx">     // requestStart is 0 when a network request is not made.
</span><span class="lines">@@ -221,8 +209,7 @@
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::responseStart() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><span class="cx">     // responseStart is 0 when a network request is not made.
</span><span class="lines">@@ -258,8 +245,7 @@
</span><span class="cx"> 
</span><span class="cx"> uint64_t PerformanceResourceTiming::transferSize() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     auto encodedBodySize = m_resourceTiming.networkLoadMetrics().responseBodyBytesReceived;
</span><span class="lines">@@ -272,8 +258,7 @@
</span><span class="cx"> 
</span><span class="cx"> uint64_t PerformanceResourceTiming::encodedBodySize() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     auto encodedBodySize = m_resourceTiming.networkLoadMetrics().responseBodyBytesReceived;
</span><span class="lines">@@ -285,8 +270,7 @@
</span><span class="cx"> 
</span><span class="cx"> uint64_t PerformanceResourceTiming::decodedBodySize() const
</span><span class="cx"> {
</span><del>-    if (!m_resourceTiming.allowTimingDetails()
-        || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect)
</del><ins>+    if (m_resourceTiming.networkLoadMetrics().failsTAOCheck)
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     auto decodedBodySize = m_resourceTiming.networkLoadMetrics().responseBodyDecodedSize;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceTimingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceTiming.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceTiming.cpp  2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/page/PerformanceTiming.cpp     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">     if (!metrics)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    if (metrics->hasCrossOriginRedirect || !timing->hasSameOriginAsPreviousDocument())
</del><ins>+    if (metrics->failsTAOCheck || !timing->hasSameOriginAsPreviousDocument())
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     return monotonicTimeToIntegerMilliseconds(timing->unloadEventStart());
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx">     if (!metrics)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    if (metrics->hasCrossOriginRedirect || !timing->hasSameOriginAsPreviousDocument())
</del><ins>+    if (metrics->failsTAOCheck || !timing->hasSameOriginAsPreviousDocument())
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     return monotonicTimeToIntegerMilliseconds(timing->unloadEventEnd());
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> {
</span><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics
</span><del>-        || metrics->hasCrossOriginRedirect
</del><ins>+        || metrics->failsTAOCheck
</ins><span class="cx">         || !metrics->redirectCount)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx"> {
</span><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics
</span><del>-        || metrics->hasCrossOriginRedirect
</del><ins>+        || metrics->failsTAOCheck
</ins><span class="cx">         || !metrics->redirectCount)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp     2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp        2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include "ResourceHandleClient.h"
</span><span class="cx"> #include "ResourceRequest.h"
</span><span class="cx"> #include "ResourceResponse.h"
</span><ins>+#include "SecurityOrigin.h"
</ins><span class="cx"> #include "SharedBuffer.h"
</span><span class="cx"> #include <wtf/CompletionHandler.h>
</span><span class="cx"> #include <wtf/FileSystem.h>
</span><span class="lines">@@ -154,7 +155,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> BlobResourceHandle::BlobResourceHandle(BlobData* blobData, const ResourceRequest& request, ResourceHandleClient* client, bool async)
</span><del>-    : ResourceHandle { nullptr, request, client, false /* defersLoading */, false /* shouldContentSniff */, true /* shouldContentEncodingSniff */ }
</del><ins>+    : ResourceHandle { nullptr, request, client, false /* defersLoading */, false /* shouldContentSniff */, true /* shouldContentEncodingSniff */, nullptr /* sourceOrigin */, false /* isMainFrameNavigation */ }
</ins><span class="cx">     , m_blobData { blobData }
</span><span class="cx">     , m_async { async }
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkNetworkLoadMetricsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/NetworkLoadMetrics.h (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/NetworkLoadMetrics.h       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/NetworkLoadMetrics.h  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -89,6 +89,7 @@
</span><span class="cx">     bool constrained { false };
</span><span class="cx">     bool multipath { false };
</span><span class="cx">     bool isReusedConnection { false };
</span><ins>+    bool failsTAOCheck { false };
</ins><span class="cx">     bool hasCrossOriginRedirect { false };
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -122,6 +123,7 @@
</span><span class="cx">         copy.constrained = constrained;
</span><span class="cx">         copy.multipath = multipath;
</span><span class="cx">         copy.isReusedConnection = isReusedConnection;
</span><ins>+        copy.failsTAOCheck = failsTAOCheck;
</ins><span class="cx">         copy.hasCrossOriginRedirect = hasCrossOriginRedirect;
</span><span class="cx"> 
</span><span class="cx">         copy.remoteAddress = remoteAddress.isolatedCopy();
</span><span class="lines">@@ -159,6 +161,7 @@
</span><span class="cx">             && constrained == other.constrained
</span><span class="cx">             && multipath == other.multipath
</span><span class="cx">             && isReusedConnection == other.isReusedConnection
</span><ins>+            && failsTAOCheck == other.failsTAOCheck
</ins><span class="cx">             && hasCrossOriginRedirect == other.hasCrossOriginRedirect
</span><span class="cx">             && protocol == other.protocol
</span><span class="cx">             && redirectCount == other.redirectCount
</span><span class="lines">@@ -204,7 +207,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> Box<NetworkLoadMetrics> copyTimingData(NSURLConnection *, const ResourceHandle&);
</span><del>-WEBCORE_EXPORT Box<NetworkLoadMetrics> copyTimingData(NSURLSessionTaskMetrics *incompleteMetrics, bool hasCrossOriginRedirect);
</del><ins>+WEBCORE_EXPORT Box<NetworkLoadMetrics> copyTimingData(NSURLSessionTaskMetrics *incompleteMetrics, const NetworkLoadMetrics&);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> template<class Encoder>
</span><span class="lines">@@ -228,6 +231,7 @@
</span><span class="cx">     encoder << constrained;
</span><span class="cx">     encoder << multipath;
</span><span class="cx">     encoder << isReusedConnection;
</span><ins>+    encoder << failsTAOCheck;
</ins><span class="cx">     encoder << hasCrossOriginRedirect;
</span><span class="cx">     encoder << protocol;
</span><span class="cx">     encoder << redirectCount;
</span><span class="lines">@@ -266,6 +270,7 @@
</span><span class="cx">         && decoder.decode(metrics.constrained)
</span><span class="cx">         && decoder.decode(metrics.multipath)
</span><span class="cx">         && decoder.decode(metrics.isReusedConnection)
</span><ins>+        && decoder.decode(metrics.failsTAOCheck)
</ins><span class="cx">         && decoder.decode(metrics.hasCrossOriginRedirect)
</span><span class="cx">         && decoder.decode(metrics.protocol)
</span><span class="cx">         && decoder.decode(metrics.redirectCount)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandle.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandle.cpp 2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.cpp    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -31,7 +31,9 @@
</span><span class="cx"> #include "NetworkingContext.h"
</span><span class="cx"> #include "NotImplemented.h"
</span><span class="cx"> #include "ResourceHandleClient.h"
</span><ins>+#include "SecurityOrigin.h"
</ins><span class="cx"> #include "Timer.h"
</span><ins>+#include "TimingAllowOrigin.h"
</ins><span class="cx"> #include <algorithm>
</span><span class="cx"> #include <wtf/CompletionHandler.h>
</span><span class="cx"> #include <wtf/MainThread.h>
</span><span class="lines">@@ -75,8 +77,8 @@
</span><span class="cx">     builtinResourceHandleSynchronousLoaderMap().add(protocol, loader);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ResourceHandle::ResourceHandle(NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff)
-    : d(makeUnique<ResourceHandleInternal>(this, context, request, client, defersLoading, shouldContentSniff && shouldContentSniffURL(request.url()), shouldContentEncodingSniff))
</del><ins>+ResourceHandle::ResourceHandle(NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation)
+    : d(makeUnique<ResourceHandleInternal>(this, context, request, client, defersLoading, shouldContentSniff && shouldContentSniffURL(request.url()), shouldContentEncodingSniff, WTFMove(sourceOrigin), isMainFrameNavigation))
</ins><span class="cx"> {
</span><span class="cx">     if (!request.url().isValid()) {
</span><span class="cx">         scheduleFailure(InvalidURLFailure);
</span><span class="lines">@@ -89,12 +91,12 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<ResourceHandle> ResourceHandle::create(NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff)
</del><ins>+RefPtr<ResourceHandle> ResourceHandle::create(NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation)
</ins><span class="cx"> {
</span><span class="cx">     if (auto constructor = builtinResourceHandleConstructorMap().get(request.url().protocol().toStringWithoutCopying()))
</span><span class="cx">         return constructor(request, client);
</span><span class="cx"> 
</span><del>-    auto newHandle = adoptRef(*new ResourceHandle(context, request, client, defersLoading, shouldContentSniff, shouldContentEncodingSniff));
</del><ins>+    auto newHandle = adoptRef(*new ResourceHandle(context, request, client, defersLoading, shouldContentSniff, shouldContentEncodingSniff, WTFMove(sourceOrigin), isMainFrameNavigation));
</ins><span class="cx"> 
</span><span class="cx">     if (newHandle->d->m_scheduledFailureType != NoFailure)
</span><span class="cx">         return newHandle;
</span><span class="lines">@@ -133,7 +135,7 @@
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentialsPolicy storedCredentialsPolicy, ResourceError& error, ResourceResponse& response, Vector<uint8_t>& data)
</del><ins>+void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentialsPolicy storedCredentialsPolicy, SecurityOrigin* sourceOrigin, ResourceError& error, ResourceResponse& response, Vector<uint8_t>& data)
</ins><span class="cx"> {
</span><span class="cx">     if (auto constructor = builtinResourceHandleSynchronousLoaderMap().get(request.url().protocol().toStringWithoutCopying())) {
</span><span class="cx">         constructor(context, request, storedCredentialsPolicy, error, response, data);
</span><span class="lines">@@ -140,7 +142,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    platformLoadResourceSynchronously(context, request, storedCredentialsPolicy, error, response, data);
</del><ins>+    platformLoadResourceSynchronously(context, request, storedCredentialsPolicy, sourceOrigin, error, response, data);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ResourceHandleClient* ResourceHandle::client() const
</span><span class="lines">@@ -204,14 +206,34 @@
</span><span class="cx">     d->m_currentWebChallenge.nullify();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ResourceHandle::failsTAOCheck() const
+{
+    return d->m_failsTAOCheck;
+}
+
+void ResourceHandle::checkTAO(const ResourceResponse& response)
+{
+    if (d->m_failsTAOCheck)
+        return;
+
+    RefPtr<SecurityOrigin> origin;
+    if (d->m_isMainFrameNavigation)
+        origin = SecurityOrigin::create(firstRequest().url());
+    else
+        origin = d->m_sourceOrigin;
+
+    if (origin)
+        d->m_failsTAOCheck = !passesTimingAllowOriginCheck(response, *origin);
+}
+
</ins><span class="cx"> bool ResourceHandle::hasCrossOriginRedirect() const
</span><span class="cx"> {
</span><span class="cx">     return d->m_hasCrossOriginRedirect;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ResourceHandle::setHasCrossOriginRedirect(bool value)
</del><ins>+void ResourceHandle::markAsHavingCrossOriginRedirect()
</ins><span class="cx"> {
</span><del>-    d->m_hasCrossOriginRedirect = value;
</del><ins>+    d->m_hasCrossOriginRedirect = true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceHandle::incrementRedirectCount()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandle.h (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandle.h   2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.h      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx"> class NetworkLoadMetrics;
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> class ResourceResponse;
</span><ins>+class SecurityOrigin;
</ins><span class="cx"> class SharedBuffer;
</span><span class="cx"> class SynchronousLoaderMessageQueue;
</span><span class="cx"> class Timer;
</span><span class="lines">@@ -94,8 +95,8 @@
</span><span class="cx"> 
</span><span class="cx"> class ResourceHandle : public RefCounted<ResourceHandle>, public AuthenticationClient {
</span><span class="cx"> public:
</span><del>-    WEBCORE_EXPORT static RefPtr<ResourceHandle> create(NetworkingContext*, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff);
-    WEBCORE_EXPORT static void loadResourceSynchronously(NetworkingContext*, const ResourceRequest&, StoredCredentialsPolicy, ResourceError&, ResourceResponse&, Vector<uint8_t>& data);
</del><ins>+    WEBCORE_EXPORT static RefPtr<ResourceHandle> create(NetworkingContext*, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation);
+    WEBCORE_EXPORT static void loadResourceSynchronously(NetworkingContext*, const ResourceRequest&, StoredCredentialsPolicy, SecurityOrigin*, ResourceError&, ResourceResponse&, Vector<uint8_t>& data);
</ins><span class="cx">     WEBCORE_EXPORT virtual ~ResourceHandle();
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA) || USE(CFURLCONNECTION)
</span><span class="lines">@@ -174,8 +175,10 @@
</span><span class="cx">     void setNetworkLoadMetrics(Box<NetworkLoadMetrics>&&);
</span><span class="cx"> 
</span><span class="cx">     MonotonicTime startTimeBeforeRedirects() const;
</span><ins>+    bool failsTAOCheck() const;
+    void checkTAO(const ResourceResponse&);
</ins><span class="cx">     bool hasCrossOriginRedirect() const;
</span><del>-    void setHasCrossOriginRedirect(bool);
</del><ins>+    void markAsHavingCrossOriginRedirect();
</ins><span class="cx">     uint16_t redirectCount() const;
</span><span class="cx">     void incrementRedirectCount();
</span><span class="cx"> 
</span><span class="lines">@@ -206,7 +209,7 @@
</span><span class="cx">     static void registerBuiltinSynchronousLoader(const AtomString& protocol, BuiltinSynchronousLoader);
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    ResourceHandle(NetworkingContext*, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff);
</del><ins>+    ResourceHandle(NetworkingContext*, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     enum FailureType {
</span><span class="lines">@@ -222,7 +225,7 @@
</span><span class="cx">     void scheduleFailure(FailureType);
</span><span class="cx"> 
</span><span class="cx">     bool start();
</span><del>-    static void platformLoadResourceSynchronously(NetworkingContext*, const ResourceRequest&, StoredCredentialsPolicy, ResourceError&, ResourceResponse&, Vector<uint8_t>& data);
</del><ins>+    static void platformLoadResourceSynchronously(NetworkingContext*, const ResourceRequest&, StoredCredentialsPolicy, SecurityOrigin*, ResourceError&, ResourceResponse&, Vector<uint8_t>& data);
</ins><span class="cx"> 
</span><span class="cx">     void refAuthenticationClient() override { ref(); }
</span><span class="cx">     void derefAuthenticationClient() override { deref(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandleInternal.h (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandleInternal.h   2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/ResourceHandleInternal.h      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(ResourceHandleInternal);
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(ResourceHandleInternal);
</span><span class="cx"> public:
</span><del>-    ResourceHandleInternal(ResourceHandle* loader, NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff)
</del><ins>+    ResourceHandleInternal(ResourceHandle* loader, NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation)
</ins><span class="cx">         : m_context(context)
</span><span class="cx">         , m_client(client)
</span><span class="cx">         , m_firstRequest(request)
</span><span class="lines">@@ -78,6 +78,8 @@
</span><span class="cx">         , m_currentRequest(request)
</span><span class="cx"> #endif
</span><span class="cx">         , m_failureTimer(*loader, &ResourceHandle::failureTimerFired)
</span><ins>+        , m_sourceOrigin(WTFMove(sourceOrigin))
+        , m_isMainFrameNavigation(isMainFrameNavigation)
</ins><span class="cx">     {
</span><span class="cx">         const URL& url = m_firstRequest.url();
</span><span class="cx">         m_user = url.user();
</span><span class="lines">@@ -133,7 +135,9 @@
</span><span class="cx">     Box<NetworkLoadMetrics> m_networkLoadMetrics;
</span><span class="cx">     MonotonicTime m_startTime;
</span><span class="cx">     uint16_t m_redirectCount { 0 };
</span><ins>+    bool m_failsTAOCheck { false };
</ins><span class="cx">     bool m_hasCrossOriginRedirect { false };
</span><ins>+    bool m_isCrossOrigin { false };
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     // We need to keep a reference to the original challenge to be able to cancel it.
</span><span class="lines">@@ -144,6 +148,8 @@
</span><span class="cx">     AuthenticationChallenge m_currentWebChallenge;
</span><span class="cx">     ResourceHandle::FailureType m_scheduledFailureType { ResourceHandle::NoFailure };
</span><span class="cx">     Timer m_failureTimer;
</span><ins>+    RefPtr<SecurityOrigin> m_sourceOrigin;
+    bool m_isMainFrameNavigation { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkTimingAllowOrigincpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/TimingAllowOrigin.cpp (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/TimingAllowOrigin.cpp                              (rev 0)
+++ trunk/Source/WebCore/platform/network/TimingAllowOrigin.cpp 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TimingAllowOrigin.h"
+
+#include "HTTPParsers.h"
+#include "ResourceResponse.h"
+#include "SecurityOrigin.h"
+
+namespace WebCore {
+
+bool passesTimingAllowOriginCheck(const ResourceResponse& response, const SecurityOrigin& initiatorSecurityOrigin)
+{
+    // https://fetch.spec.whatwg.org/#tao-check
+    auto resourceOrigin = SecurityOrigin::create(response.url());
+    if (resourceOrigin->isSameSchemeHostPort(initiatorSecurityOrigin))
+        return true;
+
+    const auto& timingAllowOriginString = response.httpHeaderField(HTTPHeaderName::TimingAllowOrigin);
+    const auto& securityOrigin = initiatorSecurityOrigin.toString();
+    for (auto originWithSpace : StringView(timingAllowOriginString).split(',')) {
+        auto origin = stripLeadingAndTrailingHTTPSpaces(originWithSpace);
+        if (origin == "*" || origin == securityOrigin)
+            return true;
+    }
+
+    return false;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkTimingAllowOriginh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/TimingAllowOrigin.h (0 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/TimingAllowOrigin.h                                (rev 0)
+++ trunk/Source/WebCore/platform/network/TimingAllowOrigin.h   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+class ResourceResponse;
+class SecurityOrigin;
+
+WEBCORE_EXPORT bool passesTimingAllowOriginCheck(const ResourceResponse&, const SecurityOrigin& initiatorSecurityOrigin);
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfResourceHandleCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp 2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -522,7 +522,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ResourceHandle::platformLoadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentialsPolicy storedCredentialsPolicy, ResourceError& error, ResourceResponse& response, Vector<uint8_t>& data)
</del><ins>+void ResourceHandle::platformLoadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentialsPolicy storedCredentialsPolicy, SecurityOrigin* sourceOrigin, ResourceError& error, ResourceResponse& response, Vector<uint8_t>& data)
</ins><span class="cx"> {
</span><span class="cx">     LOG(Network, "ResourceHandle::platformLoadResourceSynchronously:%s sstoredCredentialsPolicy:%u", request.url().string().utf8().data(), static_cast<unsigned>(storedCredentialsPolicy));
</span><span class="cx"> 
</span><span class="lines">@@ -537,7 +537,7 @@
</span><span class="cx">     bool defersLoading = false;
</span><span class="cx">     bool shouldContentSniff = true;
</span><span class="cx">     bool shouldContentEncodingSniff = true;
</span><del>-    RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(context, request, &client, defersLoading, shouldContentSniff, shouldContentEncodingSniff));
</del><ins>+    RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(context, request, &client, defersLoading, shouldContentSniff, shouldContentEncodingSniff, sourceOrigin, false /* isMainFrameNavigation */ ));
</ins><span class="cx"> 
</span><span class="cx">     handle->d->m_storageSession = context->storageSession()->platformSession();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcocoaNetworkLoadMetricsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cocoa/NetworkLoadMetrics.mm (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cocoa/NetworkLoadMetrics.mm        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/cocoa/NetworkLoadMetrics.mm   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Box<NetworkLoadMetrics> packageTimingData(MonotonicTime redirectStart, NSDate *fetchStart, NSDate *domainLookupStart, NSDate *domainLookupEnd, NSDate *connectStart, NSDate *secureConnectionStart, NSDate *connectEnd, NSDate *requestStart, NSDate *responseStart, bool reusedTLSConnection, NSString *protocol, uint16_t redirectCount, bool hasCrossOriginRedirect)
</del><ins>+static Box<NetworkLoadMetrics> packageTimingData(MonotonicTime redirectStart, NSDate *fetchStart, NSDate *domainLookupStart, NSDate *domainLookupEnd, NSDate *connectStart, NSDate *secureConnectionStart, NSDate *connectEnd, NSDate *requestStart, NSDate *responseStart, bool reusedTLSConnection, NSString *protocol, uint16_t redirectCount, bool failsTAOCheck, bool hasCrossOriginRedirect)
</ins><span class="cx"> {
</span><span class="cx"> 
</span><span class="cx">     auto timing = Box<NetworkLoadMetrics>::create();
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx">     timing->requestStart = dateToMonotonicTime(requestStart);
</span><span class="cx">     timing->responseStart = dateToMonotonicTime(responseStart);
</span><span class="cx">     timing->redirectCount = redirectCount;
</span><ins>+    timing->failsTAOCheck = failsTAOCheck;
</ins><span class="cx">     timing->hasCrossOriginRedirect = hasCrossOriginRedirect;
</span><span class="cx"> 
</span><span class="cx">     // NOTE: responseEnd is not populated in this code path.
</span><span class="lines">@@ -63,7 +64,7 @@
</span><span class="cx">     return timing;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Box<NetworkLoadMetrics> copyTimingData(NSURLSessionTaskMetrics *incompleteMetrics, bool hasCrossOriginRedirect)
</del><ins>+Box<NetworkLoadMetrics> copyTimingData(NSURLSessionTaskMetrics *incompleteMetrics, const NetworkLoadMetrics& metricsFromTask)
</ins><span class="cx"> {
</span><span class="cx">     NSArray<NSURLSessionTaskTransactionMetrics *> *transactionMetrics = incompleteMetrics.transactionMetrics;
</span><span class="cx">     NSURLSessionTaskTransactionMetrics *metrics = transactionMetrics.lastObject;
</span><span class="lines">@@ -80,7 +81,8 @@
</span><span class="cx">         metrics.reusedConnection,
</span><span class="cx">         metrics.response.URL.scheme,
</span><span class="cx">         incompleteMetrics.redirectCount,
</span><del>-        hasCrossOriginRedirect
</del><ins>+        metricsFromTask.failsTAOCheck,
+        metricsFromTask.hasCrossOriginRedirect
</ins><span class="cx">     );
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -109,6 +111,7 @@
</span><span class="cx">         timingValue(@"_kCFNTimingDataConnectionReused").get(),
</span><span class="cx">         connection.currentRequest.URL.scheme,
</span><span class="cx">         handle.redirectCount(),
</span><ins>+        handle.failsTAOCheck(),
</ins><span class="cx">         handle.hasCrossOriginRedirect()
</span><span class="cx">     );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlCurlCacheEntrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp    2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include "ResourceHandleInternal.h"
</span><span class="cx"> #include "ResourceRequest.h"
</span><span class="cx"> #include "ResourceResponse.h"
</span><ins>+#include "SecurityOrigin.h"
</ins><span class="cx"> #include "SharedBuffer.h"
</span><span class="cx"> #include <wtf/DateMath.h>
</span><span class="cx"> #include <wtf/HexNumber.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlCurlCacheManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/CurlCacheManager.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/CurlCacheManager.cpp  2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/curl/CurlCacheManager.cpp     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "ResourceHandleClient.h"
</span><span class="cx"> #include "ResourceHandleInternal.h"
</span><span class="cx"> #include "ResourceRequest.h"
</span><ins>+#include "SecurityOrigin.h"
</ins><span class="cx"> #include <wtf/FileSystem.h>
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlCurlResourceHandleDelegatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/CurlResourceHandleDelegate.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/CurlResourceHandleDelegate.cpp        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/curl/CurlResourceHandleDelegate.cpp   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "ResourceHandle.h"
</span><span class="cx"> #include "ResourceHandleClient.h"
</span><span class="cx"> #include "ResourceHandleInternal.h"
</span><ins>+#include "SecurityOrigin.h"
</ins><span class="cx"> 
</span><span class="cx"> #include <wtf/CompletionHandler.h>
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlResourceHandleCurlcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> #include "NetworkStorageSession.h"
</span><span class="cx"> #include "ResourceHandleInternal.h"
</span><span class="cx"> #include "SameSiteInfo.h"
</span><ins>+#include "SecurityOrigin.h"
</ins><span class="cx"> #include "SharedBuffer.h"
</span><span class="cx"> #include "SynchronousLoaderClient.h"
</span><span class="cx"> #include "TextEncoding.h"
</span><span class="lines">@@ -365,7 +366,7 @@
</span><span class="cx">     d->m_curlRequest->start();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ResourceHandle::platformLoadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentialsPolicy storedCredentialsPolicy, ResourceError& error, ResourceResponse& response, Vector<uint8_t>& data)
</del><ins>+void ResourceHandle::platformLoadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentialsPolicy storedCredentialsPolicy, SecurityOrigin*, ResourceError& error, ResourceResponse& response, Vector<uint8_t>& data)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx">     ASSERT(!request.isEmpty());
</span><span class="lines">@@ -376,7 +377,7 @@
</span><span class="cx">     bool defersLoading = false;
</span><span class="cx">     bool shouldContentSniff = true;
</span><span class="cx">     bool shouldContentEncodingSniff = true;
</span><del>-    RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(context, request, &client, defersLoading, shouldContentSniff, shouldContentEncodingSniff));
</del><ins>+    RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(context, request, &client, defersLoading, shouldContentSniff, shouldContentEncodingSniff, nullptr, false));
</ins><span class="cx">     handle->d->m_messageQueue = &client.messageQueue();
</span><span class="cx"> 
</span><span class="cx">     if (request.url().protocolIsData()) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlSynchronousLoaderClientCurlcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/SynchronousLoaderClientCurl.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/SynchronousLoaderClientCurl.cpp       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/curl/SynchronousLoaderClientCurl.cpp  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "AuthenticationChallenge.h"
</span><span class="cx"> #include "NotImplemented.h"
</span><span class="cx"> #include "ResourceHandleInternal.h"
</span><ins>+#include "SecurityOrigin.h"
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm   2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm      2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -351,7 +351,7 @@
</span><span class="cx">     return CFSTR("WebCoreSynchronousLoaderRunLoopMode");
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ResourceHandle::platformLoadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentialsPolicy storedCredentialsPolicy, ResourceError& error, ResourceResponse& response, Vector<uint8_t>& data)
</del><ins>+void ResourceHandle::platformLoadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentialsPolicy storedCredentialsPolicy, SecurityOrigin* sourceOrigin, ResourceError& error, ResourceResponse& response, Vector<uint8_t>& data)
</ins><span class="cx"> {
</span><span class="cx">     LOG(Network, "ResourceHandle::platformLoadResourceSynchronously:%@ storedCredentialsPolicy:%u", request.nsURLRequest(HTTPBodyUpdatePolicy::DoNotUpdateHTTPBody), static_cast<unsigned>(storedCredentialsPolicy));
</span><span class="cx"> 
</span><span class="lines">@@ -363,7 +363,7 @@
</span><span class="cx">     bool defersLoading = false;
</span><span class="cx">     bool shouldContentSniff = true;
</span><span class="cx">     bool shouldContentEncodingSniff = true;
</span><del>-    RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(context, request, &client, defersLoading, shouldContentSniff, shouldContentEncodingSniff));
</del><ins>+    RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(context, request, &client, defersLoading, shouldContentSniff, shouldContentEncodingSniff, sourceOrigin, false));
</ins><span class="cx"> 
</span><span class="cx">     handle->d->m_storageSession = context->storageSession()->platformSession();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacWebCoreResourceHandleAsOperationQueueDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -141,6 +141,7 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        ResourceResponse response(redirectResponse.get());
</ins><span class="cx">         ResourceRequest redirectRequest = newRequest.get();
</span><span class="cx">         if ([newRequest.get() HTTPBodyStream]) {
</span><span class="cx">             ASSERT(m_handle->firstRequest().httpBody());
</span><span class="lines">@@ -150,10 +151,13 @@
</span><span class="cx">             redirectRequest.clearHTTPContentType();
</span><span class="cx"> 
</span><span class="cx">         // Check if the redirected url is allowed to access the redirecting url's timing information.
</span><del>-        m_handle->setHasCrossOriginRedirect(!WebCore::SecurityOrigin::create(redirectRequest.url())->canRequest(redirectResponse.get().URL));
</del><ins>+        if (!m_handle->hasCrossOriginRedirect() && !WebCore::SecurityOrigin::create(redirectRequest.url())->canRequest(redirectResponse.get().URL))
+            m_handle->markAsHavingCrossOriginRedirect();
+        m_handle->checkTAO(response);
+
</ins><span class="cx">         m_handle->incrementRedirectCount();
</span><span class="cx"> 
</span><del>-        m_handle->willSendRequest(WTFMove(redirectRequest), redirectResponse.get(), [self, protectedSelf = WTFMove(protectedSelf)](ResourceRequest&& request) {
</del><ins>+        m_handle->willSendRequest(WTFMove(redirectRequest), WTFMove(response), [self, protectedSelf = WTFMove(protectedSelf)](ResourceRequest&& request) {
</ins><span class="cx">             m_requestResult = request.nsURLRequest(HTTPBodyUpdatePolicy::UpdateHTTPBody);
</span><span class="cx">             m_semaphore.signal();
</span><span class="cx">         });
</span><span class="lines">@@ -257,8 +261,10 @@
</span><span class="cx">         if ([m_handle->firstRequest().nsURLRequest(HTTPBodyUpdatePolicy::DoNotUpdateHTTPBody) _propertyForKey:@"ForceHTMLMIMEType"])
</span><span class="cx">             [r _setMIMEType:@"text/html"];
</span><span class="cx"> 
</span><ins>+        ResourceResponse resourceResponse(r.get());
+        m_handle->checkTAO(resourceResponse);
+
</ins><span class="cx">         auto metrics = copyTimingData(connection.get(), *m_handle);
</span><del>-        ResourceResponse resourceResponse(r.get());
</del><span class="cx">         resourceResponse.setSource(ResourceResponse::Source::Network);
</span><span class="cx">         resourceResponse.setDeprecatedNetworkLoadMetrics(Box<NetworkLoadMetrics> { metrics });
</span><span class="cx"> 
</span><span class="lines">@@ -333,6 +339,7 @@
</span><span class="cx">                 metrics->responseEnd = WallTime::fromRawSeconds(adoptNS([[NSDate alloc] initWithTimeIntervalSinceReferenceDate:responseEndTime]).get().timeIntervalSince1970).approximateMonotonicTime();
</span><span class="cx">             else
</span><span class="cx">                 metrics->responseEnd = metrics->responseStart;
</span><ins>+            metrics->protocol = (NSString *)[timingData objectForKey:@"_kCFNTimingDataNetworkProtocolName"];
</ins><span class="cx">             metrics->responseBodyBytesReceived = [[timingData objectForKey:@"_kCFNTimingDataResponseBodyBytesReceived"] unsignedLongLongValue];
</span><span class="cx">             metrics->responseBodyDecodedSize = [[timingData objectForKey:@"_kCFNTimingDataResponseBodyBytesDecoded"] unsignedLongLongValue];
</span><span class="cx">             metrics->markComplete();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworksoupCredentialStorageSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/soup/CredentialStorageSoup.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/soup/CredentialStorageSoup.cpp     2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/soup/CredentialStorageSoup.cpp        2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if USE(SOUP)
</span><span class="cx"> 
</span><span class="cx"> #include "Credential.h"
</span><ins>+#include "SecurityOrigin.h"
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworksoupResourceHandleSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp        2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp   2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ResourceHandle::platformLoadResourceSynchronously(NetworkingContext*, const ResourceRequest&, StoredCredentialsPolicy, ResourceError&, ResourceResponse&, Vector<uint8_t>&)
</del><ins>+void ResourceHandle::platformLoadResourceSynchronously(NetworkingContext*, const ResourceRequest&, StoredCredentialsPolicy, SecurityOrigin*, ResourceError&, ResourceResponse&, Vector<uint8_t>&)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebKit/ChangeLog       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,5 +1,29 @@
</span><span class="cx"> 2021-06-10  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><ins>+        Move Timing-Allow-Origin checks to the network process
+        https://bugs.webkit.org/show_bug.cgi?id=226678
+        <rdar://problem/45227788>
+
+        Reviewed by Chris Dumez.
+
+        * NetworkProcess/NetworkLoadParameters.h:
+        * NetworkProcess/NetworkResourceLoadParameters.h:
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::sendReplyToSynchronousRequest):
+        Pass complete metrics with sync xhr responses.  Many of the tests use sync xhr.
+        (WebKit::NetworkResourceLoader::didFinishLoading):
+        (WebKit::NetworkResourceLoader::didFailLoading):
+        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
+        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
+        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
+        (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
+
+2021-06-10  Alex Christensen  <achristensen@webkit.org>
+
</ins><span class="cx">         Origin is null in http requests when baseURL has custom scheme on iOS 15.0
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=226760
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkLoadParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkLoadParameters.h (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkLoadParameters.h       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebKit/NetworkProcess/NetworkLoadParameters.h  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx">     WebCore::PageIdentifier webPageID;
</span><span class="cx">     WebCore::FrameIdentifier webFrameID;
</span><span class="cx">     RefPtr<WebCore::SecurityOrigin> topOrigin;
</span><ins>+    RefPtr<WebCore::SecurityOrigin> sourceOrigin;
</ins><span class="cx">     WTF::ProcessID parentPID { 0 };
</span><span class="cx"> #if HAVE(AUDIT_TOKEN)
</span><span class="cx">     std::optional<audit_token_t> networkProcessAuditToken;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkResourceLoadParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h       2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h  2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -52,7 +52,6 @@
</span><span class="cx">     Vector<RefPtr<SandboxExtension>> requestBodySandboxExtensions; // Created automatically for the sender.
</span><span class="cx">     RefPtr<SandboxExtension> resourceSandboxExtension; // Created automatically for the sender.
</span><span class="cx">     Seconds maximumBufferingTime;
</span><del>-    RefPtr<WebCore::SecurityOrigin> sourceOrigin;
</del><span class="cx">     WebCore::FetchOptions options;
</span><span class="cx">     std::optional<WebCore::ContentSecurityPolicyResponseHeaders> cspResponseHeaders;
</span><span class="cx">     WebCore::HTTPHeaderMap originalRequestHeaders;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp     2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp        2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">     ResourceError error;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static void sendReplyToSynchronousRequest(NetworkResourceLoader::SynchronousLoadData& data, const SharedBuffer* buffer)
</del><ins>+static void sendReplyToSynchronousRequest(NetworkResourceLoader::SynchronousLoadData& data, const SharedBuffer* buffer, const NetworkLoadMetrics& metrics)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(data.delayedReply);
</span><span class="cx">     ASSERT(!data.response.isNull() || !data.error.isNull());
</span><span class="lines">@@ -95,6 +95,8 @@
</span><span class="cx">     if (buffer && buffer->size())
</span><span class="cx">         responseBuffer.append(buffer->data(), buffer->size());
</span><span class="cx"> 
</span><ins>+    data.response.setDeprecatedNetworkLoadMetrics(Box<NetworkLoadMetrics>::create(metrics));
+
</ins><span class="cx">     data.delayedReply(data.error, data.response, responseBuffer);
</span><span class="cx">     data.delayedReply = nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -728,7 +730,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (isSynchronous())
</span><del>-        sendReplyToSynchronousRequest(*m_synchronousLoadData, m_bufferedData.get());
</del><ins>+        sendReplyToSynchronousRequest(*m_synchronousLoadData, m_bufferedData.get(), networkLoadMetrics);
</ins><span class="cx">     else {
</span><span class="cx">         if (m_bufferedData && !m_bufferedData->isEmpty()) {
</span><span class="cx">             // FIXME: Pass a real value or remove the encoded data size feature.
</span><span class="lines">@@ -763,7 +765,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (isSynchronous()) {
</span><span class="cx">         m_synchronousLoadData->error = error;
</span><del>-        sendReplyToSynchronousRequest(*m_synchronousLoadData, nullptr);
</del><ins>+        sendReplyToSynchronousRequest(*m_synchronousLoadData, nullptr, { });
</ins><span class="cx">     } else if (auto* connection = messageSenderConnection()) {
</span><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">         if (m_serviceWorkerFetchTask)
</span><span class="lines">@@ -1142,7 +1144,7 @@
</span><span class="cx">     response = sanitizeResponseIfPossible(WTFMove(response), ResourceResponse::SanitizationType::CrossOriginSafe);
</span><span class="cx">     if (isSynchronous()) {
</span><span class="cx">         m_synchronousLoadData->response = WTFMove(response);
</span><del>-        sendReplyToSynchronousRequest(*m_synchronousLoadData, entry->buffer());
</del><ins>+        sendReplyToSynchronousRequest(*m_synchronousLoadData, entry->buffer(), { });
</ins><span class="cx">         cleanup(LoadResult::Success);
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscocoaNetworkDataTaskCocoah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h  2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -84,6 +84,8 @@
</span><span class="cx">     void setH2PingCallback(const URL&, CompletionHandler<void(Expected<WTF::Seconds, WebCore::ResourceError>&&)>&&) override;
</span><span class="cx">     void setPriority(WebCore::ResourceLoadPriority) override;
</span><span class="cx"> 
</span><ins>+    void checkTAO(const WebCore::ResourceResponse&);
+
</ins><span class="cx"> private:
</span><span class="cx">     NetworkDataTaskCocoa(NetworkSession&, NetworkDataTaskClient&, const NetworkLoadParameters&);
</span><span class="cx"> 
</span><span class="lines">@@ -120,6 +122,7 @@
</span><span class="cx">     bool m_isForMainResourceNavigationForAnyFrame { false };
</span><span class="cx">     bool m_isAlwaysOnLoggingAllowed { false };
</span><span class="cx">     WebCore::ShouldRelaxThirdPartyCookieBlocking m_shouldRelaxThirdPartyCookieBlocking { WebCore::ShouldRelaxThirdPartyCookieBlocking::No };
</span><ins>+    RefPtr<WebCore::SecurityOrigin> m_sourceOrigin;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebCore::Credential serverTrustCredential(const WebCore::AuthenticationChallenge&);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscocoaNetworkDataTaskCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm 2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm    2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #import <WebCore/NotImplemented.h>
</span><span class="cx"> #import <WebCore/RegistrableDomain.h>
</span><span class="cx"> #import <WebCore/ResourceRequest.h>
</span><ins>+#import <WebCore/TimingAllowOrigin.h>
</ins><span class="cx"> #import <pal/spi/cf/CFNetworkSPI.h>
</span><span class="cx"> #import <wtf/BlockPtr.h>
</span><span class="cx"> #import <wtf/FileSystem.h>
</span><span class="lines">@@ -300,6 +301,7 @@
</span><span class="cx">     , m_isForMainResourceNavigationForAnyFrame(parameters.isMainResourceNavigationForAnyFrame)
</span><span class="cx">     , m_isAlwaysOnLoggingAllowed(computeIsAlwaysOnLoggingAllowed(session))
</span><span class="cx">     , m_shouldRelaxThirdPartyCookieBlocking(parameters.shouldRelaxThirdPartyCookieBlocking)
</span><ins>+    , m_sourceOrigin(parameters.sourceOrigin)
</ins><span class="cx"> {
</span><span class="cx">     auto request = parameters.request;
</span><span class="cx">     auto url = request.url();
</span><span class="lines">@@ -460,9 +462,7 @@
</span><span class="cx"> {
</span><span class="cx">     WTFEmitSignpost(m_task.get(), "DataTask", "redirect");
</span><span class="cx"> 
</span><del>-    // Check if the redirected url is allowed to access the redirecting url's timing information.
-    // FIXME: This should not set back to true after another same-origin redirect once it has been set to true.
-    networkLoadMetrics().hasCrossOriginRedirect = !WebCore::SecurityOrigin::create(request.url())->canRequest(redirectResponse.url());
</del><ins>+    networkLoadMetrics().hasCrossOriginRedirect = networkLoadMetrics().hasCrossOriginRedirect || !WebCore::SecurityOrigin::create(request.url())->canRequest(redirectResponse.url());
</ins><span class="cx"> 
</span><span class="cx">     if (redirectResponse.httpStatusCode() == 307 || redirectResponse.httpStatusCode() == 308) {
</span><span class="cx">         ASSERT(m_lastHTTPMethod == request.httpMethod());
</span><span class="lines">@@ -719,4 +719,19 @@
</span><span class="cx">     m_task.get().priority = toNSURLSessionTaskPriority(priority);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void NetworkDataTaskCocoa::checkTAO(const WebCore::ResourceResponse& response)
+{
+    if (networkLoadMetrics().failsTAOCheck)
+        return;
+
+    RefPtr<WebCore::SecurityOrigin> origin;
+    if (isTopLevelNavigation())
+        origin = WebCore::SecurityOrigin::create(firstRequest().url());
+    else
+        origin = m_sourceOrigin;
+
+    if (origin)
+        networkLoadMetrics().failsTAOCheck = !passesTimingAllowOriginCheck(response, *origin);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscocoaNetworkSessionCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm  2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -571,7 +571,10 @@
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-        networkDataTask->willPerformHTTPRedirection(response, request, [completionHandler = makeBlockPtr(completionHandler), taskIdentifier, shouldIgnoreHSTS](auto&& request) {
</del><ins>+        WebCore::ResourceResponse resourceResponse(response);
+        networkDataTask->checkTAO(resourceResponse);
+
+        networkDataTask->willPerformHTTPRedirection(WTFMove(resourceResponse), request, [completionHandler = makeBlockPtr(completionHandler), taskIdentifier, shouldIgnoreHSTS](auto&& request) {
</ins><span class="cx"> #if !LOG_DISABLED
</span><span class="cx">             LOG(NetworkSession, "%llu willPerformHTTPRedirection completionHandler (%s)", taskIdentifier, request.url().string().utf8().data());
</span><span class="cx"> #else
</span><span class="lines">@@ -933,8 +936,10 @@
</span><span class="cx">         // all the fields when sending the response to the WebContent process over IPC.
</span><span class="cx">         resourceResponse.disableLazyInitialization();
</span><span class="cx"> 
</span><del>-        resourceResponse.setDeprecatedNetworkLoadMetrics(WebCore::copyTimingData(taskMetrics, networkDataTask->networkLoadMetrics().hasCrossOriginRedirect));
</del><ins>+        networkDataTask->checkTAO(resourceResponse);
</ins><span class="cx"> 
</span><ins>+        resourceResponse.setDeprecatedNetworkLoadMetrics(WebCore::copyTimingData(taskMetrics, networkDataTask->networkLoadMetrics()));
+
</ins><span class="cx">         networkDataTask->didReceiveResponse(WTFMove(resourceResponse), negotiatedLegacyTLS, [completionHandler = makeBlockPtr(completionHandler), taskIdentifier](WebCore::PolicyAction policyAction) {
</span><span class="cx"> #if !LOG_DISABLED
</span><span class="cx">             LOG(NetworkSession, "%llu didReceiveResponse completionHandler (%d)", taskIdentifier, policyAction);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesssoupNetworkDataTaskSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp  2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp     2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -864,8 +864,9 @@
</span><span class="cx">         redirectedURL.setFragmentIdentifier(request.url().fragmentIdentifier());
</span><span class="cx">     request.setURL(redirectedURL);
</span><span class="cx"> 
</span><del>-    // Check if the redirected url is allowed to access the redirecting url's timing information.
-    m_networkLoadMetrics.hasCrossOriginRedirect = !SecurityOrigin::create(m_currentRequest.url())->canRequest(request.url());
</del><ins>+    m_networkLoadMetrics.hasCrossOriginRedirect = m_networkLoadMetrics.hasCrossOriginRedirect || !SecurityOrigin::create(m_currentRequest.url())->canRequest(request.url());
+    // FIXME: Add TAO checks here and when receiving a response.
+    // This was done on Cocoa platforms in https://bugs.webkit.org/show_bug.cgi?id=226678
</ins><span class="cx"> 
</span><span class="cx">     // Clear the user agent to ensure a new one is computed.
</span><span class="cx">     auto userAgent = request.httpUserAgent();
</span></span></pre></div>
<a id="trunkSourceWebKitLegacyChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/ChangeLog (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/ChangeLog      2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebKitLegacy/ChangeLog 2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-06-10  Alex Christensen  <achristensen@webkit.org>
+
+        Move Timing-Allow-Origin checks to the network process
+        https://bugs.webkit.org/show_bug.cgi?id=226678
+        <rdar://problem/45227788>
+
+        Reviewed by Chris Dumez.
+
+        * WebCoreSupport/PingHandle.h:
+        * WebCoreSupport/WebResourceLoadScheduler.cpp:
+        (WebResourceLoadScheduler::loadResourceSynchronously):
+
</ins><span class="cx"> 2021-05-30  Darin Adler  <darin@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Remove some of the unneeded WebKitLegacy Windows-specific plug-in code
</span></span></pre></div>
<a id="trunkSourceWebKitLegacyWebCoreSupportPingHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/WebCoreSupport/PingHandle.h (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/WebCoreSupport/PingHandle.h    2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebKitLegacy/WebCoreSupport/PingHandle.h       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">         bool defersLoading = false;
</span><span class="cx">         bool shouldContentSniff = false;
</span><span class="cx">         bool shouldContentEncodingSniff = true;
</span><del>-        m_handle = WebCore::ResourceHandle::create(networkingContext, request, this, defersLoading, shouldContentSniff, shouldContentEncodingSniff);
</del><ins>+        m_handle = WebCore::ResourceHandle::create(networkingContext, request, this, defersLoading, shouldContentSniff, shouldContentEncodingSniff, nullptr, false);
</ins><span class="cx"> 
</span><span class="cx">         // If the server never responds, this object will hang around forever.
</span><span class="cx">         // Set a very generous timeout, just in case.
</span></span></pre></div>
<a id="trunkSourceWebKitLegacyWebCoreSupportWebResourceLoadSchedulercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp (278737 => 278738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp    2021-06-10 23:26:03 UTC (rev 278737)
+++ trunk/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp       2021-06-10 23:29:57 UTC (rev 278738)
</span><span class="lines">@@ -109,7 +109,9 @@
</span><span class="cx"> 
</span><span class="cx"> void WebResourceLoadScheduler::loadResourceSynchronously(FrameLoader& frameLoader, unsigned long, const ResourceRequest& request, ClientCredentialPolicy, const FetchOptions& options, const HTTPHeaderMap&, ResourceError& error, ResourceResponse& response, Vector<uint8_t>& data)
</span><span class="cx"> {
</span><del>-    ResourceHandle::loadResourceSynchronously(frameLoader.networkingContext(), request, options.credentials == FetchOptions::Credentials::Omit ? StoredCredentialsPolicy::DoNotUse : StoredCredentialsPolicy::Use, error, response, data);
</del><ins>+    auto* document = frameLoader.frame().document();
+    auto* sourceOrigin = document ? &document->securityOrigin() : nullptr;
+    ResourceHandle::loadResourceSynchronously(frameLoader.networkingContext(), request, options.credentials == FetchOptions::Credentials::Omit ? StoredCredentialsPolicy::DoNotUse : StoredCredentialsPolicy::Use, sourceOrigin, error, response, data);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebResourceLoadScheduler::pageLoadCompleted(Page&)
</span></span></pre>
</div>
</div>

</body>
</html>