Title: [257999] trunk/Source
Revision
257999
Author
[email protected]
Date
2020-03-06 08:50:20 -0800 (Fri, 06 Mar 2020)

Log Message

Remove redundant flags in script evaluation checks
https://bugs.webkit.org/show_bug.cgi?id=208609
<rdar://problem/60058656>
Source/WebCore:

Reviewed by Brent Fulgham.

hasNavigatedAwayFromAppBoundDomain only gets set in WebPageProxy if
its a main frame navigation and In-App Browser privacy is enabled,
we don't need to check again at the sites.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):
* page/Frame.cpp:
(WebCore::Frame::injectUserScriptImmediately):

Source/WebKit:

Reviewed by Brent Fulgham.

hasNavigatedAwayFromAppBoundDomain only gets set in WebPageProxy if
its a main frame navigation and In-App Browser privacy is enabled,
we don't need to check again at the sites.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runJavaScript):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (257998 => 257999)


--- trunk/Source/WebCore/ChangeLog	2020-03-06 16:39:06 UTC (rev 257998)
+++ trunk/Source/WebCore/ChangeLog	2020-03-06 16:50:20 UTC (rev 257999)
@@ -1,3 +1,20 @@
+2020-03-06  Kate Cheney  <[email protected]>
+
+        Remove redundant flags in script evaluation checks
+        https://bugs.webkit.org/show_bug.cgi?id=208609
+        <rdar://problem/60058656>
+        
+        Reviewed by Brent Fulgham.
+        
+        hasNavigatedAwayFromAppBoundDomain only gets set in WebPageProxy if
+        its a main frame navigation and In-App Browser privacy is enabled,
+        we don't need to check again at the sites.
+
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::executeScriptInWorld):
+        * page/Frame.cpp:
+        (WebCore::Frame::injectUserScriptImmediately):
+
 2020-03-06  Zalan Bujtas  <[email protected]>
 
         [LFC][TFC] Absolute positioned table should generate a static table box inside the out-of-flow table wrapper box

Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (257998 => 257999)


--- trunk/Source/WebCore/bindings/js/ScriptController.cpp	2020-03-06 16:39:06 UTC (rev 257998)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp	2020-03-06 16:50:20 UTC (rev 257999)
@@ -576,7 +576,7 @@
 
 ValueOrException ScriptController::executeScriptInWorld(DOMWrapperWorld& world, RunJavaScriptParameters&& parameters)
 {
-    if (RuntimeEnabledFeatures::sharedFeatures().isInAppBrowserPrivacyEnabled() && m_frame.isMainFrame() && m_frame.loader().client().hasNavigatedAwayFromAppBoundDomain())
+    if (m_frame.loader().client().hasNavigatedAwayFromAppBoundDomain())
         return jsNull();
 
     UserGestureIndicator gestureIndicator(parameters.forceUserGesture == ForceUserGesture::Yes ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : WTF::nullopt);

Modified: trunk/Source/WebCore/page/Frame.cpp (257998 => 257999)


--- trunk/Source/WebCore/page/Frame.cpp	2020-03-06 16:39:06 UTC (rev 257998)
+++ trunk/Source/WebCore/page/Frame.cpp	2020-03-06 16:50:20 UTC (rev 257999)
@@ -625,7 +625,7 @@
 
 void Frame::injectUserScriptImmediately(DOMWrapperWorld& world, const UserScript& script)
 {
-    if (RuntimeEnabledFeatures::sharedFeatures().isInAppBrowserPrivacyEnabled() && isMainFrame() && loader().client().hasNavigatedAwayFromAppBoundDomain())
+    if (loader().client().hasNavigatedAwayFromAppBoundDomain())
         return;
 
     auto* document = this->document();

Modified: trunk/Source/WebKit/ChangeLog (257998 => 257999)


--- trunk/Source/WebKit/ChangeLog	2020-03-06 16:39:06 UTC (rev 257998)
+++ trunk/Source/WebKit/ChangeLog	2020-03-06 16:50:20 UTC (rev 257999)
@@ -1,3 +1,18 @@
+2020-03-06  Kate Cheney  <[email protected]>
+
+        Remove redundant flags in script evaluation checks
+        https://bugs.webkit.org/show_bug.cgi?id=208609
+        <rdar://problem/60058656>
+
+        Reviewed by Brent Fulgham.
+
+        hasNavigatedAwayFromAppBoundDomain only gets set in WebPageProxy if
+        its a main frame navigation and In-App Browser privacy is enabled,
+        we don't need to check again at the sites.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::runJavaScript):
+
 2020-03-05  Simon Fraser  <[email protected]>
 
         Use an OptionSet<> for SynchronousScrollingReasons

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (257998 => 257999)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2020-03-06 16:39:06 UTC (rev 257998)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2020-03-06 16:50:20 UTC (rev 257999)
@@ -3460,7 +3460,7 @@
         send(Messages::WebPageProxy::ScriptValueCallback(dataReference, details, callbackID));
     };
     
-    if (RuntimeEnabledFeatures::sharedFeatures().isInAppBrowserPrivacyEnabled() && frame->isMainFrame() && hasNavigatedAwayFromAppBoundDomain() == NavigatedAwayFromAppBoundDomain::Yes) {
+    if (hasNavigatedAwayFromAppBoundDomain() == NavigatedAwayFromAppBoundDomain::Yes) {
         send(Messages::WebPageProxy::ScriptValueCallback({ }, ExceptionDetails { "Unable to execute _javascript_"_s }, callbackID));
         return;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to