2011-06-16 Sheriff Bot <webkit.review.bot@gmail.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jun 2011 18:01:30 +0000 (18:01 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jun 2011 18:01:30 +0000 (18:01 +0000)
        Unreviewed, rolling out r89026.
        http://trac.webkit.org/changeset/89026
        https://bugs.webkit.org/show_bug.cgi?id=62804

        These patches were likely correct.  I'll investigate the
        browser_test failures. (Requested by abarth on #webkit).

        * WebCore.exp.in:
        * bindings/js/ScheduledAction.cpp:
        (WebCore::ScheduledAction::execute):
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::ScriptController):
        (WebCore::ScriptController::processingUserGesture):
        * bindings/js/ScriptController.h:
        * bindings/v8/ScriptController.cpp:
        (WebCore::ScriptController::ScriptController):
        (WebCore::ScriptController::processingUserGesture):
        * bindings/v8/ScriptController.h:
        * dom/Event.cpp:
        * dom/Event.h:
        * dom/UserGestureIndicator.cpp:
        (WebCore::isDefinite):
        (WebCore::UserGestureIndicator::UserGestureIndicator):
        (WebCore::UserGestureIndicator::~UserGestureIndicator):
        * dom/UserGestureIndicator.h:
        (WebCore::UserGestureIndicator::processingUserGesture):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::removedFromDocument):
        (WebCore::HTMLMediaElement::load):
        (WebCore::HTMLMediaElement::play):
        (WebCore::HTMLMediaElement::pause):
        (WebCore::HTMLMediaElement::beginScrubbing):
        (WebCore::HTMLMediaElement::resume):
        * html/HTMLMediaElement.h:
        * html/HTMLMediaElement.idl:
        * html/HTMLVideoElement.cpp:
        (WebCore::HTMLVideoElement::webkitEnterFullscreen):
        * html/HTMLVideoElement.h:
        (WebCore::HTMLVideoElement::webkitEnterFullScreen):
        * html/HTMLVideoElement.idl:
        * html/MediaDocument.cpp:
        (WebCore::MediaDocument::defaultEventHandler):
        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlSeekButtonElement::defaultEventHandler):
        * html/shadow/TextControlInnerElements.cpp:
        (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
2011-06-16  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r89026.
        http://trac.webkit.org/changeset/89026
        https://bugs.webkit.org/show_bug.cgi?id=62804

        These patches were likely correct.  I'll investigate the
        browser_test failures. (Requested by abarth on #webkit).

        * src/WebPluginContainerImpl.cpp:
        (WebKit::WebPluginContainerImpl::loadFrameRequest):
        * src/WebViewImpl.cpp:
        (WebKit::WebViewImpl::performMediaPlayerAction):
2011-06-16  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r89026.
        http://trac.webkit.org/changeset/89026
        https://bugs.webkit.org/show_bug.cgi?id=62804

        These patches were likely correct.  I'll investigate the
        browser_test failures. (Requested by abarth on #webkit).

        * WebCoreSupport/FullscreenVideoController.cpp:
        (FullscreenVideoController::play):
        (FullscreenVideoController::pause):
2011-06-16  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r89026.
        http://trac.webkit.org/changeset/89026
        https://bugs.webkit.org/show_bug.cgi?id=62804

        These patches were likely correct.  I'll investigate the
        browser_test failures. (Requested by abarth on #webkit).

        * WebView/WebVideoFullscreenHUDWindowController.mm:
        (-[WebVideoFullscreenHUDWindowController setPlaying:]):
2011-06-16  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r89026.
        http://trac.webkit.org/changeset/89026
        https://bugs.webkit.org/show_bug.cgi?id=62804

        These patches were likely correct.  I'll investigate the
        browser_test failures. (Requested by abarth on #webkit).

        * FullscreenVideoController.cpp:
        (FullscreenVideoController::play):
        (FullscreenVideoController::pause):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89044 268f45cc-cd09-0410-ab3c-d52691b4dbfc

29 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/js/ScheduledAction.cpp
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/js/ScriptController.h
Source/WebCore/bindings/v8/ScriptController.cpp
Source/WebCore/bindings/v8/ScriptController.h
Source/WebCore/dom/Event.cpp
Source/WebCore/dom/Event.h
Source/WebCore/dom/UserGestureIndicator.cpp
Source/WebCore/dom/UserGestureIndicator.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLMediaElement.idl
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/html/HTMLVideoElement.h
Source/WebCore/html/HTMLVideoElement.idl
Source/WebCore/html/MediaDocument.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/FullscreenVideoController.cpp

index a44cdb8..2d1bc9a 100644 (file)
@@ -1,3 +1,52 @@
+2011-06-16  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r89026.
+        http://trac.webkit.org/changeset/89026
+        https://bugs.webkit.org/show_bug.cgi?id=62804
+
+        These patches were likely correct.  I'll investigate the
+        browser_test failures. (Requested by abarth on #webkit).
+
+        * WebCore.exp.in:
+        * bindings/js/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::execute):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::ScriptController):
+        (WebCore::ScriptController::processingUserGesture):
+        * bindings/js/ScriptController.h:
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::ScriptController):
+        (WebCore::ScriptController::processingUserGesture):
+        * bindings/v8/ScriptController.h:
+        * dom/Event.cpp:
+        * dom/Event.h:
+        * dom/UserGestureIndicator.cpp:
+        (WebCore::isDefinite):
+        (WebCore::UserGestureIndicator::UserGestureIndicator):
+        (WebCore::UserGestureIndicator::~UserGestureIndicator):
+        * dom/UserGestureIndicator.h:
+        (WebCore::UserGestureIndicator::processingUserGesture):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::removedFromDocument):
+        (WebCore::HTMLMediaElement::load):
+        (WebCore::HTMLMediaElement::play):
+        (WebCore::HTMLMediaElement::pause):
+        (WebCore::HTMLMediaElement::beginScrubbing):
+        (WebCore::HTMLMediaElement::resume):
+        * html/HTMLMediaElement.h:
+        * html/HTMLMediaElement.idl:
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::webkitEnterFullscreen):
+        * html/HTMLVideoElement.h:
+        (WebCore::HTMLVideoElement::webkitEnterFullScreen):
+        * html/HTMLVideoElement.idl:
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocument::defaultEventHandler):
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlSeekButtonElement::defaultEventHandler):
+        * html/shadow/TextControlInnerElements.cpp:
+        (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+
 2011-06-16  Dimitri Glazkov  <dglazkov@chromium.org>
 
         [Qt] Build fix after r89039.
index 4cc8805..1f18471 100644 (file)
@@ -542,7 +542,7 @@ __ZN7WebCore20RenderEmbeddedObject30setShowsCrashedPluginIndicatorEv
 __ZN7WebCore20ResourceResponseBase24setExpectedContentLengthEx
 __ZN7WebCore20ResourceResponseBaseC2Ev
 __ZN7WebCore20SpaceSplitStringData12createVectorEv
-__ZN7WebCore20UserGestureIndicator23s_processingUserGestureE
+__ZN7WebCore20UserGestureIndicator7s_stateE
 __ZN7WebCore20UserGestureIndicatorC1ENS_26ProcessingUserGestureStateE
 __ZN7WebCore20UserGestureIndicatorD1Ev
 __ZN7WebCore20makeRGBA32FromFloatsEffff
@@ -1808,14 +1808,13 @@ __ZN7WebCore16HTMLMediaElement14setCurrentTimeEfRi
 __ZN7WebCore16HTMLMediaElement15clearMediaCacheEv
 __ZN7WebCore16HTMLMediaElement20getSitesInMediaCacheERN3WTF6VectorINS1_6StringELm0EEE
 __ZN7WebCore16HTMLMediaElement22clearMediaCacheForSiteERKN3WTF6StringE
-__ZN7WebCore16HTMLMediaElement4playEb
-__ZN7WebCore16HTMLMediaElement5pauseEb
+__ZN7WebCore16HTMLMediaElement4playEv
+__ZN7WebCore16HTMLMediaElement5pauseEv
 __ZN7WebCore16HTMLMediaElement6rewindEf
 __ZN7WebCore16HTMLMediaElement8setMutedEb
 __ZN7WebCore16HTMLMediaElement9setVolumeEfRi
 __ZNK7WebCore16HTMLMediaElement11currentTimeEv
 __ZNK7WebCore16HTMLMediaElement13platformMediaEv
-__ZNK7WebCore16HTMLMediaElement21processingUserGestureEv
 __ZNK7WebCore16HTMLMediaElement5mutedEv
 __ZNK7WebCore16HTMLMediaElement6volumeEv
 __ZNK7WebCore16HTMLMediaElement7canPlayEv
index 3af6115..572b450 100644 (file)
@@ -126,15 +126,11 @@ void ScheduledAction::execute(Document* document)
     if (!frame || !frame->script()->canExecuteScripts(AboutToExecuteScript))
         return;
 
-    frame->script()->setProcessingTimerCallback(true);
-
     if (m_function) {
         executeFunctionInContext(window, window->shell(), document);
         Document::updateStyleForAllDocuments();
     } else
         frame->script()->executeScriptInWorld(m_isolatedWorld.get(), m_code);
-
-    frame->script()->setProcessingTimerCallback(false);
 }
 
 #if ENABLE(WORKERS)
index 42403bb..18a5072 100644 (file)
@@ -63,7 +63,6 @@ ScriptController::ScriptController(Frame* frame)
     : m_frame(frame)
     , m_sourceURL(0)
     , m_inExecuteScript(false)
-    , m_processingTimerCallback(false)
     , m_paused(false)
 #if ENABLE(NETSCAPE_PLUGIN_API)
     , m_windowScriptNPObject(0)
@@ -244,37 +243,9 @@ void ScriptController::disableEval()
 
 bool ScriptController::processingUserGesture()
 {
-    ExecState* exec = JSMainThreadExecState::currentState();
-    Frame* frame = exec ? toDynamicFrame(exec) : 0;
-    // No script is running, so it is user-initiated unless the gesture stack
-    // explicitly says it is not.
-    if (!frame)
-        return UserGestureIndicator::getUserGestureState() != DefinitelyNotProcessingUserGesture;
-
-    // FIXME: Remove the isJavaScriptAnchorNavigation check once https://bugs.webkit.org/show_bug.cgi?id=62702 is fixed.
-    if (frame->script()->isJavaScriptAnchorNavigation())
-        return true;
-
-    // If a DOM event is being processed, check that it was initiated by the user
-    // and that it is in the whitelist of event types allowed to generate pop-ups.
-    if (JSDOMWindowShell* shell = frame->script()->existingWindowShell(currentWorld(exec)))
-        if (Event* event = shell->window()->currentEvent())
-            return event->fromUserGesture();
-
     return UserGestureIndicator::processingUserGesture();
 }
 
-// FIXME: This seems like an insufficient check to verify a click on a javascript: anchor.
-bool ScriptController::isJavaScriptAnchorNavigation() const
-{
-    // This is the <a href="javascript:window.open('...')> case -> we let it through
-    if (m_sourceURL && m_sourceURL->isNull() && !m_processingTimerCallback)
-        return true;
-
-    // This is the <script>window.open(...)</script> case or a timer callback -> block it
-    return false;
-}
-
 bool ScriptController::canAccessFromCurrentOrigin(Frame *frame)
 {
     ExecState* exec = JSMainThreadExecState::currentState();
index 2f7e037..de820ed 100644 (file)
@@ -108,7 +108,6 @@ public:
 
     void disableEval();
 
-    void setProcessingTimerCallback(bool b) { m_processingTimerCallback = b; }
     static bool processingUserGesture();
 
     static bool canAccessFromCurrentOrigin(Frame*);
@@ -169,15 +168,12 @@ private:
 
     void disconnectPlatformScriptObjects();
 
-    bool isJavaScriptAnchorNavigation() const;
-
     ShellMap m_windowShells;
     Frame* m_frame;
     const String* m_sourceURL;
 
     bool m_inExecuteScript;
 
-    bool m_processingTimerCallback;
     bool m_paused;
 
     // The root object used for objects bound outside the context of a plugin, such
index 4fff005..2652a2c 100644 (file)
@@ -109,7 +109,6 @@ ScriptController::ScriptController(Frame* frame)
     : m_frame(frame)
     , m_sourceURL(0)
     , m_inExecuteScript(false)
-    , m_processingTimerCallback(false)
     , m_paused(false)
     , m_proxy(adoptPtr(new V8Proxy(frame)))
 #if ENABLE(NETSCAPE_PLUGIN_API)
@@ -154,27 +153,6 @@ void ScriptController::updatePlatformScriptObjects()
 
 bool ScriptController::processingUserGesture()
 {
-    Frame* firstFrame = V8Proxy::retrieveFrameForEnteredContext();
-    if (!firstFrame)
-        return UserGestureIndicator::getUserGestureState() != DefinitelyNotProcessingUserGesture;
-
-    v8::HandleScope handleScope;
-    v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(firstFrame);
-    if (v8Context.IsEmpty())
-        return true;
-    v8::Context::Scope scope(v8Context);
-    v8::Handle<v8::Object> global = v8Context->Global();
-    v8::Handle<v8::String> eventSymbol = V8HiddenPropertyName::event();
-    v8::Handle<v8::Value> jsEvent = global->GetHiddenValue(eventSymbol);
-    Event* event = V8DOMWrapper::isValidDOMObject(jsEvent) ? V8Event::toNative(v8::Handle<v8::Object>::Cast(jsEvent)) : 0;
-    if (event)
-        return event->fromUserGesture();
-
-    // FIXME: Remove this check once https://bugs.webkit.org/show_bug.cgi?id=62702 is fixed.
-    const String* sourceURL = firstFrame->script()->sourceURL();
-    if (sourceURL && sourceURL->isNull() && !firstFrame->script()->proxy()->timerCallback())
-        return true;
-
     return UserGestureIndicator::processingUserGesture();
 }
 
index 0159603..18ddb27 100644 (file)
@@ -157,7 +157,6 @@ public:
 
     TextPosition0 eventHandlerPosition() const;
 
-    void setProcessingTimerCallback(bool processingTimerCallback) { m_processingTimerCallback = processingTimerCallback; }
     static bool processingUserGesture();
 
     void setPaused(bool paused) { m_paused = paused; }
@@ -195,7 +194,6 @@ private:
 
     bool m_inExecuteScript;
 
-    bool m_processingTimerCallback;
     bool m_paused;
 
     OwnPtr<V8Proxy> m_proxy;
index 8cb4054..1758a27 100644 (file)
@@ -257,30 +257,6 @@ bool Event::isStreamEvent() const
 }
 #endif
 
-bool Event::fromUserGesture()
-{
-    if (!UserGestureIndicator::processingUserGesture())
-        return false;
-
-    const AtomicString& type = this->type();
-    return
-        // mouse events
-        type == eventNames().clickEvent || type == eventNames().mousedownEvent 
-        || type == eventNames().mouseupEvent || type == eventNames().dblclickEvent 
-        // keyboard events
-        || type == eventNames().keydownEvent || type == eventNames().keypressEvent
-        || type == eventNames().keyupEvent
-#if ENABLE(TOUCH_EVENTS)
-        // touch events
-        || type == eventNames().touchstartEvent || type == eventNames().touchmoveEvent
-        || type == eventNames().touchendEvent || type == eventNames().touchcancelEvent
-#endif
-        // other accepted events
-        || type == eventNames().selectEvent || type == eventNames().changeEvent
-        || type == eventNames().focusEvent || type == eventNames().blurEvent
-        || type == eventNames().submitEvent;
-}
-
 bool Event::storesResultAsString() const
 {
     return false;
index c2dac7a..c1ac0c8 100644 (file)
@@ -150,8 +150,6 @@ namespace WebCore {
 #if ENABLE(MEDIA_STREAM)
         virtual bool isStreamEvent() const;
 #endif
-        bool fromUserGesture();
-        
         bool propagationStopped() const { return m_propagationStopped || m_immediatePropagationStopped; }
         bool immediatePropagationStopped() const { return m_immediatePropagationStopped; }
 
index 06a3831..10e46ee 100644 (file)
 
 namespace WebCore {
 
-ProcessingUserGestureState UserGestureIndicator::s_processingUserGesture = PossiblyProcessingUserGesture;
+static bool isDefinite(ProcessingUserGestureState state)
+{
+    return state == DefinitelyProcessingUserGesture || state == DefinitelyNotProcessingUserGesture;
+}
+
+ProcessingUserGestureState UserGestureIndicator::s_state = DefinitelyNotProcessingUserGesture;
 
 UserGestureIndicator::UserGestureIndicator(ProcessingUserGestureState state)
-    : m_previousValue(s_processingUserGesture)
+    : m_previousState(s_state)
 {
-    s_processingUserGesture = state;
+    // We overwrite s_state only if the caller is definite about the gesture state.
+    if (isDefinite(state))
+        s_state = state;
+    ASSERT(isDefinite(s_state));
 }
 
 UserGestureIndicator::~UserGestureIndicator()
 {
-    s_processingUserGesture = m_previousValue;
+    s_state = m_previousState;
+    ASSERT(isDefinite(s_state));
 }
 
-} // namespace WebCore
+}
index b1ed96b..1d01008 100644 (file)
@@ -39,17 +39,16 @@ enum ProcessingUserGestureState {
 class UserGestureIndicator {
     WTF_MAKE_NONCOPYABLE(UserGestureIndicator);
 public:
-    static bool processingUserGesture() { return s_processingUserGesture == DefinitelyProcessingUserGesture; }
-    static ProcessingUserGestureState getUserGestureState() { return s_processingUserGesture; }
+    static bool processingUserGesture() { return s_state == DefinitelyProcessingUserGesture; }
 
     explicit UserGestureIndicator(ProcessingUserGestureState);
     ~UserGestureIndicator();
 
 private:
-    static ProcessingUserGestureState s_processingUserGesture;
-    ProcessingUserGestureState m_previousValue;
-};    
+    static ProcessingUserGestureState s_state;
+    ProcessingUserGestureState m_previousState;
+};
 
-} // namespace WebCore
+}
 
-#endif // UserGestureIndicator_h
+#endif
index d45835a..a55ff14 100644 (file)
@@ -359,7 +359,7 @@ void HTMLMediaElement::removedFromDocument()
 {
     LOG(Media, "HTMLMediaElement::removedFromDocument");
     if (m_networkState > NETWORK_EMPTY)
-        pause(processingUserGesture());
+        pause();
     if (m_isFullscreen)
         exitFullscreen();
     HTMLElement::removedFromDocument();
@@ -489,14 +489,14 @@ String HTMLMediaElement::canPlayType(const String& mimeType) const
     return canPlay;
 }
 
-void HTMLMediaElement::load(bool isUserGesture, ExceptionCode& ec)
+void HTMLMediaElement::load(ExceptionCode& ec)
 {
-    LOG(Media, "HTMLMediaElement::load(isUserGesture : %s)", boolString(isUserGesture));
+    LOG(Media, "HTMLMediaElement::load()");
 
-    if (m_restrictions & RequireUserGestureForLoadRestriction && !isUserGesture)
+    if (m_restrictions & RequireUserGestureForLoadRestriction && !ScriptController::processingUserGesture())
         ec = INVALID_STATE_ERR;
     else {
-        m_loadInitiatedByUserGesture = isUserGesture;
+        m_loadInitiatedByUserGesture = ScriptController::processingUserGesture();
         prepareForLoad();
         loadInternal();
     }
@@ -1454,24 +1454,23 @@ void HTMLMediaElement::setPreload(const String& preload)
     setAttribute(preloadAttr, preload);
 }
 
-void HTMLMediaElement::play(bool isUserGesture)
+void HTMLMediaElement::play()
 {
-    LOG(Media, "HTMLMediaElement::play(isUserGesture : %s)", boolString(isUserGesture));
+    LOG(Media, "HTMLMediaElement::play()");
 
-    if (m_restrictions & RequireUserGestureForRateChangeRestriction && !isUserGesture)
+    if (m_restrictions & RequireUserGestureForRateChangeRestriction && !ScriptController::processingUserGesture())
         return;
 
-    Document* doc = document();
-    Settings* settings = doc->settings();
+    Settings* settings = document()->settings();
     if (settings && settings->needsSiteSpecificQuirks() && m_dispatchingCanPlayEvent && !m_loadInitiatedByUserGesture) {
         // It should be impossible to be processing the canplay event while handling a user gesture
         // since it is dispatched asynchronously.
-        ASSERT(!isUserGesture);
-        String host = doc->baseURL().host();
+        ASSERT(!ScriptController::processingUserGesture());
+        String host = document()->baseURL().host();
         if (host.endsWith(".npr.org", false) || equalIgnoringCase(host, "npr.org"))
             return;
     }
-    
+
     playInternal();
 }
 
@@ -1503,11 +1502,11 @@ void HTMLMediaElement::playInternal()
     updatePlayState();
 }
 
-void HTMLMediaElement::pause(bool isUserGesture)
+void HTMLMediaElement::pause()
 {
-    LOG(Media, "HTMLMediaElement::pause(isUserGesture : %s)", boolString(isUserGesture));
+    LOG(Media, "HTMLMediaElement::pause()");
 
-    if (m_restrictions & RequireUserGestureForRateChangeRestriction && !isUserGesture)
+    if (m_restrictions & RequireUserGestureForRateChangeRestriction && !ScriptController::processingUserGesture())
         return;
 
     pauseInternal();
@@ -1635,7 +1634,7 @@ void HTMLMediaElement::beginScrubbing()
             // Because a media element stays in non-paused state when it reaches end, playback resumes 
             // when the slider is dragged from the end to another position unless we pause first. Do 
             // a "hard pause" so an event is generated, since we want to stay paused after scrubbing finishes.
-            pause(processingUserGesture());
+            pause();
         } else {
             // Not at the end but we still want to pause playback so the media engine doesn't try to
             // continue playing during scrubbing. Pause without generating an event as we will 
@@ -2386,7 +2385,7 @@ void HTMLMediaElement::resume()
         //  MEDIA_ERR_ABORTED while the abortEvent is being sent, but cleared immediately afterwards).
         // This behavior is not specified but it seems like a sensible thing to do.
         ExceptionCode ec;
-        load(processingUserGesture(), ec);
+        load(ec);
     }
 
     if (renderer())
@@ -2423,16 +2422,6 @@ void HTMLMediaElement::defaultEventHandler(Event* event)
 #endif
 }
 
-// FIXME: We should remove this function in favor of just calling ScriptController::processingUserGesture().
-bool HTMLMediaElement::processingUserGesture() const
-{
-    // 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 ScriptController::processingUserGesture();
-}
-
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
 
 void HTMLMediaElement::ensureMediaPlayer()
index 7028db7..e1ec459 100644 (file)
@@ -95,7 +95,7 @@ public:
     void setPreload(const String&);
 
     PassRefPtr<TimeRanges> buffered() const;
-    void load(bool isUserGesture, ExceptionCode&);
+    void load(ExceptionCode&);
     String canPlayType(const String& mimeType) const;
 
 // ready state
@@ -122,8 +122,8 @@ public:
     void setAutoplay(bool b);
     bool loop() const;    
     void setLoop(bool b);
-    void play(bool isUserGesture);
-    void pause(bool isUserGesture);
+    void play();
+    void pause();
 
 // captions
     bool webkitHasClosedCaptions() const;
@@ -174,8 +174,6 @@ public:
 
     MediaControls* mediaControls();
 
-    bool processingUserGesture() const;
-
     void sourceWillBeRemoved(HTMLSourceElement*);
     void sourceWasAdded(HTMLSourceElement*);
 
index 0bca569..b1a4787 100644 (file)
@@ -41,7 +41,7 @@ interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement {
     attribute DOMString preload;
 
     readonly attribute TimeRanges buffered;
-    [NeedsUserGestureCheck] void load() 
+    void load() 
         raises (DOMException);
     DOMString canPlayType(in DOMString type);
 
@@ -67,8 +67,8 @@ interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement {
     readonly attribute boolean ended;
     attribute [Reflect] boolean autoplay;
     attribute [Reflect] boolean loop;
-    [NeedsUserGestureCheck] void play();
-    [NeedsUserGestureCheck] void pause();
+    void play();
+    void pause();
 
     // controls
     attribute boolean controls;
index 59027a4..7274bf1 100644 (file)
@@ -39,6 +39,7 @@
 #include "Page.h"
 #include "RenderImage.h"
 #include "RenderVideo.h"
+#include "ScriptController.h"
 
 namespace WebCore {
 
@@ -230,14 +231,14 @@ bool HTMLVideoElement::hasAvailableVideoFrame() const
     return player()->hasAvailableVideoFrame();
 }
 
-void HTMLVideoElement::webkitEnterFullscreen(bool isUserGesture, ExceptionCode& ec)
+void HTMLVideoElement::webkitEnterFullscreen(ExceptionCode& ec)
 {
     if (isFullscreen())
         return;
 
     // Generate an exception if this isn't called in response to a user gesture, or if the 
     // element does not support fullscreen.
-    if ((requireUserGestureForFullScreen() && !isUserGesture) || !supportsFullscreen()) {
+    if ((requireUserGestureForFullScreen() && !ScriptController::processingUserGesture()) || !supportsFullscreen()) {
         ec = INVALID_STATE_ERR;
         return;
     }
index 450438a..82d0659 100644 (file)
@@ -45,14 +45,14 @@ public:
     unsigned videoHeight() const;
     
     // Fullscreen
-    void webkitEnterFullscreen(bool isUserGesture, ExceptionCode&);
+    void webkitEnterFullscreen(ExceptionCode&);
     void webkitExitFullscreen();
     bool webkitSupportsFullscreen();
     bool webkitDisplayingFullscreen();
 
     // FIXME: Maintain "FullScreen" capitalization scheme for backwards compatibility.
     // https://bugs.webkit.org/show_bug.cgi?id=36081
-    void webkitEnterFullScreen(bool isUserGesture, ExceptionCode& ec) { webkitEnterFullscreen(isUserGesture, ec); }
+    void webkitEnterFullScreen(ExceptionCode& ec) { webkitEnterFullscreen(ec); }
     void webkitExitFullScreen() { webkitExitFullscreen(); }
 
 #if ENABLE(MEDIA_STATISTICS)
index 5a3f484..8c7e39d 100644 (file)
@@ -37,11 +37,11 @@ module html {
         readonly attribute boolean webkitSupportsFullscreen;
         readonly attribute boolean webkitDisplayingFullscreen;
 
-        [NeedsUserGestureCheck] void webkitEnterFullscreen() raises (DOMException);
+        void webkitEnterFullscreen() raises (DOMException);
         void webkitExitFullscreen();
 
         // Note the different capitalization of the "S" in FullScreen.
-        [NeedsUserGestureCheck] void webkitEnterFullScreen() raises (DOMException);
+        void webkitEnterFullScreen() raises (DOMException);
         void webkitExitFullScreen();
 
 #if defined(ENABLE_MEDIA_STATISTICS) && ENABLE_MEDIA_STATISTICS
index b9d4cfc..f27d21f 100644 (file)
@@ -40,6 +40,7 @@
 #include "MainResourceLoader.h"
 #include "NodeList.h"
 #include "RawDataDocumentParser.h"
+#include "ScriptController.h"
 
 namespace WebCore {
 
@@ -164,12 +165,12 @@ void MediaDocument::defaultEventHandler(Event* event)
     if (HTMLVideoElement* video = ancestorVideoElement(targetNode)) {
         if (event->type() == eventNames().clickEvent) {
             if (!video->canPlay()) {
-                video->pause(event->fromUserGesture());
+                video->pause();
                 event->setDefaultHandled();
             }
         } else if (event->type() == eventNames().dblclickEvent) {
             if (video->canPlay()) {
-                video->play(event->fromUserGesture());
+                video->play();
                 event->setDefaultHandled();
             }
         }
@@ -184,9 +185,9 @@ void MediaDocument::defaultEventHandler(Event* event)
         if (keyboardEvent->keyIdentifier() == "U+0020") { // space
             if (video->paused()) {
                 if (video->canPlay())
-                    video->play(event->fromUserGesture());
+                    video->play();
             } else
-                video->pause(event->fromUserGesture());
+                video->pause();
             event->setDefaultHandled();
         }
     }
index 835a010..41c1d7f 100644 (file)
@@ -47,6 +47,7 @@
 #include "RenderSlider.h"
 #include "RenderTheme.h"
 #include "RenderView.h"
+#include "ScriptController.h"
 #include "Settings.h"
 
 namespace WebCore {
@@ -547,7 +548,7 @@ void MediaControlSeekButtonElement::defaultEventHandler(Event* event)
             m_capturing = true;
             frame->eventHandler()->setCapturingMouseEventsNode(this);
         }
-        mediaElement()->pause(event->fromUserGesture());
+        mediaElement()->pause();
         m_seekTimer.startRepeating(cSeekRepeatDelay);
         event->setDefaultHandled();
     } else if (event->type() == eventNames().mouseupEvent) {
index 4cf62ba..94c93b1 100644 (file)
@@ -39,6 +39,7 @@
 #include "Page.h"
 #include "RenderLayer.h"
 #include "RenderTextControlSingleLine.h"
+#include "ScriptController.h"
 #include "ScrollbarTheme.h"
 #include "SpeechInput.h"
 #include "SpeechInputEvent.h"
@@ -388,7 +389,7 @@ PassRefPtr<InputFieldSpeechButtonElement> InputFieldSpeechButtonElement::create(
 void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
 {
     // For privacy reasons, only allow clicks directly coming from the user.
-    if (!event->fromUserGesture()) {
+    if (!ScriptController::processingUserGesture()) {
         HTMLDivElement::defaultEventHandler(event);
         return;
     }
index 9ac57b7..0591f75 100644 (file)
@@ -1,3 +1,17 @@
+2011-06-16  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r89026.
+        http://trac.webkit.org/changeset/89026
+        https://bugs.webkit.org/show_bug.cgi?id=62804
+
+        These patches were likely correct.  I'll investigate the
+        browser_test failures. (Requested by abarth on #webkit).
+
+        * src/WebPluginContainerImpl.cpp:
+        (WebKit::WebPluginContainerImpl::loadFrameRequest):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::performMediaPlayerAction):
+
 2011-06-16  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Reviewed by Pavel Feldman.
index f7abd31..272ed40 100644 (file)
@@ -365,8 +365,7 @@ WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url, bool popup
     return resultStr;
 }
 
-void WebPluginContainerImpl::loadFrameRequest(
-    const WebURLRequest& request, const WebString& target, bool notifyNeeded, void* notifyData)
+void WebPluginContainerImpl::loadFrameRequest(const WebURLRequest& request, const WebString& target, bool notifyNeeded, void* notifyData)
 {
     Frame* frame = m_element->document()->frame();
     if (!frame)
@@ -382,19 +381,9 @@ void WebPluginContainerImpl::loadFrameRequest(
         WebDataSourceImpl::setNextPluginLoadObserver(observer.release());
     }
 
-    FrameLoadRequest frameRequest(frame->document()->securityOrigin(),
-        request.toResourceRequest(), target);
-
-    UserGestureIndicator gestureIndicator(request.hasUserGesture() ?
-        DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
-
-    frame->loader()->loadFrameRequest(
-        frameRequest,
-        false,  // lock history
-        false,  // lock back forward list
-        0,      // event
-        0,     // form state
-        SendReferrer);
+    FrameLoadRequest frameRequest(frame->document()->securityOrigin(), request.toResourceRequest(), target);
+    UserGestureIndicator gestureIndicator(request.hasUserGesture() ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
+    frame->loader()->loadFrameRequest(frameRequest, false, false, 0, 0, SendReferrer);
 }
 
 void WebPluginContainerImpl::zoomLevelChanged(double zoomLevel)
index c05578b..08786d9 100644 (file)
@@ -1797,8 +1797,7 @@ double WebView::zoomFactorToZoomLevel(double factor)
 void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action,
                                            const WebPoint& location)
 {
-    HitTestResult result =
-        hitTestResultForWindowPos(location);
+    HitTestResult result = hitTestResultForWindowPos(location);
     RefPtr<Node> node = result.innerNonSharedNode();
     if (!node->hasTagName(HTMLNames::videoTag) && !node->hasTagName(HTMLNames::audioTag))
       return;
@@ -1808,9 +1807,9 @@ void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action,
     switch (action.type) {
     case WebMediaPlayerAction::Play:
         if (action.enable)
-            mediaElement->play(mediaElement->processingUserGesture());
+            mediaElement->play();
         else
-            mediaElement->pause(mediaElement->processingUserGesture());
+            mediaElement->pause();
         break;
     case WebMediaPlayerAction::Mute:
         mediaElement->setMuted(action.enable);
index 1cab351..9459cf0 100644 (file)
@@ -1,3 +1,16 @@
+2011-06-16  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r89026.
+        http://trac.webkit.org/changeset/89026
+        https://bugs.webkit.org/show_bug.cgi?id=62804
+
+        These patches were likely correct.  I'll investigate the
+        browser_test failures. (Requested by abarth on #webkit).
+
+        * WebCoreSupport/FullscreenVideoController.cpp:
+        (FullscreenVideoController::play):
+        (FullscreenVideoController::pause):
+
 2011-06-16  Vitaly Repeshko  <vitalyr@chromium.org>
 
         Unreviewed.
index ea2caa8..04cfb06 100644 (file)
@@ -368,7 +368,7 @@ bool FullscreenVideoController::canPlay() const
 void FullscreenVideoController::play()
 {
     if (m_mediaElement)
-        m_mediaElement->play(m_mediaElement->processingUserGesture());
+        m_mediaElement->play();
 
     playStateChanged();
     showHud(true);
@@ -377,7 +377,7 @@ void FullscreenVideoController::play()
 void FullscreenVideoController::pause()
 {
     if (m_mediaElement)
-        m_mediaElement->pause(m_mediaElement->processingUserGesture());
+        m_mediaElement->pause();
 
     playStateChanged();
     showHud(false);
index fa02dc0..0017365 100644 (file)
@@ -1,3 +1,15 @@
+2011-06-16  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r89026.
+        http://trac.webkit.org/changeset/89026
+        https://bugs.webkit.org/show_bug.cgi?id=62804
+
+        These patches were likely correct.  I'll investigate the
+        browser_test failures. (Requested by abarth on #webkit).
+
+        * WebView/WebVideoFullscreenHUDWindowController.mm:
+        (-[WebVideoFullscreenHUDWindowController setPlaying:]):
+
 2011-06-16  Vitaly Repeshko  <vitalyr@chromium.org>
 
         Unreviewed.
index 5866e52..bff912b 100644 (file)
@@ -563,9 +563,9 @@ static NSTextField *createTimeTextField(NSRect frame)
         return;
 
     if (playing)
-        mediaElement->play(mediaElement->processingUserGesture());
+        mediaElement->play();
     else
-        mediaElement->pause(mediaElement->processingUserGesture());
+        mediaElement->pause();
 }
 
 static NSString *timeToString(double time)
index f910962..9d8f79e 100644 (file)
@@ -1,3 +1,16 @@
+2011-06-16  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r89026.
+        http://trac.webkit.org/changeset/89026
+        https://bugs.webkit.org/show_bug.cgi?id=62804
+
+        These patches were likely correct.  I'll investigate the
+        browser_test failures. (Requested by abarth on #webkit).
+
+        * FullscreenVideoController.cpp:
+        (FullscreenVideoController::play):
+        (FullscreenVideoController::pause):
+
 2011-06-16  Vitaly Repeshko  <vitalyr@chromium.org>
 
         Unreviewed.
index 2c488f2..30405c6 100644 (file)
@@ -325,13 +325,13 @@ bool FullscreenVideoController::canPlay() const
 void FullscreenVideoController::play()
 {
     if (m_mediaElement)
-        m_mediaElement->play(m_mediaElement->processingUserGesture());
+        m_mediaElement->play();
 }
 
 void FullscreenVideoController::pause()
 {
     if (m_mediaElement)
-        m_mediaElement->pause(m_mediaElement->processingUserGesture());
+        m_mediaElement->pause();
 }
 
 float FullscreenVideoController::volume() const