Diff
Modified: trunk/Source/WebCore/ChangeLog (89017 => 89018)
--- trunk/Source/WebCore/ChangeLog 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebCore/ChangeLog 2011-06-16 08:49:12 UTC (rev 89018)
@@ -1,3 +1,35 @@
+2011-06-16 Adam Barth <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Remove HTMLVideoElement::processingUserGesture
+ https://bugs.webkit.org/show_bug.cgi?id=62784
+
+ HTMLMediaElement shouldn't have its own notion of the user gesture
+ state. It should just use the normal user gesture state. Also,
+ there's no point in having the bindings send the user gesture state in
+ a boolean parameter.
+
+ * WebCore.exp.in:
+ * 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):
+
2011-06-16 Sheriff Bot <[email protected]>
Unreviewed, rolling out r89011.
Modified: trunk/Source/WebCore/WebCore.exp.in (89017 => 89018)
--- trunk/Source/WebCore/WebCore.exp.in 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebCore/WebCore.exp.in 2011-06-16 08:49:12 UTC (rev 89018)
@@ -1808,14 +1808,13 @@
__ZN7WebCore16HTMLMediaElement15clearMediaCacheEv
__ZN7WebCore16HTMLMediaElement20getSitesInMediaCacheERN3WTF6VectorINS1_6StringELm0EEE
__ZN7WebCore16HTMLMediaElement22clearMediaCacheForSiteERKN3WTF6StringE
-__ZN7WebCore16HTMLMediaElement4playEb
-__ZN7WebCore16HTMLMediaElement5pauseEb
+__ZN7WebCore16HTMLMediaElement4playEv
+__ZN7WebCore16HTMLMediaElement5pauseEv
__ZN7WebCore16HTMLMediaElement6rewindEf
__ZN7WebCore16HTMLMediaElement8setMutedEb
__ZN7WebCore16HTMLMediaElement9setVolumeEfRi
__ZNK7WebCore16HTMLMediaElement11currentTimeEv
__ZNK7WebCore16HTMLMediaElement13platformMediaEv
-__ZNK7WebCore16HTMLMediaElement21processingUserGestureEv
__ZNK7WebCore16HTMLMediaElement5mutedEv
__ZNK7WebCore16HTMLMediaElement6volumeEv
__ZNK7WebCore16HTMLMediaElement7canPlayEv
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (89017 => 89018)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2011-06-16 08:49:12 UTC (rev 89018)
@@ -359,7 +359,7 @@
{
LOG(Media, "HTMLMediaElement::removedFromDocument");
if (m_networkState > NETWORK_EMPTY)
- pause(processingUserGesture());
+ pause();
if (m_isFullscreen)
exitFullscreen();
HTMLElement::removedFromDocument();
@@ -489,14 +489,14 @@
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 @@
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 @@
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 @@
// 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 @@
// 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 @@
#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()
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (89017 => 89018)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2011-06-16 08:49:12 UTC (rev 89018)
@@ -95,7 +95,7 @@
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 @@
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 @@
MediaControls* mediaControls();
- bool processingUserGesture() const;
-
void sourceWillBeRemoved(HTMLSourceElement*);
void sourceWasAdded(HTMLSourceElement*);
Modified: trunk/Source/WebCore/html/HTMLMediaElement.idl (89017 => 89018)
--- trunk/Source/WebCore/html/HTMLMediaElement.idl 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebCore/html/HTMLMediaElement.idl 2011-06-16 08:49:12 UTC (rev 89018)
@@ -41,7 +41,7 @@
attribute DOMString preload;
readonly attribute TimeRanges buffered;
- [NeedsUserGestureCheck] void load()
+ void load()
raises (DOMException);
DOMString canPlayType(in DOMString type);
@@ -67,8 +67,8 @@
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;
Modified: trunk/Source/WebCore/html/HTMLVideoElement.cpp (89017 => 89018)
--- trunk/Source/WebCore/html/HTMLVideoElement.cpp 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebCore/html/HTMLVideoElement.cpp 2011-06-16 08:49:12 UTC (rev 89018)
@@ -39,6 +39,7 @@
#include "Page.h"
#include "RenderImage.h"
#include "RenderVideo.h"
+#include "ScriptController.h"
namespace WebCore {
@@ -230,14 +231,14 @@
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;
}
Modified: trunk/Source/WebCore/html/HTMLVideoElement.h (89017 => 89018)
--- trunk/Source/WebCore/html/HTMLVideoElement.h 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebCore/html/HTMLVideoElement.h 2011-06-16 08:49:12 UTC (rev 89018)
@@ -45,14 +45,14 @@
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)
Modified: trunk/Source/WebCore/html/HTMLVideoElement.idl (89017 => 89018)
--- trunk/Source/WebCore/html/HTMLVideoElement.idl 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebCore/html/HTMLVideoElement.idl 2011-06-16 08:49:12 UTC (rev 89018)
@@ -37,11 +37,11 @@
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
Modified: trunk/Source/WebCore/html/MediaDocument.cpp (89017 => 89018)
--- trunk/Source/WebCore/html/MediaDocument.cpp 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebCore/html/MediaDocument.cpp 2011-06-16 08:49:12 UTC (rev 89018)
@@ -165,12 +165,12 @@
if (HTMLVideoElement* video = ancestorVideoElement(targetNode)) {
if (event->type() == eventNames().clickEvent) {
if (!video->canPlay()) {
- video->pause(ScriptController::processingUserGesture());
+ video->pause();
event->setDefaultHandled();
}
} else if (event->type() == eventNames().dblclickEvent) {
if (video->canPlay()) {
- video->play(ScriptController::processingUserGesture());
+ video->play();
event->setDefaultHandled();
}
}
@@ -185,9 +185,9 @@
if (keyboardEvent->keyIdentifier() == "U+0020") { // space
if (video->paused()) {
if (video->canPlay())
- video->play(ScriptController::processingUserGesture());
+ video->play();
} else
- video->pause(ScriptController::processingUserGesture());
+ video->pause();
event->setDefaultHandled();
}
}
Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (89017 => 89018)
--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp 2011-06-16 08:49:12 UTC (rev 89018)
@@ -548,7 +548,7 @@
m_capturing = true;
frame->eventHandler()->setCapturingMouseEventsNode(this);
}
- mediaElement()->pause(ScriptController::processingUserGesture());
+ mediaElement()->pause();
m_seekTimer.startRepeating(cSeekRepeatDelay);
event->setDefaultHandled();
} else if (event->type() == eventNames().mouseupEvent) {
Modified: trunk/Source/WebKit/chromium/ChangeLog (89017 => 89018)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-06-16 08:49:12 UTC (rev 89018)
@@ -1,3 +1,13 @@
+2011-06-16 Adam Barth <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Remove HTMLVideoElement::processingUserGesture
+ https://bugs.webkit.org/show_bug.cgi?id=62784
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::performMediaPlayerAction):
+
2011-06-15 Mikhail Naganov <[email protected]>
Reviewed by Pavel Feldman.
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (89017 => 89018)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-06-16 08:49:12 UTC (rev 89018)
@@ -1797,8 +1797,7 @@
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 @@
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);
Modified: trunk/Source/WebKit/gtk/ChangeLog (89017 => 89018)
--- trunk/Source/WebKit/gtk/ChangeLog 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebKit/gtk/ChangeLog 2011-06-16 08:49:12 UTC (rev 89018)
@@ -1,3 +1,14 @@
+2011-06-16 Adam Barth <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Remove HTMLVideoElement::processingUserGesture
+ https://bugs.webkit.org/show_bug.cgi?id=62784
+
+ * WebCoreSupport/FullscreenVideoController.cpp:
+ (FullscreenVideoController::play):
+ (FullscreenVideoController::pause):
+
2011-06-15 Claudio Saavedra <[email protected]>
Reviewed by Xan Lopez.
Modified: trunk/Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp (89017 => 89018)
--- trunk/Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp 2011-06-16 08:49:12 UTC (rev 89018)
@@ -368,7 +368,7 @@
void FullscreenVideoController::play()
{
if (m_mediaElement)
- m_mediaElement->play(m_mediaElement->processingUserGesture());
+ m_mediaElement->play();
playStateChanged();
showHud(true);
@@ -377,7 +377,7 @@
void FullscreenVideoController::pause()
{
if (m_mediaElement)
- m_mediaElement->pause(m_mediaElement->processingUserGesture());
+ m_mediaElement->pause();
playStateChanged();
showHud(false);
Modified: trunk/Source/WebKit/mac/ChangeLog (89017 => 89018)
--- trunk/Source/WebKit/mac/ChangeLog 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebKit/mac/ChangeLog 2011-06-16 08:49:12 UTC (rev 89018)
@@ -1,3 +1,13 @@
+2011-06-16 Adam Barth <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Remove HTMLVideoElement::processingUserGesture
+ https://bugs.webkit.org/show_bug.cgi?id=62784
+
+ * WebView/WebVideoFullscreenHUDWindowController.mm:
+ (-[WebVideoFullscreenHUDWindowController setPlaying:]):
+
2011-06-15 Adam Barth <[email protected]>
Reviewed by Eric Seidel.
Modified: trunk/Source/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm (89017 => 89018)
--- trunk/Source/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm 2011-06-16 08:49:12 UTC (rev 89018)
@@ -563,9 +563,9 @@
return;
if (playing)
- mediaElement->play(mediaElement->processingUserGesture());
+ mediaElement->play();
else
- mediaElement->pause(mediaElement->processingUserGesture());
+ mediaElement->pause();
}
static NSString *timeToString(double time)
Modified: trunk/Source/WebKit/win/ChangeLog (89017 => 89018)
--- trunk/Source/WebKit/win/ChangeLog 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebKit/win/ChangeLog 2011-06-16 08:49:12 UTC (rev 89018)
@@ -1,3 +1,14 @@
+2011-06-16 Adam Barth <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Remove HTMLVideoElement::processingUserGesture
+ https://bugs.webkit.org/show_bug.cgi?id=62784
+
+ * FullscreenVideoController.cpp:
+ (FullscreenVideoController::play):
+ (FullscreenVideoController::pause):
+
2011-06-13 Kentaro Hara <[email protected]>
Reviewed by Alexey Proskuryakov.
Modified: trunk/Source/WebKit/win/FullscreenVideoController.cpp (89017 => 89018)
--- trunk/Source/WebKit/win/FullscreenVideoController.cpp 2011-06-16 08:47:55 UTC (rev 89017)
+++ trunk/Source/WebKit/win/FullscreenVideoController.cpp 2011-06-16 08:49:12 UTC (rev 89018)
@@ -325,13 +325,13 @@
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