<!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>[285038] trunk/Source</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/285038">285038</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2021-10-29 10:27:20 -0700 (Fri, 29 Oct 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Create constants for all special frame names used in anchor target attribute values and elsewhere
https://bugs.webkit.org/show_bug.cgi?id=232488

Reviewed by Anders Carlsson.

Source/WebCore:

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick): Use isBlankTargetFrameName.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submit): Ditto.

* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::openURLExternally): Use
blankTargetFrameName and selfTargetFrameName.
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::navigate): Ditto.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURLIntoChildFrame): Use selfTargetFrameName.
(WebCore::FrameLoader::loadURL): Use selfTargetFrameName and blankTargetFrameName.
(WebCore::FrameLoader::loadPostRequest): Use blankTargetFrameName.
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Ditto.
(WebCore::createWindow): Use isBlankTargetFrameName.

* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleLocationChange): Use selfTargetFrameName.

* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::defaultEventHandler): Use selfTargetFrameName.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow): Use selfTargetFrameName.
(WebCore::DOMWindow::open): Use isTopTargetFrameName and isParentTargetFrameName.

* page/FrameTree.cpp:
(WebCore::FrameTree::uniqueChildName const): Use isBlankTargetFrameName.
(WebCore::FrameTree::find const): Use isSelfTargetFrameName, isTopTargetFrameName,
isParentTargetFrameName, and isBlankTargetFrameName.
(WebCore::blankTargetFrameName): Added.
(WebCore::selfTargetFrameName): Added.
(WebCore::isBlankTargetFrameName): Added.
(WebCore::isParentTargetFrameName): Added.
(WebCore::isSelfTargetFrameName): Added.
(WebCore::isTopTargetFrameName): Added.

* page/FrameTree.h: Add declarations.

* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler): Use blankTargetFrameName.

Source/WTF:

* wtf/Forward.h: Declare ASCIILiteral.
* wtf/text/ASCIILiteral.h: Update for above.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfForwardh">trunk/Source/WTF/wtf/Forward.h</a></li>
<li><a href="#trunkSourceWTFwtftextASCIILiteralh">trunk/Source/WTF/wtf/text/ASCIILiteral.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAnchorElementcpp">trunk/Source/WebCore/html/HTMLAnchorElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormElementcpp">trunk/Source/WebCore/html/HTMLFormElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorFrontendClientLocalcpp">trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorPageAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderNavigationSchedulercpp">trunk/Source/WebCore/loader/NavigationScheduler.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLElementcpp">trunk/Source/WebCore/mathml/MathMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameTreecpp">trunk/Source/WebCore/page/FrameTree.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameTreeh">trunk/Source/WebCore/page/FrameTree.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAElementcpp">trunk/Source/WebCore/svg/SVGAElement.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog       2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WTF/ChangeLog  2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2021-10-29  Darin Adler  <darin@apple.com>
+
+        Create constants for all special frame names used in anchor target attribute values and elsewhere
+        https://bugs.webkit.org/show_bug.cgi?id=232488
+
+        Reviewed by Anders Carlsson.
+
+        * wtf/Forward.h: Declare ASCIILiteral.
+        * wtf/text/ASCIILiteral.h: Update for above.
+
</ins><span class="cx"> 2021-10-29  Saam Barati  <sbarati@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Disable ENABLE_JIT on arm64_32
</span></span></pre></div>
<a id="trunkSourceWTFwtfForwardh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Forward.h (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Forward.h   2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WTF/wtf/Forward.h      2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="cx"> 
</span><ins>+class ASCIILiteral;
</ins><span class="cx"> class AbstractLocker;
</span><span class="cx"> class AtomString;
</span><span class="cx"> class AtomStringImpl;
</span><span class="lines">@@ -47,8 +48,8 @@
</span><span class="cx"> class SuspendableWorkQueue;
</span><span class="cx"> class TextPosition;
</span><span class="cx"> class TextStream;
</span><ins>+class URL;
</ins><span class="cx"> class UniquedStringImpl;
</span><del>-class URL;
</del><span class="cx"> class WallTime;
</span><span class="cx"> 
</span><span class="cx"> struct AnyThreadsAccessTraits;
</span><span class="lines">@@ -118,6 +119,7 @@
</span><span class="cx"> template<class> class unexpected;
</span><span class="cx"> }}} // namespace std::experimental::fundamentals_v3
</span><span class="cx"> 
</span><ins>+using WTF::ASCIILiteral;
</ins><span class="cx"> using WTF::AbstractLocker;
</span><span class="cx"> using WTF::AtomString;
</span><span class="cx"> using WTF::AtomStringImpl;
</span></span></pre></div>
<a id="trunkSourceWTFwtftextASCIILiteralh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/ASCIILiteral.h (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/ASCIILiteral.h 2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WTF/wtf/text/ASCIILiteral.h    2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include <wtf/ASCIICType.h>
</span><ins>+#include <wtf/Forward.h>
</ins><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="lines">@@ -78,4 +79,3 @@
</span><span class="cx"> } // namespace WTF
</span><span class="cx"> 
</span><span class="cx"> using namespace WTF::StringLiterals;
</span><del>-using WTF::ASCIILiteral;
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/ChangeLog      2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2021-10-29  Darin Adler  <darin@apple.com>
+
+        Create constants for all special frame names used in anchor target attribute values and elsewhere
+        https://bugs.webkit.org/show_bug.cgi?id=232488
+
+        Reviewed by Anders Carlsson.
+
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::handleClick): Use isBlankTargetFrameName.
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::submit): Ditto.
+
+        * inspector/InspectorFrontendClientLocal.cpp:
+        (WebCore::InspectorFrontendClientLocal::openURLExternally): Use
+        blankTargetFrameName and selfTargetFrameName.
+        * inspector/agents/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::navigate): Ditto.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadURLIntoChildFrame): Use selfTargetFrameName.
+        (WebCore::FrameLoader::loadURL): Use selfTargetFrameName and blankTargetFrameName.
+        (WebCore::FrameLoader::loadPostRequest): Use blankTargetFrameName.
+        (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Ditto.
+        (WebCore::createWindow): Use isBlankTargetFrameName.
+
+        * loader/NavigationScheduler.cpp:
+        (WebCore::NavigationScheduler::scheduleLocationChange): Use selfTargetFrameName.
+
+        * mathml/MathMLElement.cpp:
+        (WebCore::MathMLElement::defaultEventHandler): Use selfTargetFrameName.
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::createWindow): Use selfTargetFrameName.
+        (WebCore::DOMWindow::open): Use isTopTargetFrameName and isParentTargetFrameName.
+
+        * page/FrameTree.cpp:
+        (WebCore::FrameTree::uniqueChildName const): Use isBlankTargetFrameName.
+        (WebCore::FrameTree::find const): Use isSelfTargetFrameName, isTopTargetFrameName,
+        isParentTargetFrameName, and isBlankTargetFrameName.
+        (WebCore::blankTargetFrameName): Added.
+        (WebCore::selfTargetFrameName): Added.
+        (WebCore::isBlankTargetFrameName): Added.
+        (WebCore::isParentTargetFrameName): Added.
+        (WebCore::isSelfTargetFrameName): Added.
+        (WebCore::isTopTargetFrameName): Added.
+
+        * page/FrameTree.h: Add declarations.
+
+        * svg/SVGAElement.cpp:
+        (WebCore::SVGAElement::defaultEventHandler): Use blankTargetFrameName.
+
</ins><span class="cx"> 2021-10-29  Aditya Keerthi  <akeerthi@apple.com>
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r283269) disneyplus.com time remaining bar shows an extra line/bar
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp  2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp     2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -528,7 +528,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto effectiveTarget = this->effectiveTarget();
</span><span class="cx">     NewFrameOpenerPolicy newFrameOpenerPolicy = NewFrameOpenerPolicy::Allow;
</span><del>-    if (hasRel(Relation::NoOpener) || hasRel(Relation::NoReferrer) || (!hasRel(Relation::Opener) && document().settings().blankAnchorTargetImpliesNoOpenerEnabled() && equalIgnoringASCIICase(effectiveTarget, "_blank")))
</del><ins>+    if (hasRel(Relation::NoOpener) || hasRel(Relation::NoReferrer) || (!hasRel(Relation::Opener) && document().settings().blankAnchorTargetImpliesNoOpenerEnabled() && isBlankTargetFrameName(effectiveTarget)))
</ins><span class="cx">         newFrameOpenerPolicy = NewFrameOpenerPolicy::Suppress;
</span><span class="cx"> 
</span><span class="cx">     auto privateClickMeasurement = parsePrivateClickMeasurement();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormElement.cpp (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormElement.cpp    2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/html/HTMLFormElement.cpp       2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -428,7 +428,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     auto relAttributes = parseFormRelAttributes(getAttribute(HTMLNames::relAttr));
</span><del>-    if (relAttributes.noopener || relAttributes.noreferrer || (!relAttributes.opener && document().settings().blankAnchorTargetImpliesNoOpenerEnabled() && equalIgnoringASCIICase(formSubmission->target(), "_blank")))
</del><ins>+    if (relAttributes.noopener || relAttributes.noreferrer || (!relAttributes.opener && document().settings().blankAnchorTargetImpliesNoOpenerEnabled() && isBlankTargetFrameName(formSubmission->target())))
</ins><span class="cx">         formSubmission->setNewFrameOpenerPolicy(NewFrameOpenerPolicy::Suppress);
</span><span class="cx">     if (relAttributes.noreferrer)
</span><span class="cx">         formSubmission->setReferrerPolicy(ReferrerPolicy::NoReferrer);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorFrontendClientLocalcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp  2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp     2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -267,7 +267,7 @@
</span><span class="cx"> {
</span><span class="cx">     UserGestureIndicator indicator { ProcessingUserGesture };
</span><span class="cx">     Frame& mainFrame = m_inspectedPageController->inspectedPage().mainFrame();
</span><del>-    FrameLoadRequest frameLoadRequest { *mainFrame.document(), mainFrame.document()->securityOrigin(), { }, "_blank"_s, InitiatedByMainFrame::Unknown };
</del><ins>+    FrameLoadRequest frameLoadRequest { *mainFrame.document(), mainFrame.document()->securityOrigin(), { }, blankTargetFrameName(), InitiatedByMainFrame::Unknown };
</ins><span class="cx"> 
</span><span class="cx">     bool created;
</span><span class="cx">     WindowFeatures features;
</span><span class="lines">@@ -280,7 +280,7 @@
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Why do we compute the absolute URL with respect to |frame| instead of |mainFrame|?
</span><span class="cx">     ResourceRequest resourceRequest { frame->document()->completeURL(url) };
</span><del>-    FrameLoadRequest frameLoadRequest2 { *mainFrame.document(), mainFrame.document()->securityOrigin(), WTFMove(resourceRequest), "_self"_s, InitiatedByMainFrame::Unknown };
</del><ins>+    FrameLoadRequest frameLoadRequest2 { *mainFrame.document(), mainFrame.document()->securityOrigin(), WTFMove(resourceRequest), selfTargetFrameName(), InitiatedByMainFrame::Unknown };
</ins><span class="cx">     frame->loader().changeLocation(WTFMove(frameLoadRequest2));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectoragentsInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/agents/InspectorPageAgent.cpp (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/agents/InspectorPageAgent.cpp     2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/inspector/agents/InspectorPageAgent.cpp        2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -413,7 +413,7 @@
</span><span class="cx">     Frame& frame = m_inspectedPage.mainFrame();
</span><span class="cx"> 
</span><span class="cx">     ResourceRequest resourceRequest { frame.document()->completeURL(url) };
</span><del>-    FrameLoadRequest frameLoadRequest { *frame.document(), frame.document()->securityOrigin(), WTFMove(resourceRequest), "_self"_s, InitiatedByMainFrame::Unknown };
</del><ins>+    FrameLoadRequest frameLoadRequest { *frame.document(), frame.document()->securityOrigin(), WTFMove(resourceRequest), selfTargetFrameName(), InitiatedByMainFrame::Unknown };
</ins><span class="cx">     frameLoadRequest.disableNavigationToInvalidURL();
</span><span class="cx">     frame.loader().changeLocation(WTFMove(frameLoadRequest));
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp      2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp 2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -985,7 +985,7 @@
</span><span class="cx">     auto* lexicalFrame = lexicalFrameFromCommonVM();
</span><span class="cx">     auto initiatedByMainFrame = lexicalFrame && lexicalFrame->isMainFrame() ? InitiatedByMainFrame::Yes : InitiatedByMainFrame::Unknown;
</span><span class="cx"> 
</span><del>-    FrameLoadRequest frameLoadRequest { *m_frame.document(), m_frame.document()->securityOrigin(), { url }, "_self"_s, initiatedByMainFrame };
</del><ins>+    FrameLoadRequest frameLoadRequest { *m_frame.document(), m_frame.document()->securityOrigin(), { url }, selfTargetFrameName(), initiatedByMainFrame };
</ins><span class="cx">     frameLoadRequest.setNewFrameOpenerPolicy(NewFrameOpenerPolicy::Suppress);
</span><span class="cx">     frameLoadRequest.setLockBackForwardList(LockBackForwardList::Yes);
</span><span class="cx">     childFrame->loader().loadURL(WTFMove(frameLoadRequest), referer, FrameLoadType::RedirectWithLockedBackForwardList, nullptr, { }, std::nullopt, [] { });
</span><span class="lines">@@ -1346,7 +1346,7 @@
</span><span class="cx">     // The search for a target frame is done earlier in the case of form submission.
</span><span class="cx">     auto targetFrame = isFormSubmission ? nullptr : RefPtr { findFrameForNavigation(effectiveFrameName) };
</span><span class="cx">     if (targetFrame && targetFrame != &m_frame) {
</span><del>-        frameLoadRequest.setFrameName("_self");
</del><ins>+        frameLoadRequest.setFrameName(selfTargetFrameName());
</ins><span class="cx">         targetFrame->loader().loadURL(WTFMove(frameLoadRequest), referrer, newLoadType, event, WTFMove(formState), WTFMove(privateClickMeasurement), completionHandlerCaller.release());
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -1376,7 +1376,7 @@
</span><span class="cx"> 
</span><span class="cx">         // https://html.spec.whatwg.org/#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name (Step 8.2)
</span><span class="cx">         if (frameLoadRequest.requester().shouldForceNoOpenerBasedOnCOOP()) {
</span><del>-            effectiveFrameName = "_blank"_s;
</del><ins>+            effectiveFrameName = blankTargetFrameName();
</ins><span class="cx">             openerPolicy = NewFrameOpenerPolicy::Suppress;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -3082,7 +3082,7 @@
</span><span class="cx"> 
</span><span class="cx">         // https://html.spec.whatwg.org/#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name (Step 8.2)
</span><span class="cx">         if (request.requester().shouldForceNoOpenerBasedOnCOOP()) {
</span><del>-            frameName = "_blank"_s;
</del><ins>+            frameName = blankTargetFrameName();
</ins><span class="cx">             openerPolicy = NewFrameOpenerPolicy::Suppress;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -3574,7 +3574,7 @@
</span><span class="cx">     if (sandboxFlags & SandboxPropagatesToAuxiliaryBrowsingContexts)
</span><span class="cx">         mainFrame->loader().forceSandboxFlags(sandboxFlags);
</span><span class="cx"> 
</span><del>-    if (!equalIgnoringASCIICase(frameName, "_blank"))
</del><ins>+    if (!isBlankTargetFrameName(frameName))
</ins><span class="cx">         mainFrame->tree().setName(frameName);
</span><span class="cx"> 
</span><span class="cx">     mainFrame->page()->setOpenedByDOM();
</span><span class="lines">@@ -4105,9 +4105,9 @@
</span><span class="cx">     if (request.resourceRequest().url().protocolIsJavaScript() && !openerFrame.document()->contentSecurityPolicy()->allowJavaScriptURLs(openerFrame.document()->url().string(), { }, request.resourceRequest().url().string()))
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (!request.frameName().isEmpty() && !equalIgnoringASCIICase(request.frameName(), "_blank")) {
</del><ins>+    if (!request.frameName().isEmpty() && !isBlankTargetFrameName(request.frameName())) {
</ins><span class="cx">         if (RefPtr<Frame> frame = lookupFrame.loader().findFrameForNavigation(request.frameName(), openerFrame.document())) {
</span><del>-            if (!equalIgnoringASCIICase(request.frameName(), "_self")) {
</del><ins>+            if (!isSelfTargetFrameName(request.frameName())) {
</ins><span class="cx">                 if (Page* page = frame->page())
</span><span class="cx">                     page->chrome().focus();
</span><span class="cx">             }
</span><span class="lines">@@ -4117,7 +4117,7 @@
</span><span class="cx"> 
</span><span class="cx">     // https://html.spec.whatwg.org/#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name (Step 8.2)
</span><span class="cx">     if (openerFrame.document()->shouldForceNoOpenerBasedOnCOOP()) {
</span><del>-        request.setFrameName("_blank"_s);
</del><ins>+        request.setFrameName(blankTargetFrameName());
</ins><span class="cx">         features.noopener = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -4149,7 +4149,7 @@
</span><span class="cx">     if (isDocumentSandboxed(openerFrame, SandboxPropagatesToAuxiliaryBrowsingContexts))
</span><span class="cx">         frame->loader().forceSandboxFlags(openerFrame.document()->sandboxFlags());
</span><span class="cx"> 
</span><del>-    if (!equalIgnoringASCIICase(request.frameName(), "_blank"))
</del><ins>+    if (!isBlankTargetFrameName(request.frameName()))
</ins><span class="cx">         frame->tree().setName(request.frameName());
</span><span class="cx"> 
</span><span class="cx">     page->chrome().setToolbarsVisible(features.toolBarVisible || features.locationBarVisible);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderNavigationSchedulercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/NavigationScheduler.cpp (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/NavigationScheduler.cpp      2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/loader/NavigationScheduler.cpp 2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx">         ResourceRequest resourceRequest { url(), referrer(), refresh ? ResourceRequestCachePolicy::ReloadIgnoringCacheData : ResourceRequestCachePolicy::UseProtocolCachePolicy };
</span><span class="cx">         if (initiatedByMainFrame() == InitiatedByMainFrame::Yes)
</span><span class="cx">             resourceRequest.setRequester(ResourceRequest::Requester::Main);
</span><del>-        FrameLoadRequest frameLoadRequest { initiatingDocument(), *securityOrigin(), WTFMove(resourceRequest), "_self", initiatedByMainFrame() };
</del><ins>+        FrameLoadRequest frameLoadRequest { initiatingDocument(), *securityOrigin(), WTFMove(resourceRequest), selfTargetFrameName(), initiatedByMainFrame() };
</ins><span class="cx">         frameLoadRequest.setLockHistory(lockHistory());
</span><span class="cx">         frameLoadRequest.setLockBackForwardList(lockBackForwardList());
</span><span class="cx">         frameLoadRequest.disableNavigationToInvalidURL();
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx">         UserGestureIndicator gestureIndicator { userGestureToForward() };
</span><span class="cx"> 
</span><span class="cx">         ResourceRequest resourceRequest { url(), referrer(), ResourceRequestCachePolicy::UseProtocolCachePolicy };
</span><del>-        FrameLoadRequest frameLoadRequest { initiatingDocument(), *securityOrigin(), WTFMove(resourceRequest), "_self", initiatedByMainFrame() };
</del><ins>+        FrameLoadRequest frameLoadRequest { initiatingDocument(), *securityOrigin(), WTFMove(resourceRequest), selfTargetFrameName(), initiatedByMainFrame() };
</ins><span class="cx">         frameLoadRequest.setLockHistory(lockHistory());
</span><span class="cx">         frameLoadRequest.setLockBackForwardList(lockBackForwardList());
</span><span class="cx">         frameLoadRequest.disableNavigationToInvalidURL();
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx">         UserGestureIndicator gestureIndicator { userGestureToForward() };
</span><span class="cx"> 
</span><span class="cx">         ResourceRequest resourceRequest { url(), referrer(), ResourceRequestCachePolicy::ReloadIgnoringCacheData };
</span><del>-        FrameLoadRequest frameLoadRequest { initiatingDocument(), *securityOrigin(), WTFMove(resourceRequest), "_self", initiatedByMainFrame() };
</del><ins>+        FrameLoadRequest frameLoadRequest { initiatingDocument(), *securityOrigin(), WTFMove(resourceRequest), selfTargetFrameName(), initiatedByMainFrame() };
</ins><span class="cx">         frameLoadRequest.setLockHistory(lockHistory());
</span><span class="cx">         frameLoadRequest.setLockBackForwardList(lockBackForwardList());
</span><span class="cx">         frameLoadRequest.setShouldOpenExternalURLsPolicy(shouldOpenExternalURLs());
</span><span class="lines">@@ -277,7 +277,7 @@
</span><span class="cx">         if (!m_historySteps) {
</span><span class="cx">             // Special case for go(0) from a frame -> reload only the frame
</span><span class="cx">             // To follow Firefox and IE's behavior, history reload can only navigate the self frame.
</span><del>-            frame.loader().changeLocation(frame.document()->url(), "_self", 0, ReferrerPolicy::EmptyString, shouldOpenExternalURLs());
</del><ins>+            frame.loader().changeLocation(frame.document()->url(), selfTargetFrameName(), 0, ReferrerPolicy::EmptyString, shouldOpenExternalURLs());
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -470,7 +470,7 @@
</span><span class="cx">         auto* frame = lexicalFrameFromCommonVM();
</span><span class="cx">         auto initiatedByMainFrame = frame && frame->isMainFrame() ? InitiatedByMainFrame::Yes : InitiatedByMainFrame::Unknown;
</span><span class="cx">         
</span><del>-        FrameLoadRequest frameLoadRequest { initiatingDocument, securityOrigin, WTFMove(resourceRequest), "_self"_s, initiatedByMainFrame };
</del><ins>+        FrameLoadRequest frameLoadRequest { initiatingDocument, securityOrigin, WTFMove(resourceRequest), selfTargetFrameName(), initiatedByMainFrame };
</ins><span class="cx">         frameLoadRequest.setLockHistory(lockHistory);
</span><span class="cx">         frameLoadRequest.setLockBackForwardList(lockBackForwardList);
</span><span class="cx">         frameLoadRequest.disableNavigationToInvalidURL();
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLElement.cpp (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLElement.cpp    2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/mathml/MathMLElement.cpp       2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx">             const auto& url = stripLeadingAndTrailingHTMLSpaces(href);
</span><span class="cx">             event.setDefaultHandled();
</span><span class="cx">             if (auto* frame = document().frame())
</span><del>-                frame->loader().changeLocation(document().completeURL(url), "_self", &event, ReferrerPolicy::EmptyString, document().shouldOpenExternalURLsPolicyToPropagate());
</del><ins>+                frame->loader().changeLocation(document().completeURL(url), selfTargetFrameName(), &event, ReferrerPolicy::EmptyString, document().shouldOpenExternalURLsPolicyToPropagate());
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp  2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/page/DOMWindow.cpp     2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -2539,7 +2539,7 @@
</span><span class="cx">     if (created) {
</span><span class="cx">         ResourceRequest resourceRequest { completedURL, referrer, ResourceRequestCachePolicy::UseProtocolCachePolicy };
</span><span class="cx">         FrameLoader::addSameSiteInfoToRequestIfNeeded(resourceRequest, openerFrame.document());
</span><del>-        FrameLoadRequest frameLoadRequest { *activeWindow.document(), activeWindow.document()->securityOrigin(), WTFMove(resourceRequest), "_self"_s, initiatedByMainFrame };
</del><ins>+        FrameLoadRequest frameLoadRequest { *activeWindow.document(), activeWindow.document()->securityOrigin(), WTFMove(resourceRequest), selfTargetFrameName(), initiatedByMainFrame };
</ins><span class="cx">         frameLoadRequest.setShouldOpenExternalURLsPolicy(activeDocument->shouldOpenExternalURLsPolicyToPropagate());
</span><span class="cx">         newFrame->loader().changeLocation(WTFMove(frameLoadRequest));
</span><span class="cx">     } else if (!urlString.isEmpty()) {
</span><span class="lines">@@ -2608,9 +2608,9 @@
</span><span class="cx">     // Get the target frame for the special cases of _top and _parent.
</span><span class="cx">     // In those cases, we schedule a location change right now and return early.
</span><span class="cx">     RefPtr<Frame> targetFrame;
</span><del>-    if (equalIgnoringASCIICase(frameName, "_top"))
</del><ins>+    if (isTopTargetFrameName(frameName))
</ins><span class="cx">         targetFrame = &frame->tree().top();
</span><del>-    else if (equalIgnoringASCIICase(frameName, "_parent")) {
</del><ins>+    else if (isParentTargetFrameName(frameName)) {
</ins><span class="cx">         if (RefPtr parent = frame->tree().parent())
</span><span class="cx">             targetFrame = parent;
</span><span class="cx">         else
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameTree.cpp (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameTree.cpp  2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/page/FrameTree.cpp     2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx"> AtomString FrameTree::uniqueChildName(const AtomString& requestedName) const
</span><span class="cx"> {
</span><span class="cx">     // If the requested name (the frame's "name" attribute) is unique, just use that.
</span><del>-    if (!requestedName.isEmpty() && !child(requestedName) && !equalIgnoringASCIICase(requestedName, "_blank"))
</del><ins>+    if (!requestedName.isEmpty() && !child(requestedName) && !isBlankTargetFrameName(requestedName))
</ins><span class="cx">         return requestedName;
</span><span class="cx"> 
</span><span class="cx">     // The "name" attribute was not unique or absent. Generate a name based on a counter on the main frame that gets reset
</span><span class="lines">@@ -237,18 +237,17 @@
</span><span class="cx"> 
</span><span class="cx"> Frame* FrameTree::find(const AtomString& name, Frame& activeFrame) const
</span><span class="cx"> {
</span><del>-    // FIXME: _current is not part of the HTML specification.
-    if (equalIgnoringASCIICase(name, "_self") || name == "_current" || name.isEmpty())
</del><ins>+    if (isSelfTargetFrameName(name))
</ins><span class="cx">         return &m_thisFrame;
</span><span class="cx">     
</span><del>-    if (equalIgnoringASCIICase(name, "_top"))
</del><ins>+    if (isTopTargetFrameName(name))
</ins><span class="cx">         return &top();
</span><span class="cx">     
</span><del>-    if (equalIgnoringASCIICase(name, "_parent"))
</del><ins>+    if (isParentTargetFrameName(name))
</ins><span class="cx">         return parent() ? parent() : &m_thisFrame;
</span><span class="cx"> 
</span><del>-    // Since "_blank" should never be any frame's name, the following is only an optimization.
-    if (equalIgnoringASCIICase(name, "_blank"))
</del><ins>+    // Since "_blank" cannot be a frame's name, this check is an optimization, not for correctness.
+    if (isBlankTargetFrameName(name))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     // Search subtree starting with this frame first.
</span><span class="lines">@@ -264,11 +263,11 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Search the entire tree of each of the other pages in this namespace.
</span><del>-    // FIXME: Is random order OK?
</del><span class="cx">     Page* page = m_thisFrame.page();
</span><span class="cx">     if (!page)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><ins>+    // FIXME: These pages are searched in random order; that doesn't seem good. Maybe use order of creation?
</ins><span class="cx">     for (auto& otherPage : page->group().pages()) {
</span><span class="cx">         if (&otherPage == page || otherPage.isClosing())
</span><span class="cx">             continue;
</span><span class="lines">@@ -460,6 +459,38 @@
</span><span class="cx">     return *frame;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ASCIILiteral blankTargetFrameName()
+{
+    return "_blank"_s;
+}
+
+// FIXME: Is it important to have this? Can't we just use the empty string everywhere this is used, instead?
+ASCIILiteral selfTargetFrameName()
+{
+    return "_self"_s;
+}
+
+bool isBlankTargetFrameName(StringView name)
+{
+    return equalLettersIgnoringASCIICase(name, "_blank");
+}
+
+bool isParentTargetFrameName(StringView name)
+{
+    return equalLettersIgnoringASCIICase(name, "_parent");
+}
+
+bool isSelfTargetFrameName(StringView name)
+{
+    // FIXME: Some day we should remove _current, which is not part of the HTML specification.
+    return name.isEmpty() || equalLettersIgnoringASCIICase(name, "_self") || name == "_current";
+}
+
+bool isTopTargetFrameName(StringView name)
+{
+    return equalLettersIgnoringASCIICase(name, "_top");
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameTreeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameTree.h (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameTree.h    2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/page/FrameTree.h       2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -107,6 +107,14 @@
</span><span class="cx">     mutable uint64_t m_frameIDGenerator { 0 };
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+ASCIILiteral blankTargetFrameName();
+ASCIILiteral selfTargetFrameName();
+
+bool isBlankTargetFrameName(StringView);
+bool isParentTargetFrameName(StringView);
+bool isSelfTargetFrameName(StringView);
+bool isTopTargetFrameName(StringView);
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TREE_DEBUGGING)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAElement.cpp (285037 => 285038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAElement.cpp 2021-10-29 17:20:54 UTC (rev 285037)
+++ trunk/Source/WebCore/svg/SVGAElement.cpp    2021-10-29 17:27:20 UTC (rev 285038)
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx"> 
</span><span class="cx">             String target = this->target();
</span><span class="cx">             if (target.isEmpty() && attributeWithoutSynchronization(XLinkNames::showAttr) == "new")
</span><del>-                target = "_blank";
</del><ins>+                target = blankTargetFrameName();
</ins><span class="cx">             event.setDefaultHandled();
</span><span class="cx"> 
</span><span class="cx">             RefPtr frame = document().frame();
</span></span></pre>
</div>
</div>

</body>
</html>