https://bugs.webkit.org/show_bug.cgi?id=213166
Rename executeIfJavaScriptURL to executeJavaScriptURL
Patch by Rob Buis <rbuis@igalia.com> on 2020-06-13
Reviewed by Darin Adler.
Rename executeIfJavaScriptURL to executeJavaScriptURL in order to make the function
unconditional, i.e. the passed url is expected to have the javascript protocol, this
is asserted first thing in the method. This allows us to remove the return parameter
since the remaining return statements all return true.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeJavaScriptURL):
(WebCore::ScriptController::executeIfJavaScriptURL): Deleted.
* bindings/js/ScriptController.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::changeLocation):
(WebCore::FrameLoader::submitForm):
* loader/SubframeLoader.cpp:
(WebCore::FrameLoader::SubframeLoader::requestFrame):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@263008 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index f17e3a4..124681f 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -436,7 +436,8 @@
Ref<Frame> protect(m_frame);
- if (m_frame.script().executeIfJavaScriptURL(frameRequest.resourceRequest().url(), &frameRequest.requester().securityOrigin(), frameRequest.shouldReplaceDocumentIfJavaScriptURL())) {
+ if (frameRequest.resourceRequest().url().protocolIsJavaScript()) {
+ m_frame.script().executeJavaScriptURL(frameRequest.resourceRequest().url(), &frameRequest.requester().securityOrigin(), frameRequest.shouldReplaceDocumentIfJavaScriptURL());
m_quickRedirectComing = false;
return;
}
@@ -475,7 +476,7 @@
if (formAction.protocolIsJavaScript()) {
m_isExecutingJavaScriptFormAction = true;
Ref<Frame> protect(m_frame);
- m_frame.script().executeIfJavaScriptURL(submission->action(), nullptr, DoNotReplaceDocumentIfJavaScriptURL);
+ m_frame.script().executeJavaScriptURL(submission->action(), nullptr, DoNotReplaceDocumentIfJavaScriptURL);
m_isExecutingJavaScriptFormAction = false;
return;
}
diff --git a/Source/WebCore/loader/SubframeLoader.cpp b/Source/WebCore/loader/SubframeLoader.cpp
index 7584a4e..53af7d8 100644
--- a/Source/WebCore/loader/SubframeLoader.cpp
+++ b/Source/WebCore/loader/SubframeLoader.cpp
@@ -103,7 +103,7 @@
// FIXME: Some sites rely on the javascript:'' loading synchronously, which is why we have this special case.
// Blink has the same workaround (https://bugs.chromium.org/p/chromium/issues/detail?id=923585).
if (urlString == "javascript:''" || urlString == "javascript:\"\"")
- frame->script().executeIfJavaScriptURL(scriptURL);
+ frame->script().executeJavaScriptURL(scriptURL);
else
frame->navigationScheduler().scheduleLocationChange(ownerElement.document(), ownerElement.document().securityOrigin(), scriptURL, m_frame.loader().outgoingReferrer(), lockHistory, lockBackForwardList, stopDelayingLoadEvent.release());
}