Title: [88622] trunk/Source
Revision
88622
Author
[email protected]
Date
2011-06-12 19:03:25 -0700 (Sun, 12 Jun 2011)

Log Message

2011-06-12  Adam Barth  <[email protected]>

        Reviewed by Eric Seidel.

        Remove FrameLoader::isProcessingUserGesture
        https://bugs.webkit.org/show_bug.cgi?id=62519

        This function is a remnant of the old user gesture design, which
        involved per-frame state stored on FrameLoader.  Now that we're using
        static state, we don't need this function anymore.

        This function used to check whether _javascript_ was enabled for the
        top-level frame, but that check doesn't make any sense (like much of
        the old user gesture code).

        * WebCore.exp.in:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::processingUserGesture):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::submitForm):
        * loader/FrameLoader.h:
        * rendering/RenderFileUploadControl.cpp:
        (WebCore::RenderFileUploadControl::click):
2011-06-12  Adam Barth  <[email protected]>

        Reviewed by Eric Seidel.

        Remove FrameLoader::isProcessingUserGesture
        https://bugs.webkit.org/show_bug.cgi?id=62519

        * src/WebFrameImpl.cpp:
        (WebKit::WebFrameImpl::isProcessingUserGesture):
2011-06-12  Adam Barth  <[email protected]>

        Reviewed by Eric Seidel.

        Remove FrameLoader::isProcessingUserGesture
        https://bugs.webkit.org/show_bug.cgi?id=62519

        * WebView/WebView.mm:
        (-[WebView _isProcessingUserGesture]):
2011-06-12  Adam Barth  <[email protected]>

        Reviewed by Eric Seidel.

        Remove FrameLoader::isProcessingUserGesture
        https://bugs.webkit.org/show_bug.cgi?id=62519

        * WebCoreSupport/FrameLoaderClientQt.cpp:
        (drtPrintFrameUserGestureStatus):
2011-06-12  Adam Barth  <[email protected]>

        Reviewed by Eric Seidel.

        Remove FrameLoader::isProcessingUserGesture
        https://bugs.webkit.org/show_bug.cgi?id=62519

        Instead of asking the gesture indicator directly, ask the
        ScriptController, like everyone else.  The gesture indicator is just
        one of the piece of information we use to determine whether we're
        processing a user gesture.

        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::isProcessingUserGesture):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88621 => 88622)


--- trunk/Source/WebCore/ChangeLog	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebCore/ChangeLog	2011-06-13 02:03:25 UTC (rev 88622)
@@ -1,5 +1,29 @@
 2011-06-12  Adam Barth  <[email protected]>
 
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoader::isProcessingUserGesture
+        https://bugs.webkit.org/show_bug.cgi?id=62519
+
+        This function is a remnant of the old user gesture design, which
+        involved per-frame state stored on FrameLoader.  Now that we're using
+        static state, we don't need this function anymore.
+
+        This function used to check whether _javascript_ was enabled for the
+        top-level frame, but that check doesn't make any sense (like much of
+        the old user gesture code).
+
+        * WebCore.exp.in:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::processingUserGesture):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::submitForm):
+        * loader/FrameLoader.h:
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::click):
+
+2011-06-12  Adam Barth  <[email protected]>
+
         Fix fullscreen/full-screen-iframe-legacy.html.
 
         * html/HTMLVideoElement.idl:

Modified: trunk/Source/WebCore/WebCore.exp.in (88621 => 88622)


--- trunk/Source/WebCore/WebCore.exp.in	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebCore/WebCore.exp.in	2011-06-13 02:03:25 UTC (rev 88622)
@@ -171,7 +171,6 @@
 __ZN7WebCore11FrameLoader17stopForUserCancelEb
 __ZN7WebCore11FrameLoader21loadURLIntoChildFrameERKNS_4KURLERKN3WTF6StringEPNS_5FrameE
 __ZN7WebCore11FrameLoader22findFrameForNavigationERKN3WTF12AtomicStringE
-__ZN7WebCore11FrameLoader23isProcessingUserGestureEv
 __ZN7WebCore11FrameLoader23timeOfLastCompletedLoadEv    
 __ZN7WebCore11FrameLoader26reloadWithOverrideEncodingERKN3WTF6StringE
 __ZN7WebCore11FrameLoader4initEv
@@ -474,6 +473,7 @@
 __ZN7WebCore16ScriptController17canExecuteScriptsENS_33ReasonForCallingCanExecuteScriptsE
 __ZN7WebCore16ScriptController18windowScriptObjectEv
 __ZN7WebCore16ScriptController20executeScriptInWorldEPNS_15DOMWrapperWorldERKN3WTF6StringEb
+__ZN7WebCore16ScriptController21processingUserGestureEv
 __ZN7WebCore16ScriptController24jsObjectForPluginElementEPNS_17HTMLPlugInElementE
 __ZN7WebCore16ThreadGlobalData10staticDataE
 __ZN7WebCore16ThreadGlobalDataC1Ev

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (88621 => 88622)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2011-06-13 02:03:25 UTC (rev 88622)
@@ -60,6 +60,7 @@
 #include "Page.h"
 #include "RenderVideo.h"
 #include "RenderView.h"
+#include "ScriptController.h"
 #include "ScriptEventListener.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
@@ -2375,14 +2376,14 @@
 #endif
 }
 
+// FIXME: We should remove this function in favor of just calling ScriptController::processingUserGesture().
 bool HTMLMediaElement::processingUserGesture() const
 {
-    // FIXME: We should call ScriptController::processingUserGesture() so
-    // we know what to do without a Frame.
-    Frame* frame = document()->frame();
-    if (!frame)
+    // FIXME: We should remove this check, but it seems to be needed to stop
+    // some media tests from crashing.
+    if (!document()->frame())
         return true;
-    return frame->loader()->isProcessingUserGesture();
+    return ScriptController::processingUserGesture();
 }
 
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (88621 => 88622)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2011-06-13 02:03:25 UTC (rev 88622)
@@ -330,7 +330,7 @@
     if (!shouldAllowNavigation(targetFrame))
         return;
     if (!targetFrame) {
-        if (!DOMWindow::allowPopUp(m_frame) && !isProcessingUserGesture())
+        if (!DOMWindow::allowPopUp(m_frame) && !ScriptController::processingUserGesture())
             return;
 
         targetFrame = m_frame;
@@ -1165,14 +1165,6 @@
     m_client->provisionalLoadStarted();
 }
 
-bool FrameLoader::isProcessingUserGesture()
-{
-    Frame* frame = m_frame->tree()->top();
-    if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript))
-        return true; // If _javascript_ is disabled, a user gesture must have initiated the navigation.
-    return ScriptController::processingUserGesture(); // FIXME: Use pageIsProcessingUserGesture.
-}
-
 void FrameLoader::resetMultipleFormSubmissionProtection()
 {
     m_submittedFormURL = KURL();

Modified: trunk/Source/WebCore/loader/FrameLoader.h (88621 => 88622)


--- trunk/Source/WebCore/loader/FrameLoader.h	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebCore/loader/FrameLoader.h	2011-06-13 02:03:25 UTC (rev 88622)
@@ -251,8 +251,6 @@
     Frame* opener();
     void setOpener(Frame*);
 
-    bool isProcessingUserGesture();
-
     void resetMultipleFormSubmissionProtection();
 
     void checkCallImplicitClose();

Modified: trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp (88621 => 88622)


--- trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp	2011-06-13 02:03:25 UTC (rev 88622)
@@ -36,6 +36,7 @@
 #include "RenderText.h"
 #include "RenderTheme.h"
 #include "RenderView.h"
+#include "ScriptController.h"
 #include "ShadowRoot.h"
 #include "TextRun.h"
 #include <math.h>
@@ -121,8 +122,7 @@
 
 void RenderFileUploadControl::click()
 {
-    // FIXME: We should call ScriptController::processingUserGesture().
-    if (!frame() || !frame()->loader()->isProcessingUserGesture())
+    if (!ScriptController::processingUserGesture())
         return;
     if (Chrome* chromePointer = chrome())
         chromePointer->runOpenPanel(frame(), m_fileChooser);

Modified: trunk/Source/WebKit/chromium/ChangeLog (88621 => 88622)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-06-13 02:03:25 UTC (rev 88622)
@@ -1,3 +1,13 @@
+2011-06-12  Adam Barth  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoader::isProcessingUserGesture
+        https://bugs.webkit.org/show_bug.cgi?id=62519
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::isProcessingUserGesture):
+
 2011-06-10  Vsevolod Vlasov  <[email protected]>
 
         Reviewed by James Robinson.

Modified: trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp (88621 => 88622)


--- trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp	2011-06-13 02:03:25 UTC (rev 88622)
@@ -1109,8 +1109,7 @@
 
 bool WebFrameImpl::isProcessingUserGesture() const
 {
-    // FIXME: We should call ScriptController::processingUserGesture().
-    return frame()->loader()->isProcessingUserGesture();
+    return ScriptController::processingUserGesture();
 }
 
 bool WebFrameImpl::willSuppressOpenerInNewFrame() const

Modified: trunk/Source/WebKit/mac/ChangeLog (88621 => 88622)


--- trunk/Source/WebKit/mac/ChangeLog	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebKit/mac/ChangeLog	2011-06-13 02:03:25 UTC (rev 88622)
@@ -1,5 +1,15 @@
 2011-06-12  Adam Barth  <[email protected]>
 
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoader::isProcessingUserGesture
+        https://bugs.webkit.org/show_bug.cgi?id=62519
+
+        * WebView/WebView.mm:
+        (-[WebView _isProcessingUserGesture]):
+
+2011-06-12  Adam Barth  <[email protected]>
+
         Reviewed by Alexey Proskuryakov.
 
         Remove trival "forward-to-client" member functions from FrameLoader

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (88621 => 88622)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2011-06-13 02:03:25 UTC (rev 88622)
@@ -1237,9 +1237,7 @@
 // Indicates if the WebView is in the midst of a user gesture.
 - (BOOL)_isProcessingUserGesture
 {
-    WebFrame *frame = [self mainFrame];
-    // FIXME: We should call ScriptController::processingUserGesture().
-    return core(frame)->loader()->isProcessingUserGesture();
+    return ScriptController::processingUserGesture();
 }
 
 + (NSString *)_MIMETypeForFile:(NSString *)path

Modified: trunk/Source/WebKit/qt/ChangeLog (88621 => 88622)


--- trunk/Source/WebKit/qt/ChangeLog	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebKit/qt/ChangeLog	2011-06-13 02:03:25 UTC (rev 88622)
@@ -1,3 +1,13 @@
+2011-06-12  Adam Barth  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoader::isProcessingUserGesture
+        https://bugs.webkit.org/show_bug.cgi?id=62519
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (drtPrintFrameUserGestureStatus):
+
 2011-06-10  Andreas Kling  <[email protected]>
 
         Reviewed by Benjamin Poulain.

Modified: trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (88621 => 88622)


--- trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp	2011-06-13 02:03:25 UTC (rev 88622)
@@ -113,8 +113,7 @@
 
 static QString drtPrintFrameUserGestureStatus(WebCore::Frame* frame)
 {
-    // FIXME: We should call ScriptController::processingUserGesture().
-    if (frame->loader()->isProcessingUserGesture())
+    if (ScriptController::processingUserGesture())
         return QString::fromLatin1("Frame with user gesture \"%1\"").arg(QLatin1String("true"));
     return QString::fromLatin1("Frame with user gesture \"%1\"").arg(QLatin1String("false"));
 }

Modified: trunk/Source/WebKit2/ChangeLog (88621 => 88622)


--- trunk/Source/WebKit2/ChangeLog	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebKit2/ChangeLog	2011-06-13 02:03:25 UTC (rev 88622)
@@ -1,5 +1,20 @@
 2011-06-12  Adam Barth  <[email protected]>
 
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoader::isProcessingUserGesture
+        https://bugs.webkit.org/show_bug.cgi?id=62519
+
+        Instead of asking the gesture indicator directly, ask the
+        ScriptController, like everyone else.  The gesture indicator is just
+        one of the piece of information we use to determine whether we're
+        processing a user gesture.
+
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::isProcessingUserGesture):
+
+2011-06-12  Adam Barth  <[email protected]>
+
         Reviewed by Alexey Proskuryakov.
 
         Remove trival "forward-to-client" member functions from FrameLoader

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (88621 => 88622)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2011-06-12 23:34:10 UTC (rev 88621)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2011-06-13 02:03:25 UTC (rev 88622)
@@ -49,6 +49,7 @@
 #include <WebCore/Page.h>
 #include <WebCore/PageGroup.h>
 #include <WebCore/PrintContext.h>
+#include <WebCore/ScriptController.h>
 #include <WebCore/SecurityOrigin.h>
 #include <WebCore/Settings.h>
 #include <WebCore/UserGestureIndicator.h>
@@ -233,7 +234,7 @@
 
 bool InjectedBundle::isProcessingUserGesture()
 {
-    return UserGestureIndicator::getUserGestureState() == DefinitelyProcessingUserGesture;
+    return ScriptController::processingUserGesture();
 }
 
 static PassOwnPtr<Vector<String> > toStringVector(ImmutableArray* patterns)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to