Title: [88998] trunk/Source/WebCore
- Revision
- 88998
- Author
- [email protected]
- Date
- 2011-06-15 20:43:12 -0700 (Wed, 15 Jun 2011)
Log Message
2011-06-15 Adam Barth <[email protected]>
Reviewed by Eric Seidel.
Remove forceUserGesture bool in favor of UserGestureIndicator
https://bugs.webkit.org/show_bug.cgi?id=62702
This patch is an intermediate step towards removing the
forceUserGesture bool. In this patch, we use the user gesture
indicator to store the gesture state instead of encoding it in the URL
of the script source code. In a future patch, we'll push the indicator
higher up the stack, closer to the reason for setting it.
* bindings/ScriptControllerBase.cpp:
(WebCore::ScriptController::executeScript):
(WebCore::ScriptController::executeIfJavaScriptURL):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (88997 => 88998)
--- trunk/Source/WebCore/ChangeLog 2011-06-16 03:38:49 UTC (rev 88997)
+++ trunk/Source/WebCore/ChangeLog 2011-06-16 03:43:12 UTC (rev 88998)
@@ -1,3 +1,22 @@
+2011-06-15 Adam Barth <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Remove forceUserGesture bool in favor of UserGestureIndicator
+ https://bugs.webkit.org/show_bug.cgi?id=62702
+
+ This patch is an intermediate step towards removing the
+ forceUserGesture bool. In this patch, we use the user gesture
+ indicator to store the gesture state instead of encoding it in the URL
+ of the script source code. In a future patch, we'll push the indicator
+ higher up the stack, closer to the reason for setting it.
+
+ * bindings/ScriptControllerBase.cpp:
+ (WebCore::ScriptController::executeScript):
+ (WebCore::ScriptController::executeIfJavaScriptURL):
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::executeScriptInWorld):
+
2011-06-15 Rob Buis <[email protected]>
Reviewed by Darin Adler.
Modified: trunk/Source/WebCore/bindings/ScriptControllerBase.cpp (88997 => 88998)
--- trunk/Source/WebCore/bindings/ScriptControllerBase.cpp 2011-06-16 03:38:49 UTC (rev 88997)
+++ trunk/Source/WebCore/bindings/ScriptControllerBase.cpp 2011-06-16 03:43:12 UTC (rev 88998)
@@ -31,6 +31,7 @@
#include "ScriptValue.h"
#include "SecurityOrigin.h"
#include "Settings.h"
+#include "UserGestureIndicator.h"
namespace WebCore {
@@ -54,9 +55,8 @@
ScriptValue ScriptController::executeScript(const String& script, bool forceUserGesture)
{
- // FIXME: Why does the URL of the script depend on forceUserGesture?
- // This looks suspiciously like an old user-gesture back-channel.
- return executeScript(ScriptSourceCode(script, forceUserGesture ? KURL() : m_frame->document()->url()));
+ UserGestureIndicator gestureIndicator(forceUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
+ return executeScript(ScriptSourceCode(script, m_frame->document()->url()));
}
ScriptValue ScriptController::executeScript(const ScriptSourceCode& sourceCode)
@@ -95,7 +95,7 @@
const int _javascript_SchemeLength = sizeof("_javascript_:") - 1;
String decodedURL = decodeURLEscapeSequences(url.string());
- ScriptValue result = executeScript(decodedURL.substring(_javascript_SchemeLength), false);
+ ScriptValue result = executeScript(decodedURL.substring(_javascript_SchemeLength));
// If executing script caused this frame to be removed from the page, we
// don't want to try to replace its document!
Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (88997 => 88998)
--- trunk/Source/WebCore/bindings/js/ScriptController.cpp 2011-06-16 03:38:49 UTC (rev 88997)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp 2011-06-16 03:43:12 UTC (rev 88998)
@@ -468,7 +468,8 @@
ScriptValue ScriptController::executeScriptInWorld(DOMWrapperWorld* world, const String& script, bool forceUserGesture)
{
- ScriptSourceCode sourceCode(script, forceUserGesture ? KURL() : m_frame->document()->url());
+ UserGestureIndicator gestureIndicator(forceUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
+ ScriptSourceCode sourceCode(script, m_frame->document()->url());
if (!canExecuteScripts(AboutToExecuteScript) || isPaused())
return ScriptValue();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes