Title: [258869] trunk/Source
Revision
258869
Author
[email protected]
Date
2020-03-23 12:46:57 -0700 (Mon, 23 Mar 2020)

Log Message

Rename blankURL to aboutBlankURL
https://bugs.webkit.org/show_bug.cgi?id=209344

Reviewed by Darin Adler.

Source/WebCore:

No change of behavior.

* dom/Document.cpp:
(WebCore::Document::setURL):
(WebCore::Document::completeURL const):
(WebCore::Document::ensureTemplateDocument):
* dom/Document.h:
(WebCore::Document::urlForBindings const):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::parserContextForElement):
* dom/Node.cpp:
(WebCore::Node::baseURI const):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readWebArchive):
* editing/markup.cpp:
(WebCore::createFragmentFromMarkup):
* html/DOMURL.cpp:
(WebCore::DOMURL::create):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::openURL):
(WebCore::HTMLFrameElementBase::location const):
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::filterScriptToken):
(WebCore::XSSAuditor::filterObjectToken):
(WebCore::XSSAuditor::filterParamToken):
(WebCore::XSSAuditor::filterEmbedToken):
(WebCore::XSSAuditor::filterFormToken):
(WebCore::XSSAuditor::filterInputToken):
(WebCore::XSSAuditor::filterButtonToken):
(WebCore::XSSAuditor::isLikelySafeResource):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::serverRedirectSourceForHistory const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):
* loader/HistoryController.cpp:
(WebCore::HistoryController::currentItemShouldBeReplaced const):
(WebCore::HistoryController::initializeItem):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::requestFrame):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::createFromSelection):
* page/Location.cpp:
(WebCore::Location::url const):
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner):
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::markupToCFHTML):
* svg/SVGImageLoader.cpp:
(WebCore::SVGImageLoader::sourceURI const):

Source/WebKit:

* UIProcess/API/C/WKPage.cpp:
(WKPageLoadPlainTextStringWithUserData):
* UIProcess/API/C/WKPageGroup.cpp:
(WKPageGroupAddUserStyleSheet):
(WKPageGroupAddUserScript):
* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_load_plain_text):
* UIProcess/Inspector/WebPageDebuggable.cpp:
(WebKit::WebPageDebuggable::url const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadDataWithNavigationShared):
(WebKit::WebPageProxy::loadWebArchiveData):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadData):
(WebKit::WebPage::loadAlternateHTML):
(WebKit::WebPage::dumpHistoryForTesting):
(WebKit::WebPage::addUserScript):
(WebKit::WebPage::addUserStyleSheet):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::updateGlobalHistory):
* WebView/WebFrame.mm:
(-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]):

Source/WTF:

Rename blankURL to aboutBlankURL and allow using it without WTF:: prefix.

* wtf/URL.cpp:
(WTF::aboutBlankURL):
(WTF::blankURL): Deleted.
* wtf/URL.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (258868 => 258869)


--- trunk/Source/WTF/ChangeLog	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WTF/ChangeLog	2020-03-23 19:46:57 UTC (rev 258869)
@@ -1,3 +1,17 @@
+2020-03-23  youenn fablet  <[email protected]>
+
+        Rename blankURL to aboutBlankURL
+        https://bugs.webkit.org/show_bug.cgi?id=209344
+
+        Reviewed by Darin Adler.
+
+        Rename blankURL to aboutBlankURL and allow using it without WTF:: prefix.
+
+        * wtf/URL.cpp:
+        (WTF::aboutBlankURL):
+        (WTF::blankURL): Deleted.
+        * wtf/URL.h:
+
 2020-03-23  Rob Buis  <[email protected]>
 
         XMLHttpRequest: getAllResponseHeaders() sorting

Modified: trunk/Source/WTF/wtf/URL.cpp (258868 => 258869)


--- trunk/Source/WTF/wtf/URL.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WTF/wtf/URL.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -867,7 +867,7 @@
         && (url[4] == ':' || (isASCIIAlphaCaselessEqual(url[4], 's') && length >= 6 && url[5] == ':'));
 }
 
-const URL& blankURL()
+const URL& aboutBlankURL()
 {
     static NeverDestroyed<URL> staticBlankURL(URL(), "about:blank");
     return staticBlankURL;

Modified: trunk/Source/WTF/wtf/URL.h (258868 => 258869)


--- trunk/Source/WTF/wtf/URL.h	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WTF/wtf/URL.h	2020-03-23 19:46:57 UTC (rev 258869)
@@ -259,7 +259,7 @@
 WTF_EXPORT_PRIVATE bool protocolHostAndPortAreEqual(const URL&, const URL&);
 WTF_EXPORT_PRIVATE bool hostsAreEqual(const URL&, const URL&);
 
-WTF_EXPORT_PRIVATE const URL& blankURL();
+WTF_EXPORT_PRIVATE const URL& aboutBlankURL();
 WTF_EXPORT_PRIVATE const URL& aboutSrcDocURL();
 
 // Functions to do URL operations on strings.
@@ -387,3 +387,6 @@
 template<> struct HashTraits<URL>;
 
 } // namespace WTF
+
+using WTF::aboutBlankURL;
+using WTF::aboutSrcDocURL;

Modified: trunk/Source/WebCore/ChangeLog (258868 => 258869)


--- trunk/Source/WebCore/ChangeLog	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/ChangeLog	2020-03-23 19:46:57 UTC (rev 258869)
@@ -1,5 +1,64 @@
 2020-03-23  youenn fablet  <[email protected]>
 
+        Rename blankURL to aboutBlankURL
+        https://bugs.webkit.org/show_bug.cgi?id=209344
+
+        Reviewed by Darin Adler.
+
+        No change of behavior.
+
+        * dom/Document.cpp:
+        (WebCore::Document::setURL):
+        (WebCore::Document::completeURL const):
+        (WebCore::Document::ensureTemplateDocument):
+        * dom/Document.h:
+        (WebCore::Document::urlForBindings const):
+        * dom/InlineStyleSheetOwner.cpp:
+        (WebCore::parserContextForElement):
+        * dom/Node.cpp:
+        (WebCore::Node::baseURI const):
+        * editing/cocoa/WebContentReaderCocoa.mm:
+        (WebCore::WebContentReader::readWebArchive):
+        * editing/markup.cpp:
+        (WebCore::createFragmentFromMarkup):
+        * html/DOMURL.cpp:
+        (WebCore::DOMURL::create):
+        * html/HTMLFrameElementBase.cpp:
+        (WebCore::HTMLFrameElementBase::openURL):
+        (WebCore::HTMLFrameElementBase::location const):
+        * html/parser/XSSAuditor.cpp:
+        (WebCore::XSSAuditor::filterScriptToken):
+        (WebCore::XSSAuditor::filterObjectToken):
+        (WebCore::XSSAuditor::filterParamToken):
+        (WebCore::XSSAuditor::filterEmbedToken):
+        (WebCore::XSSAuditor::filterFormToken):
+        (WebCore::XSSAuditor::filterInputToken):
+        (WebCore::XSSAuditor::filterButtonToken):
+        (WebCore::XSSAuditor::isLikelySafeResource):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::maybeLoadEmpty):
+        * loader/DocumentLoader.h:
+        (WebCore::DocumentLoader::serverRedirectSourceForHistory const):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadWithDocumentLoader):
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::currentItemShouldBeReplaced const):
+        (WebCore::HistoryController::initializeItem):
+        * loader/SubframeLoader.cpp:
+        (WebCore::SubframeLoader::requestFrame):
+        * loader/archive/cf/LegacyWebArchive.cpp:
+        (WebCore::LegacyWebArchive::createFromSelection):
+        * page/Location.cpp:
+        (WebCore::Location::url const):
+        * page/SecurityPolicy.cpp:
+        (WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner):
+        * platform/win/ClipboardUtilitiesWin.cpp:
+        (WebCore::markupToCFHTML):
+        * svg/SVGImageLoader.cpp:
+        (WebCore::SVGImageLoader::sourceURI const):
+
+2020-03-23  youenn fablet  <[email protected]>
+
         Remove DOMCache::m_records
         https://bugs.webkit.org/show_bug.cgi?id=209425
 

Modified: trunk/Source/WebCore/dom/Document.cpp (258868 => 258869)


--- trunk/Source/WebCore/dom/Document.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/dom/Document.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -3236,7 +3236,7 @@
 
 void Document::setURL(const URL& url)
 {
-    const URL& newURL = url.isEmpty() ? WTF::blankURL() : url;
+    const URL& newURL = url.isEmpty() ? aboutBlankURL() : url;
     if (newURL == m_url)
         return;
 
@@ -5210,7 +5210,7 @@
     // See also [CSS]StyleSheet::completeURL(const String&)
     if (url.isNull())
         return URL();
-    const URL& baseURL = ((baseURLOverride.isEmpty() || baseURLOverride == WTF::blankURL()) && parentDocument()) ? parentDocument()->baseURL() : baseURLOverride;
+    const URL& baseURL = ((baseURLOverride.isEmpty() || baseURLOverride == aboutBlankURL()) && parentDocument()) ? parentDocument()->baseURL() : baseURLOverride;
     if (!m_decoder || forceUTF8 == ForceUTF8::Yes)
         return URL(baseURL, url);
     return URL(baseURL, url, m_decoder->encodingForURLParsing());
@@ -7063,9 +7063,9 @@
         return const_cast<Document&>(*document);
 
     if (isHTMLDocument())
-        m_templateDocument = HTMLDocument::create(nullptr, WTF::blankURL());
+        m_templateDocument = HTMLDocument::create(nullptr, aboutBlankURL());
     else
-        m_templateDocument = create(WTF::blankURL());
+        m_templateDocument = create(aboutBlankURL());
 
     m_templateDocument->setContextDocument(contextDocument());
     m_templateDocument->setTemplateDocumentHost(this); // balanced in dtor.

Modified: trunk/Source/WebCore/dom/Document.h (258868 => 258869)


--- trunk/Source/WebCore/dom/Document.h	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/dom/Document.h	2020-03-23 19:46:57 UTC (rev 258869)
@@ -684,7 +684,7 @@
 
     const URL& url() const final { return m_url; }
     void setURL(const URL&);
-    const URL& urlForBindings() const { return m_url.isEmpty() ? WTF::blankURL() : m_url; }
+    const URL& urlForBindings() const { return m_url.isEmpty() ? aboutBlankURL() : m_url; }
 
     // To understand how these concepts relate to one another, please see the
     // comments surrounding their declaration.

Modified: trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp (258868 => 258869)


--- trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -50,7 +50,7 @@
 {
     auto* shadowRoot = element.containingShadowRoot();
     // User agent shadow trees can't contain document-relative URLs. Use blank URL as base allowing cross-document sharing.
-    auto& baseURL = shadowRoot && shadowRoot->mode() == ShadowRootMode::UserAgent ? WTF::blankURL() : element.document().baseURL();
+    auto& baseURL = shadowRoot && shadowRoot->mode() == ShadowRootMode::UserAgent ? aboutBlankURL() : element.document().baseURL();
 
     CSSParserContext result = CSSParserContext { element.document(), baseURL, element.document().characterSetWithUTF8Fallback() };
     if (shadowRoot && shadowRoot->mode() == ShadowRootMode::UserAgent)

Modified: trunk/Source/WebCore/dom/Node.cpp (258868 => 258869)


--- trunk/Source/WebCore/dom/Node.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/dom/Node.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -1333,7 +1333,7 @@
 const URL& Node::baseURI() const
 {
     auto& url = ""
-    return url.isNull() ? WTF::blankURL() : url;
+    return url.isNull() ? aboutBlankURL() : url;
 }
 
 bool Node::isEqualNode(Node* other) const

Modified: trunk/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm (258868 => 258869)


--- trunk/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm	2020-03-23 19:46:57 UTC (rev 258869)
@@ -529,7 +529,7 @@
     String sanitizedMarkup = sanitizeMarkupWithArchive(frame, *frame.document(), *result, msoListQuirksForMarkup(), [&] (const String& type) {
         return frame.loader().client().canShowMIMETypeAsHTML(type);
     });
-    fragment = createFragmentFromMarkup(*frame.document(), sanitizedMarkup, WTF::blankURL(), DisallowScriptingAndPluginContent);
+    fragment = createFragmentFromMarkup(*frame.document(), sanitizedMarkup, aboutBlankURL(), DisallowScriptingAndPluginContent);
 
     if (!fragment)
         return false;

Modified: trunk/Source/WebCore/editing/markup.cpp (258868 => 258869)


--- trunk/Source/WebCore/editing/markup.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/editing/markup.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -1021,7 +1021,7 @@
 
     fragment->parseHTML(markup, fakeBody.ptr(), parserContentPolicy);
     restoreAttachmentElementsInFragment(fragment);
-    if (!baseURL.isEmpty() && baseURL != WTF::blankURL() && baseURL != document.baseURL())
+    if (!baseURL.isEmpty() && baseURL != aboutBlankURL() && baseURL != document.baseURL())
         completeURLs(fragment.ptr(), baseURL);
 
     return fragment;

Modified: trunk/Source/WebCore/html/DOMURL.cpp (258868 => 258869)


--- trunk/Source/WebCore/html/DOMURL.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/html/DOMURL.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -63,7 +63,7 @@
 
 ExceptionOr<Ref<DOMURL>> DOMURL::create(const String& url)
 {
-    URL baseURL { WTF::blankURL() };
+    URL baseURL { aboutBlankURL() };
     URL completeURL { baseURL, url };
     if (!completeURL.isValid())
         return Exception { TypeError };

Modified: trunk/Source/WebCore/html/HTMLFrameElementBase.cpp (258868 => 258869)


--- trunk/Source/WebCore/html/HTMLFrameElementBase.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/html/HTMLFrameElementBase.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -87,7 +87,7 @@
         return;
 
     if (m_URL.isEmpty())
-        m_URL = WTF::blankURL().string();
+        m_URL = aboutBlankURL().string();
 
     RefPtr<Frame> parentFrame = document().frame();
     if (!parentFrame)
@@ -153,7 +153,7 @@
 URL HTMLFrameElementBase::location() const
 {
     if (hasAttributeWithoutSynchronization(srcdocAttr))
-        return WTF::aboutSrcDocURL();
+        return aboutSrcDocURL();
     return document().completeURL(attributeWithoutSynchronization(srcAttr));
 }
 

Modified: trunk/Source/WebCore/html/parser/XSSAuditor.cpp (258868 => 258869)


--- trunk/Source/WebCore/html/parser/XSSAuditor.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/html/parser/XSSAuditor.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -441,9 +441,9 @@
 
     bool didBlockScript = false;
     if (m_wasScriptTagFoundInRequest) {
-        didBlockScript |= eraseAttributeIfInjected(request, srcAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute);
-        didBlockScript |= eraseAttributeIfInjected(request, SVGNames::hrefAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute);
-        didBlockScript |= eraseAttributeIfInjected(request, XLinkNames::hrefAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute);
+        didBlockScript |= eraseAttributeIfInjected(request, srcAttr, aboutBlankURL().string(), TruncationStyle::SrcLikeAttribute);
+        didBlockScript |= eraseAttributeIfInjected(request, SVGNames::hrefAttr, aboutBlankURL().string(), TruncationStyle::SrcLikeAttribute);
+        didBlockScript |= eraseAttributeIfInjected(request, XLinkNames::hrefAttr, aboutBlankURL().string(), TruncationStyle::SrcLikeAttribute);
     }
 
     return didBlockScript;
@@ -456,7 +456,7 @@
 
     bool didBlockScript = false;
     if (isContainedInRequest(canonicalizedSnippetForTagName(request))) {
-        didBlockScript |= eraseAttributeIfInjected(request, dataAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute);
+        didBlockScript |= eraseAttributeIfInjected(request, dataAttr, aboutBlankURL().string(), TruncationStyle::SrcLikeAttribute);
         didBlockScript |= eraseAttributeIfInjected(request, typeAttr);
         didBlockScript |= eraseAttributeIfInjected(request, classidAttr);
     }
@@ -476,7 +476,7 @@
     if (!HTMLParamElement::isURLParameter(String(nameAttribute.value)))
         return false;
 
-    return eraseAttributeIfInjected(request, valueAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute);
+    return eraseAttributeIfInjected(request, valueAttr, aboutBlankURL().string(), TruncationStyle::SrcLikeAttribute);
 }
 
 bool XSSAuditor::filterEmbedToken(const FilterTokenRequest& request)
@@ -487,7 +487,7 @@
     bool didBlockScript = false;
     if (isContainedInRequest(canonicalizedSnippetForTagName(request))) {
         didBlockScript |= eraseAttributeIfInjected(request, codeAttr, String(), TruncationStyle::SrcLikeAttribute);
-        didBlockScript |= eraseAttributeIfInjected(request, srcAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute);
+        didBlockScript |= eraseAttributeIfInjected(request, srcAttr, aboutBlankURL().string(), TruncationStyle::SrcLikeAttribute);
         didBlockScript |= eraseAttributeIfInjected(request, typeAttr);
     }
     return didBlockScript;
@@ -539,7 +539,7 @@
     ASSERT(request.token.type() == HTMLToken::StartTag);
     ASSERT(hasName(request.token, formTag));
 
-    return eraseAttributeIfInjected(request, actionAttr, WTF::blankURL().string());
+    return eraseAttributeIfInjected(request, actionAttr, aboutBlankURL().string());
 }
 
 bool XSSAuditor::filterInputToken(const FilterTokenRequest& request)
@@ -547,7 +547,7 @@
     ASSERT(request.token.type() == HTMLToken::StartTag);
     ASSERT(hasName(request.token, inputTag));
 
-    return eraseAttributeIfInjected(request, formactionAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute);
+    return eraseAttributeIfInjected(request, formactionAttr, aboutBlankURL().string(), TruncationStyle::SrcLikeAttribute);
 }
 
 bool XSSAuditor::filterButtonToken(const FilterTokenRequest& request)
@@ -555,7 +555,7 @@
     ASSERT(request.token.type() == HTMLToken::StartTag);
     ASSERT(hasName(request.token, buttonTag));
 
-    return eraseAttributeIfInjected(request, formactionAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute);
+    return eraseAttributeIfInjected(request, formactionAttr, aboutBlankURL().string(), TruncationStyle::SrcLikeAttribute);
 }
 
 bool XSSAuditor::eraseDangerousAttributesIfInjected(const FilterTokenRequest& request)
@@ -733,7 +733,7 @@
     // Give empty URLs and about:blank a pass. Making a resourceURL from an
     // empty string below will likely later fail the "no query args test" as
     // it inherits the document's query args.
-    if (url.isEmpty() || url == WTF::blankURL().string())
+    if (url.isEmpty() || url == aboutBlankURL().string())
         return true;
 
     // If the resource is loaded from the same host as the enclosing page, it's

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (258868 => 258869)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -1783,7 +1783,7 @@
         return false;
 
     if (m_request.url().isEmpty() && !frameLoader()->stateMachine().creatingInitialEmptyDocument()) {
-        m_request.setURL(WTF::blankURL());
+        m_request.setURL(aboutBlankURL());
         if (isLoadingMainResource())
             frameLoader()->client().dispatchDidChangeProvisionalURL();
     }

Modified: trunk/Source/WebCore/loader/DocumentLoader.h (258868 => 258869)


--- trunk/Source/WebCore/loader/DocumentLoader.h	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/loader/DocumentLoader.h	2020-03-23 19:46:57 UTC (rev 258869)
@@ -270,7 +270,7 @@
     String clientRedirectDestinationForHistory() const { return urlForHistory(); }
     void setClientRedirectSourceForHistory(const String& clientRedirectSourceForHistory) { m_clientRedirectSourceForHistory = clientRedirectSourceForHistory; }
     
-    String serverRedirectSourceForHistory() const { return (urlForHistory() == url() || url() == WTF::blankURL()) ? String() : urlForHistory().string(); } // null if no server redirect occurred.
+    String serverRedirectSourceForHistory() const { return (urlForHistory() == url() || url() == aboutBlankURL()) ? String() : urlForHistory().string(); } // null if no server redirect occurred.
     String serverRedirectDestinationForHistory() const { return url(); }
 
     bool didCreateGlobalHistoryEntry() const { return m_didCreateGlobalHistoryEntry; }

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (258868 => 258869)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -1582,7 +1582,7 @@
 
     // Only the first iframe navigation or the first iframe navigation after about:blank should be reported.
     // https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface
-    if (m_shouldReportResourceTimingToParentFrame && !m_previousURL.isNull() && m_previousURL != WTF::blankURL())
+    if (m_shouldReportResourceTimingToParentFrame && !m_previousURL.isNull() && m_previousURL != aboutBlankURL())
         m_shouldReportResourceTimingToParentFrame = false;
 
     // Log main frame navigation types.

Modified: trunk/Source/WebCore/loader/HistoryController.cpp (258868 => 258869)


--- trunk/Source/WebCore/loader/HistoryController.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/loader/HistoryController.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -614,7 +614,7 @@
     //  "If the browsing context's session history contains only one Document,
     //   and that was the about:blank Document created when the browsing context
     //   was created, then the navigation must be done with replacement enabled."
-    return m_currentItem && !m_previousItem && equalIgnoringASCIICase(m_currentItem->urlString(), WTF::blankURL());
+    return m_currentItem && !m_previousItem && equalIgnoringASCIICase(m_currentItem->urlString(), aboutBlankURL());
 }
 
 void HistoryController::clearPreviousItem()
@@ -653,9 +653,9 @@
     // Later we may want to learn to live with nil for URL.
     // See bug 3368236 and related bugs for more information.
     if (url.isEmpty()) 
-        url = ""
+        url = ""
     if (originalURL.isEmpty())
-        originalURL = WTF::blankURL();
+        originalURL = aboutBlankURL();
     
     StringWithDirection title = documentLoader->title();
 

Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (258868 => 258869)


--- trunk/Source/WebCore/loader/SubframeLoader.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -80,12 +80,12 @@
     URL url;
     if (WTF::protocolIsJavaScript(urlString)) {
         scriptURL = completeURL(urlString); // completeURL() encodes the URL.
-        url = ""
+        url = ""
     } else
         url = ""
 
     if (shouldConvertInvalidURLsToBlank() && !url.isValid())
-        url = ""
+        url = ""
 
     // If we will schedule a _javascript_ URL load, we need to delay the firing of the load event at least until we've run the _javascript_ in the URL.
     CompletionHandlerCallingScope stopDelayingLoadEvent;

Modified: trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp (258868 => 258869)


--- trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -612,7 +612,7 @@
     // Wrap the frameset document in an iframe so it can be pasted into
     // another document (which will have a body or frameset of its own). 
     String iframeMarkup = "<iframe frameborder=\"no\" marginwidth=\"0\" marginheight=\"0\" width=\"98%%\" height=\"98%%\" src="" + frame->loader().documentLoader()->response().url().string() + "\"></iframe>";
-    auto iframeResource = ArchiveResource::create(utf8Buffer(iframeMarkup), WTF::blankURL(), "text/html", "UTF-8", String());
+    auto iframeResource = ArchiveResource::create(utf8Buffer(iframeMarkup), aboutBlankURL(), "text/html", "UTF-8", String());
 
     Vector<Ref<LegacyWebArchive>> subframeArchives;
     subframeArchives.reserveInitialCapacity(1);

Modified: trunk/Source/WebCore/page/Location.cpp (258868 => 258869)


--- trunk/Source/WebCore/page/Location.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/page/Location.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -50,11 +50,11 @@
 inline const URL& Location::url() const
 {
     if (!frame())
-        return WTF::blankURL();
+        return aboutBlankURL();
 
     const URL& url = ""
     if (!url.isValid())
-        return WTF::blankURL(); // Use "about:blank" while the page is still loading (before we have a frame).
+        return aboutBlankURL(); // Use "about:blank" while the page is still loading (before we have a frame).
 
     return url;
 }

Modified: trunk/Source/WebCore/page/SecurityPolicy.cpp (258868 => 258869)


--- trunk/Source/WebCore/page/SecurityPolicy.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/page/SecurityPolicy.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -167,7 +167,7 @@
     //
     // Note: We generalize this to invalid URLs because we treat such URLs as about:blank.
     // FIXME: We also allow some URLs like "about:BLANK". We should probably block navigation to these URLs, see rdar://problem/57966056.
-    return url.isEmpty() || url.isAboutBlank() || url.isAboutSrcDoc() || equalIgnoringASCIICase(url.string(), WTF::blankURL());
+    return url.isEmpty() || url.isAboutBlank() || url.isAboutSrcDoc() || equalIgnoringASCIICase(url.string(), aboutBlankURL());
 }
 
 bool SecurityPolicy::isBaseURLSchemeAllowed(const URL& url)

Modified: trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp (258868 => 258869)


--- trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -272,7 +272,7 @@
     const char* startMarkup = "<HTML>\n<BODY>\n<!--StartFragment-->\n";
     const char* endMarkup = "\n<!--EndFragment-->\n</BODY>\n</HTML>";
 
-    CString sourceURLUTF8 = srcURL == WTF::blankURL() ? "" : srcURL.utf8();
+    CString sourceURLUTF8 = srcURL == aboutBlankURL() ? "" : srcURL.utf8();
     CString markupUTF8 = markup.utf8();
 
     // calculate offsets

Modified: trunk/Source/WebCore/svg/SVGImageLoader.cpp (258868 => 258869)


--- trunk/Source/WebCore/svg/SVGImageLoader.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebCore/svg/SVGImageLoader.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -47,7 +47,7 @@
 String SVGImageLoader::sourceURI(const AtomString& attribute) const
 {
     URL base = element().baseURI();
-    if (base != WTF::blankURL())
+    if (base != aboutBlankURL())
         return URL(base, stripLeadingAndTrailingHTMLSpaces(attribute)).string();
     return element().document().completeURL(stripLeadingAndTrailingHTMLSpaces(attribute));
 }

Modified: trunk/Source/WebKit/ChangeLog (258868 => 258869)


--- trunk/Source/WebKit/ChangeLog	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebKit/ChangeLog	2020-03-23 19:46:57 UTC (rev 258869)
@@ -1,3 +1,29 @@
+2020-03-23  youenn fablet  <[email protected]>
+
+        Rename blankURL to aboutBlankURL
+        https://bugs.webkit.org/show_bug.cgi?id=209344
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageLoadPlainTextStringWithUserData):
+        * UIProcess/API/C/WKPageGroup.cpp:
+        (WKPageGroupAddUserStyleSheet):
+        (WKPageGroupAddUserScript):
+        * UIProcess/API/glib/WebKitWebView.cpp:
+        (webkit_web_view_load_plain_text):
+        * UIProcess/Inspector/WebPageDebuggable.cpp:
+        (WebKit::WebPageDebuggable::url const):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::loadDataWithNavigationShared):
+        (WebKit::WebPageProxy::loadWebArchiveData):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::loadData):
+        (WebKit::WebPage::loadAlternateHTML):
+        (WebKit::WebPage::dumpHistoryForTesting):
+        (WebKit::WebPage::addUserScript):
+        (WebKit::WebPage::addUserStyleSheet):
+
 2020-03-23  Alex Christensen  <[email protected]>
 
         Add SPI to move localStorage to a different domain

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp (258868 => 258869)


--- trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -261,7 +261,7 @@
 
 void WKPageLoadPlainTextStringWithUserData(WKPageRef pageRef, WKStringRef plainTextStringRef, WKTypeRef userDataRef)
 {
-    loadString(pageRef, plainTextStringRef, "text/plain"_s, WTF::blankURL().string(), userDataRef);
+    loadString(pageRef, plainTextStringRef, "text/plain"_s, aboutBlankURL().string(), userDataRef);
 }
 
 void WKPageLoadWebArchiveData(WKPageRef pageRef, WKDataRef webArchiveDataRef)

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPageGroup.cpp (258868 => 258869)


--- trunk/Source/WebKit/UIProcess/API/C/WKPageGroup.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPageGroup.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -77,7 +77,7 @@
     auto whitelist = toImpl(whitelistedURLPatterns);
     auto blacklist = toImpl(blacklistedURLPatterns);
 
-    Ref<API::UserStyleSheet> userStyleSheet = API::UserStyleSheet::create(WebCore::UserStyleSheet { source, (baseURLString.isEmpty() ? WTF::blankURL() :  URL(URL(), baseURLString)), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), toUserContentInjectedFrames(injectedFrames), WebCore::UserStyleUserLevel }, API::ContentWorld::pageContentWorld());
+    Ref<API::UserStyleSheet> userStyleSheet = API::UserStyleSheet::create(WebCore::UserStyleSheet { source, (baseURLString.isEmpty() ? aboutBlankURL() :  URL(URL(), baseURLString)), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), toUserContentInjectedFrames(injectedFrames), WebCore::UserStyleUserLevel }, API::ContentWorld::pageContentWorld());
 
     toImpl(pageGroupRef)->userContentController().addUserStyleSheet(userStyleSheet.get());
 }
@@ -98,7 +98,7 @@
     auto whitelist = toImpl(whitelistedURLPatterns);
     auto blacklist = toImpl(blacklistedURLPatterns);
     
-    auto url = "" ? WTF::blankURL() :  URL(URL(), baseURLString);
+    auto url = "" ? aboutBlankURL() :  URL(URL(), baseURLString);
     Ref<API::UserScript> userScript = API::UserScript::create(WebCore::UserScript { WTFMove(source), WTFMove(url), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), toUserScriptInjectionTime(injectionTime), toUserContentInjectedFrames(injectedFrames) }, API::ContentWorld::pageContentWorld());
     toImpl(pageGroupRef)->userContentController().addUserScript(userScript.get(), InjectUserScriptImmediately::No);
 }

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp (258868 => 258869)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -2989,7 +2989,7 @@
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
     g_return_if_fail(plainText);
 
-    getPage(webView).loadData({ reinterpret_cast<const uint8_t*>(plainText), plainText ? strlen(plainText) : 0 }, "text/plain"_s, "UTF-8"_s, WTF::blankURL().string());
+    getPage(webView).loadData({ reinterpret_cast<const uint8_t*>(plainText), plainText ? strlen(plainText) : 0 }, "text/plain"_s, "UTF-8"_s, aboutBlankURL().string());
 }
 
 /**

Modified: trunk/Source/WebKit/UIProcess/Inspector/WebPageDebuggable.cpp (258868 => 258869)


--- trunk/Source/WebKit/UIProcess/Inspector/WebPageDebuggable.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebKit/UIProcess/Inspector/WebPageDebuggable.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -55,11 +55,11 @@
 String WebPageDebuggable::url() const
 {
     if (!m_page.mainFrame())
-        return WTF::blankURL().string();
+        return aboutBlankURL().string();
 
     String url = ""
     if (url.isEmpty())
-        return WTF::blankURL().string();
+        return aboutBlankURL().string();
 
     return url;
 }

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (258868 => 258869)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -1420,7 +1420,7 @@
 
     auto transaction = m_pageLoadState.transaction();
 
-    m_pageLoadState.setPendingAPIRequest(transaction, { navigation.navigationID(), !baseURL.isEmpty() ? baseURL : WTF::blankURL().string() });
+    m_pageLoadState.setPendingAPIRequest(transaction, { navigation.navigationID(), !baseURL.isEmpty() ? baseURL : aboutBlankURL().string() });
 
     LoadParameters loadParameters;
     loadParameters.navigationID = navigation.navigationID();
@@ -1497,7 +1497,7 @@
         launchProcess({ }, ProcessLaunchReason::InitialProcess);
 
     auto transaction = m_pageLoadState.transaction();
-    m_pageLoadState.setPendingAPIRequest(transaction, { 0, WTF::blankURL().string() });
+    m_pageLoadState.setPendingAPIRequest(transaction, { 0, aboutBlankURL().string() });
 
     LoadParameters loadParameters;
     loadParameters.navigationID = 0;

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (258868 => 258869)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2020-03-23 19:46:57 UTC (rev 258869)
@@ -1623,7 +1623,7 @@
     platformDidReceiveLoadParameters(loadParameters);
 
     auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(loadParameters.data.data()), loadParameters.data.size());
-    URL baseURL = loadParameters.baseURLString.isEmpty() ? WTF::blankURL() : URL(URL(), loadParameters.baseURLString);
+    URL baseURL = loadParameters.baseURLString.isEmpty() ? aboutBlankURL() : URL(URL(), loadParameters.baseURLString);
     loadDataImpl(loadParameters.navigationID, loadParameters.shouldTreatAsContinuingLoad, WTFMove(loadParameters.websitePolicies), WTFMove(sharedBuffer), loadParameters.MIMEType, loadParameters.encodingName, baseURL, URL(), loadParameters.userData, loadParameters.isNavigatingToAppBoundDomain, loadParameters.hasNavigatedAwayFromAppBoundDomain, loadParameters.shouldOpenExternalURLsPolicy);
 }
 
@@ -1631,7 +1631,7 @@
 {
     platformDidReceiveLoadParameters(loadParameters);
 
-    URL baseURL = loadParameters.baseURLString.isEmpty() ? WTF::blankURL() : URL(URL(), loadParameters.baseURLString);
+    URL baseURL = loadParameters.baseURLString.isEmpty() ? aboutBlankURL() : URL(URL(), loadParameters.baseURLString);
     URL unreachableURL = loadParameters.unreachableURLString.isEmpty() ? URL() : URL(URL(), loadParameters.unreachableURLString);
     URL provisionalLoadErrorURL = loadParameters.provisionalLoadErrorURLString.isEmpty() ? URL() : URL(URL(), loadParameters.provisionalLoadErrorURLString);
     auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(loadParameters.data.data()), loadParameters.data.size());
@@ -1962,7 +1962,7 @@
     
     StringBuilder builder;
     int begin = -list.backCount();
-    if (list.itemAtIndex(begin)->url() == WTF::blankURL())
+    if (list.itemAtIndex(begin)->url() == aboutBlankURL())
         ++begin;
     for (int i = begin; i <= static_cast<int>(list.forwardCount()); ++i)
         dumpHistoryItem(*list.itemAtIndex(i), 8, !i, builder, directory);
@@ -6452,7 +6452,7 @@
 
 void WebPage::addUserScript(String&& source, WebCore::UserContentInjectedFrames injectedFrames, WebCore::UserScriptInjectionTime injectionTime)
 {
-    WebCore::UserScript userScript { WTFMove(source), URL(WTF::blankURL()), Vector<String>(), Vector<String>(), injectionTime, injectedFrames };
+    WebCore::UserScript userScript { WTFMove(source), URL(aboutBlankURL()), Vector<String>(), Vector<String>(), injectionTime, injectedFrames };
 
     m_userContentController->addUserScript(InjectedBundleScriptWorld::normalWorld(), WTFMove(userScript));
 }
@@ -6459,7 +6459,7 @@
 
 void WebPage::addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames injectedFrames)
 {
-    WebCore::UserStyleSheet userStyleSheet {source, WTF::blankURL(), Vector<String>(), Vector<String>(), injectedFrames, UserStyleUserLevel };
+    WebCore::UserStyleSheet userStyleSheet {source, aboutBlankURL(), Vector<String>(), Vector<String>(), injectedFrames, UserStyleUserLevel };
 
     m_userContentController->addUserStyleSheet(InjectedBundleScriptWorld::normalWorld(), WTFMove(userStyleSheet));
 }

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (258868 => 258869)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-03-23 19:46:57 UTC (rev 258869)
@@ -1,3 +1,15 @@
+2020-03-23  youenn fablet  <[email protected]>
+
+        Rename blankURL to aboutBlankURL
+        https://bugs.webkit.org/show_bug.cgi?id=209344
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::updateGlobalHistory):
+        * WebView/WebFrame.mm:
+        (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]):
+
 2020-03-20  Jer Noble  <[email protected]>
 
         Ensure media cache directory is created before passing to AVURLAsset.

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm (258868 => 258869)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm	2020-03-23 19:46:57 UTC (rev 258869)
@@ -1033,7 +1033,7 @@
     WebView* view = getWebView(m_webFrame.get());
     auto* loader = core(m_webFrame.get())->loader().documentLoader();
 #if PLATFORM(IOS_FAMILY)
-    if (loader->urlForHistory() == WTF::blankURL())
+    if (loader->urlForHistory() == aboutBlankURL())
         return;
 #endif
 

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm (258868 => 258869)


--- trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm	2020-03-23 19:33:55 UTC (rev 258868)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm	2020-03-23 19:46:57 UTC (rev 258869)
@@ -2533,7 +2533,7 @@
     if (baseURL)
         baseURL = [baseURL absoluteURL];
     else {
-        baseURL = WTF::blankURL();
+        baseURL = aboutBlankURL();
         responseURL = createUniqueWebDataURL();
     }
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to