<!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>[280870] 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/280870">280870</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2021-08-10 16:19:03 -0700 (Tue, 10 Aug 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Meta HTTP refresh should not navigate if document has sandboxed automatic features browsing context flag set
https://bugs.webkit.org/show_bug.cgi?id=228965

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing.

* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2-expected.txt:

Source/WebCore:

Meta HTTP refresh should not navigate if document has sandboxed automatic features browsing context flag set:
- https://html.spec.whatwg.org/multipage/semantics.html#shared-declarative-refresh-steps (Step 13)

Firefox and Chrome already behave this way.

No new tests, rebaselined existing tests.

* dom/Document.cpp:
(WebCore::Document::processMetaHttpEquiv):
* dom/Document.h:
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::receivedFirstData):
(WebCore::FrameLoader::scheduleRefreshIfNeeded):
* loader/FrameLoader.h:
* loader/FrameLoaderTypes.h:
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledRedirect::ScheduledRedirect):
(WebCore::NavigationScheduler::scheduleRedirect):
* loader/NavigationScheduler.h:

LayoutTests:

Unskip tests that should no longer be flaky now that they are passing.

* 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="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsdocumentmetadatathemetaelementpragmadirectivesattrmetahttpequivrefreshallowscriptsflagchanging1expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsdocumentmetadatathemetaelementpragmadirectivesattrmetahttpequivrefreshallowscriptsflagchanging2expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMetaElementcpp">trunk/Source/WebCore/html/HTMLMetaElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderh">trunk/Source/WebCore/loader/FrameLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderTypesh">trunk/Source/WebCore/loader/FrameLoaderTypes.h</a></li>
<li><a href="#trunkSourceWebCoreloaderNavigationSchedulercpp">trunk/Source/WebCore/loader/NavigationScheduler.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderNavigationSchedulerh">trunk/Source/WebCore/loader/NavigationScheduler.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/LayoutTests/ChangeLog 2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2021-08-10  Chris Dumez  <cdumez@apple.com>
+
+        Meta HTTP refresh should not navigate if document has sandboxed automatic features browsing context flag set
+        https://bugs.webkit.org/show_bug.cgi?id=228965
+
+        Reviewed by Darin Adler.
+
+        Unskip tests that should no longer be flaky now that they are passing.
+
+        * TestExpectations:
+
</ins><span class="cx"> 2021-08-10  Ayumi Kojima  <ayumi_kojima@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [ Win EWS ] fast/forms/search/search-zoom-computed-style-height.html is flaky crashing.
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations       2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/LayoutTests/TestExpectations  2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -1505,10 +1505,6 @@
</span><span class="cx"> # Flaky tests at import time
</span><span class="cx"> imported/w3c/web-platform-tests/css/css-scoping/css-scoping-shadow-host-namespace.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span><del>-# Those WPT tests are flaky when failing.
-imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1.html [ Pass Failure ]
-imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2.html [ Pass Failure ]
-
</del><span class="cx"> # WPT tests for custom elements
</span><span class="cx"> webkit.org/b/187800 imported/w3c/web-platform-tests/custom-elements/Document-createElement-svg.svg [ Skip ]
</span><span class="cx"> webkit.org/b/187800 imported/w3c/web-platform-tests/custom-elements/parser/parser-uses-create-an-element-for-a-token-svg.svg [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2021-08-10  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><ins>+        Meta HTTP refresh should not navigate if document has sandboxed automatic features browsing context flag set
+        https://bugs.webkit.org/show_bug.cgi?id=228965
+
+        Reviewed by Darin Adler.
+
+        Rebaseline WPT tests that are now passing.
+
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1-expected.txt:
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2-expected.txt:
+
+2021-08-10  Chris Dumez  <cdumez@apple.com>
+
</ins><span class="cx">         Document.baseURI is inaccurate for iframe srcdoc documents
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=228933
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsdocumentmetadatathemetaelementpragmadirectivesattrmetahttpequivrefreshallowscriptsflagchanging1expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1-expected.txt (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1-expected.txt    2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1-expected.txt       2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: TypeError: Argument 1 ('node') to Node.appendChild must be an instance of Node
</del><ins>+CONSOLE MESSAGE: Unable to do meta refresh due to sandboxing
</ins><span class="cx"> 
</span><del>-FAIL Meta refresh is blocked by the allow-scripts sandbox flag at its creation time, not when refresh comes due TypeError: Argument 1 ('node') to Node.appendChild must be an instance of Node
</del><ins>+PASS Meta refresh is blocked by the allow-scripts sandbox flag at its creation time, not when refresh comes due
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsdocumentmetadatathemetaelementpragmadirectivesattrmetahttpequivrefreshallowscriptsflagchanging2expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2-expected.txt (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2-expected.txt    2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2-expected.txt       2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: TypeError: Argument 1 ('node') to Node.appendChild must be an instance of Node
</del><ins>+CONSOLE MESSAGE: Unable to do meta refresh due to sandboxing
</ins><span class="cx"> 
</span><del>-FAIL Meta refresh of the original iframe is not blocked if moved into a sandboxed iframe TypeError: Argument 1 ('node') to Node.appendChild must be an instance of Node
</del><ins>+PASS Meta refresh of the original iframe is not blocked if moved into a sandboxed iframe
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/Source/WebCore/ChangeLog      2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2021-08-10  Chris Dumez  <cdumez@apple.com>
+
+        Meta HTTP refresh should not navigate if document has sandboxed automatic features browsing context flag set
+        https://bugs.webkit.org/show_bug.cgi?id=228965
+
+        Reviewed by Darin Adler.
+
+        Meta HTTP refresh should not navigate if document has sandboxed automatic features browsing context flag set:
+        - https://html.spec.whatwg.org/multipage/semantics.html#shared-declarative-refresh-steps (Step 13)
+
+        Firefox and Chrome already behave this way.
+
+        No new tests, rebaselined existing tests.
+
+        * dom/Document.cpp:
+        (WebCore::Document::processMetaHttpEquiv):
+        * dom/Document.h:
+        * html/HTMLMetaElement.cpp:
+        (WebCore::HTMLMetaElement::process):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::responseReceived):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::receivedFirstData):
+        (WebCore::FrameLoader::scheduleRefreshIfNeeded):
+        * loader/FrameLoader.h:
+        * loader/FrameLoaderTypes.h:
+        * loader/NavigationScheduler.cpp:
+        (WebCore::ScheduledRedirect::ScheduledRedirect):
+        (WebCore::NavigationScheduler::scheduleRedirect):
+        * loader/NavigationScheduler.h:
+
</ins><span class="cx"> 2021-08-10  Ryosuke Niwa  <rniwa@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Deploy some more smart pointers in DOMWindow.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp    2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/Source/WebCore/dom/Document.cpp       2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -3736,7 +3736,7 @@
</span><span class="cx">     m_hasElementUsingStyleBasedEditability = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Document::processHttpEquiv(const String& equiv, const String& content, bool isInDocumentHead)
</del><ins>+void Document::processMetaHttpEquiv(const String& equiv, const String& content, bool isInDocumentHead)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!equiv.isNull());
</span><span class="cx">     ASSERT(!content.isNull());
</span><span class="lines">@@ -3781,7 +3781,7 @@
</span><span class="cx"> 
</span><span class="cx">     case HTTPHeaderName::Refresh:
</span><span class="cx">         if (frame)
</span><del>-            frame->loader().scheduleRefreshIfNeeded(*this, content);
</del><ins>+            frame->loader().scheduleRefreshIfNeeded(*this, content, IsMetaRefresh::Yes);
</ins><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case HTTPHeaderName::SetCookie:
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h      2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/Source/WebCore/dom/Document.h 2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -892,7 +892,7 @@
</span><span class="cx">     // when a meta tag is encountered during document parsing, and also when a script dynamically changes or adds a meta
</span><span class="cx">     // tag. This enables scripts to use meta tags to perform refreshes and set expiry dates in addition to them being
</span><span class="cx">     // specified in an HTML file.
</span><del>-    void processHttpEquiv(const String& equiv, const String& content, bool isInDocumentHead);
</del><ins>+    void processMetaHttpEquiv(const String& equiv, const String& content, bool isInDocumentHead);
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><span class="cx">     void processFormatDetection(const String&);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMetaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMetaElement.cpp (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMetaElement.cpp    2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/Source/WebCore/html/HTMLMetaElement.cpp       2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx"> 
</span><span class="cx">     const AtomString& httpEquivValue = attributeWithoutSynchronization(http_equivAttr);
</span><span class="cx">     if (!httpEquivValue.isNull())
</span><del>-        document().processHttpEquiv(httpEquivValue, contentValue, isDescendantOf(document().head()));
</del><ins>+        document().processMetaHttpEquiv(httpEquivValue, contentValue, isDescendantOf(document().head()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const AtomString& HTMLMetaElement::content() const
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp   2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp      2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -927,7 +927,7 @@
</span><span class="cx">             auto firstPartyDomain = RegistrableDomain(response.url());
</span><span class="cx">             if (auto loginDomains = NetworkStorageSession::subResourceDomainsInNeedOfStorageAccessForFirstParty(firstPartyDomain)) {
</span><span class="cx">                 if (!Quirks::hasStorageAccessForAllLoginDomains(*loginDomains, firstPartyDomain)) {
</span><del>-                    m_frame->navigationScheduler().scheduleRedirect(document, 0, microsoftTeamsRedirectURL());
</del><ins>+                    m_frame->navigationScheduler().scheduleRedirect(document, 0, microsoftTeamsRedirectURL(), IsMetaRefresh::No);
</ins><span class="cx">                     return;
</span><span class="cx">                 }
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp      2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp 2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -713,7 +713,7 @@
</span><span class="cx"> 
</span><span class="cx">     LinkLoader::loadLinksFromHeader(documentLoader.response().httpHeaderField(HTTPHeaderName::Link), document.url(), document, LinkLoader::MediaAttributeCheck::MediaAttributeEmpty);
</span><span class="cx"> 
</span><del>-    scheduleRefreshIfNeeded(document, documentLoader.response().httpHeaderField(HTTPHeaderName::Refresh));
</del><ins>+    scheduleRefreshIfNeeded(document, documentLoader.response().httpHeaderField(HTTPHeaderName::Refresh), IsMetaRefresh::No);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FrameLoader::setOutgoingReferrer(const URL& url)
</span><span class="lines">@@ -2968,7 +2968,7 @@
</span><span class="cx">         request.setIsAppInitiated(m_frame.mainFrame().loader().documentLoader()->lastNavigationWasAppInitiated());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FrameLoader::scheduleRefreshIfNeeded(Document& document, const String& content)
</del><ins>+void FrameLoader::scheduleRefreshIfNeeded(Document& document, const String& content, IsMetaRefresh isMetaRefresh)
</ins><span class="cx"> {
</span><span class="cx">     double delay = 0;
</span><span class="cx">     String urlString;
</span><span class="lines">@@ -2975,7 +2975,7 @@
</span><span class="cx">     if (parseMetaHTTPEquivRefresh(content, delay, urlString)) {
</span><span class="cx">         auto completedURL = urlString.isEmpty() ? document.url() : document.completeURL(urlString);
</span><span class="cx">         if (!completedURL.protocolIsJavaScript())
</span><del>-            m_frame.navigationScheduler().scheduleRedirect(document, delay, completedURL);
</del><ins>+            m_frame.navigationScheduler().scheduleRedirect(document, delay, completedURL, isMetaRefresh);
</ins><span class="cx">         else {
</span><span class="cx">             String message = "Refused to refresh " + document.url().stringCenterEllipsizedToLength() + " to a javascript: URL";
</span><span class="cx">             document.addConsoleMessage(MessageSource::Security, MessageLevel::Error, message);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.h (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.h        2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/Source/WebCore/loader/FrameLoader.h   2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -319,7 +319,7 @@
</span><span class="cx">     // For subresource requests the FrameLoadType parameter has no effect and can be skipped.
</span><span class="cx">     void updateRequestAndAddExtraFields(ResourceRequest&, IsMainResource, FrameLoadType = FrameLoadType::Standard, ShouldUpdateAppInitiatedValue = ShouldUpdateAppInitiatedValue::Yes);
</span><span class="cx"> 
</span><del>-    void scheduleRefreshIfNeeded(Document&, const String& content);
</del><ins>+    void scheduleRefreshIfNeeded(Document&, const String& content, IsMetaRefresh);
</ins><span class="cx"> 
</span><span class="cx">     void switchBrowsingContextsGroup();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoaderTypes.h (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoaderTypes.h   2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/Source/WebCore/loader/FrameLoaderTypes.h      2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx">     ReloadExpiredOnly
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+enum class IsMetaRefresh : bool { No, Yes };
</ins><span class="cx"> enum class WillContinueLoading : bool { No, Yes };
</span><span class="cx"> 
</span><span class="cx"> class PolicyCheckIdentifier {
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderNavigationSchedulercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/NavigationScheduler.cpp (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/NavigationScheduler.cpp      2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/Source/WebCore/loader/NavigationScheduler.cpp 2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -167,8 +167,9 @@
</span><span class="cx"> 
</span><span class="cx"> class ScheduledRedirect : public ScheduledURLNavigation {
</span><span class="cx"> public:
</span><del>-    ScheduledRedirect(Document& initiatingDocument, double delay, SecurityOrigin* securityOrigin, const URL& url, LockHistory lockHistory, LockBackForwardList lockBackForwardList)
</del><ins>+    ScheduledRedirect(Document& initiatingDocument, double delay, SecurityOrigin* securityOrigin, const URL& url, LockHistory lockHistory, LockBackForwardList lockBackForwardList, IsMetaRefresh isMetaRefresh)
</ins><span class="cx">         : ScheduledURLNavigation(initiatingDocument, delay, securityOrigin, url, String(), lockHistory, lockBackForwardList, false, false)
</span><ins>+        , m_isMetaRefresh(isMetaRefresh)
</ins><span class="cx">     {
</span><span class="cx">         clearUserGesture();
</span><span class="cx">     }
</span><span class="lines">@@ -180,6 +181,13 @@
</span><span class="cx"> 
</span><span class="cx">     void fire(Frame& frame) override
</span><span class="cx">     {
</span><ins>+        if (m_isMetaRefresh == IsMetaRefresh::Yes) {
+            if (auto document = frame.document(); document && document->isSandboxed(SandboxAutomaticFeatures)) {
+                document->addConsoleMessage(MessageSource::Security, MessageLevel::Error, "Unable to do meta refresh due to sandboxing"_s);
+                return;
+            }
+        }
+
</ins><span class="cx">         UserGestureIndicator gestureIndicator { userGestureToForward() };
</span><span class="cx"> 
</span><span class="cx">         bool refresh = equalIgnoringFragmentIdentifier(frame.document()->url(), url());
</span><span class="lines">@@ -194,6 +202,9 @@
</span><span class="cx"> 
</span><span class="cx">         frame.loader().changeLocation(WTFMove(frameLoadRequest));
</span><span class="cx">     }
</span><ins>+
+private:
+    IsMetaRefresh m_isMetaRefresh;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class ScheduledLocationChange : public ScheduledURLNavigation {
</span><span class="lines">@@ -407,7 +418,7 @@
</span><span class="cx">     return NavigationDisabler::isNavigationAllowed(m_frame);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NavigationScheduler::scheduleRedirect(Document& initiatingDocument, double delay, const URL& url)
</del><ins>+void NavigationScheduler::scheduleRedirect(Document& initiatingDocument, double delay, const URL& url, IsMetaRefresh isMetaRefresh)
</ins><span class="cx"> {
</span><span class="cx">     if (!shouldScheduleNavigation(url))
</span><span class="cx">         return;
</span><span class="lines">@@ -419,7 +430,7 @@
</span><span class="cx">     // We want a new back/forward list item if the refresh timeout is > 1 second.
</span><span class="cx">     if (!m_redirect || delay <= m_redirect->delay()) {
</span><span class="cx">         auto lockBackForwardList = delay <= 1 ? LockBackForwardList::Yes : LockBackForwardList::No;
</span><del>-        schedule(makeUnique<ScheduledRedirect>(initiatingDocument, delay, &m_frame.document()->securityOrigin(), url, LockHistory::Yes, lockBackForwardList));
</del><ins>+        schedule(makeUnique<ScheduledRedirect>(initiatingDocument, delay, &m_frame.document()->securityOrigin(), url, LockHistory::Yes, lockBackForwardList, isMetaRefresh));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderNavigationSchedulerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/NavigationScheduler.h (280869 => 280870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/NavigationScheduler.h        2021-08-10 22:41:13 UTC (rev 280869)
+++ trunk/Source/WebCore/loader/NavigationScheduler.h   2021-08-10 23:19:03 UTC (rev 280870)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">     bool redirectScheduledDuringLoad();
</span><span class="cx">     bool locationChangePending();
</span><span class="cx"> 
</span><del>-    void scheduleRedirect(Document& initiatingDocument, double delay, const URL&);
</del><ins>+    void scheduleRedirect(Document& initiatingDocument, double delay, const URL&, IsMetaRefresh);
</ins><span class="cx">     void scheduleLocationChange(Document& initiatingDocument, SecurityOrigin&, const URL&, const String& referrer, LockHistory = LockHistory::Yes, LockBackForwardList = LockBackForwardList::Yes, CompletionHandler<void()>&& = [] { });
</span><span class="cx">     void scheduleFormSubmission(Ref<FormSubmission>&&);
</span><span class="cx">     void scheduleRefresh(Document& initiatingDocument);
</span></span></pre>
</div>
</div>

</body>
</html>