Changeset 89018 in webkit
- Timestamp:
- Jun 16, 2011 1:49:12 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89016 r89018 1 2011-06-16 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Remove HTMLVideoElement::processingUserGesture 6 https://bugs.webkit.org/show_bug.cgi?id=62784 7 8 HTMLMediaElement shouldn't have its own notion of the user gesture 9 state. It should just use the normal user gesture state. Also, 10 there's no point in having the bindings send the user gesture state in 11 a boolean parameter. 12 13 * WebCore.exp.in: 14 * html/HTMLMediaElement.cpp: 15 (WebCore::HTMLMediaElement::removedFromDocument): 16 (WebCore::HTMLMediaElement::load): 17 (WebCore::HTMLMediaElement::play): 18 (WebCore::HTMLMediaElement::pause): 19 (WebCore::HTMLMediaElement::beginScrubbing): 20 (WebCore::HTMLMediaElement::resume): 21 * html/HTMLMediaElement.h: 22 * html/HTMLMediaElement.idl: 23 * html/HTMLVideoElement.cpp: 24 (WebCore::HTMLVideoElement::webkitEnterFullscreen): 25 * html/HTMLVideoElement.h: 26 (WebCore::HTMLVideoElement::webkitEnterFullScreen): 27 * html/HTMLVideoElement.idl: 28 * html/MediaDocument.cpp: 29 (WebCore::MediaDocument::defaultEventHandler): 30 * html/shadow/MediaControlElements.cpp: 31 (WebCore::MediaControlSeekButtonElement::defaultEventHandler): 32 1 33 2011-06-16 Sheriff Bot <webkit.review.bot@gmail.com> 2 34 -
trunk/Source/WebCore/WebCore.exp.in
r89007 r89018 1809 1809 __ZN7WebCore16HTMLMediaElement20getSitesInMediaCacheERN3WTF6VectorINS1_6StringELm0EEE 1810 1810 __ZN7WebCore16HTMLMediaElement22clearMediaCacheForSiteERKN3WTF6StringE 1811 __ZN7WebCore16HTMLMediaElement4playE b1812 __ZN7WebCore16HTMLMediaElement5pauseE b1811 __ZN7WebCore16HTMLMediaElement4playEv 1812 __ZN7WebCore16HTMLMediaElement5pauseEv 1813 1813 __ZN7WebCore16HTMLMediaElement6rewindEf 1814 1814 __ZN7WebCore16HTMLMediaElement8setMutedEb … … 1816 1816 __ZNK7WebCore16HTMLMediaElement11currentTimeEv 1817 1817 __ZNK7WebCore16HTMLMediaElement13platformMediaEv 1818 __ZNK7WebCore16HTMLMediaElement21processingUserGestureEv1819 1818 __ZNK7WebCore16HTMLMediaElement5mutedEv 1820 1819 __ZNK7WebCore16HTMLMediaElement6volumeEv -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r88958 r89018 360 360 LOG(Media, "HTMLMediaElement::removedFromDocument"); 361 361 if (m_networkState > NETWORK_EMPTY) 362 pause( processingUserGesture());362 pause(); 363 363 if (m_isFullscreen) 364 364 exitFullscreen(); … … 490 490 } 491 491 492 void HTMLMediaElement::load( bool isUserGesture,ExceptionCode& ec)493 { 494 LOG(Media, "HTMLMediaElement::load( isUserGesture : %s)", boolString(isUserGesture));495 496 if (m_restrictions & RequireUserGestureForLoadRestriction && ! isUserGesture)492 void HTMLMediaElement::load(ExceptionCode& ec) 493 { 494 LOG(Media, "HTMLMediaElement::load()"); 495 496 if (m_restrictions & RequireUserGestureForLoadRestriction && !ScriptController::processingUserGesture()) 497 497 ec = INVALID_STATE_ERR; 498 498 else { 499 m_loadInitiatedByUserGesture = isUserGesture;499 m_loadInitiatedByUserGesture = ScriptController::processingUserGesture(); 500 500 prepareForLoad(); 501 501 loadInternal(); … … 1455 1455 } 1456 1456 1457 void HTMLMediaElement::play(bool isUserGesture) 1458 { 1459 LOG(Media, "HTMLMediaElement::play(isUserGesture : %s)", boolString(isUserGesture)); 1460 1461 if (m_restrictions & RequireUserGestureForRateChangeRestriction && !isUserGesture) 1462 return; 1463 1464 Document* doc = document(); 1465 Settings* settings = doc->settings(); 1457 void HTMLMediaElement::play() 1458 { 1459 LOG(Media, "HTMLMediaElement::play()"); 1460 1461 if (m_restrictions & RequireUserGestureForRateChangeRestriction && !ScriptController::processingUserGesture()) 1462 return; 1463 1464 Settings* settings = document()->settings(); 1466 1465 if (settings && settings->needsSiteSpecificQuirks() && m_dispatchingCanPlayEvent && !m_loadInitiatedByUserGesture) { 1467 1466 // It should be impossible to be processing the canplay event while handling a user gesture 1468 1467 // since it is dispatched asynchronously. 1469 ASSERT(! isUserGesture);1470 String host = doc ->baseURL().host();1468 ASSERT(!ScriptController::processingUserGesture()); 1469 String host = document()->baseURL().host(); 1471 1470 if (host.endsWith(".npr.org", false) || equalIgnoringCase(host, "npr.org")) 1472 1471 return; 1473 1472 } 1474 1473 1475 1474 playInternal(); 1476 1475 } … … 1504 1503 } 1505 1504 1506 void HTMLMediaElement::pause( bool isUserGesture)1507 { 1508 LOG(Media, "HTMLMediaElement::pause( isUserGesture : %s)", boolString(isUserGesture));1509 1510 if (m_restrictions & RequireUserGestureForRateChangeRestriction && ! isUserGesture)1505 void HTMLMediaElement::pause() 1506 { 1507 LOG(Media, "HTMLMediaElement::pause()"); 1508 1509 if (m_restrictions & RequireUserGestureForRateChangeRestriction && !ScriptController::processingUserGesture()) 1511 1510 return; 1512 1511 … … 1636 1635 // when the slider is dragged from the end to another position unless we pause first. Do 1637 1636 // a "hard pause" so an event is generated, since we want to stay paused after scrubbing finishes. 1638 pause( processingUserGesture());1637 pause(); 1639 1638 } else { 1640 1639 // Not at the end but we still want to pause playback so the media engine doesn't try to … … 2387 2386 // This behavior is not specified but it seems like a sensible thing to do. 2388 2387 ExceptionCode ec; 2389 load( processingUserGesture(),ec);2388 load(ec); 2390 2389 } 2391 2390 … … 2422 2421 HTMLElement::defaultEventHandler(event); 2423 2422 #endif 2424 }2425 2426 // FIXME: We should remove this function in favor of just calling ScriptController::processingUserGesture().2427 bool HTMLMediaElement::processingUserGesture() const2428 {2429 // FIXME: We should remove this check, but it seems to be needed to stop2430 // some media tests from crashing.2431 if (!document()->frame())2432 return true;2433 return ScriptController::processingUserGesture();2434 2423 } 2435 2424 -
trunk/Source/WebCore/html/HTMLMediaElement.h
r88958 r89018 96 96 97 97 PassRefPtr<TimeRanges> buffered() const; 98 void load( bool isUserGesture,ExceptionCode&);98 void load(ExceptionCode&); 99 99 String canPlayType(const String& mimeType) const; 100 100 … … 123 123 bool loop() const; 124 124 void setLoop(bool b); 125 void play( bool isUserGesture);126 void pause( bool isUserGesture);125 void play(); 126 void pause(); 127 127 128 128 // captions … … 174 174 175 175 MediaControls* mediaControls(); 176 177 bool processingUserGesture() const;178 176 179 177 void sourceWillBeRemoved(HTMLSourceElement*); -
trunk/Source/WebCore/html/HTMLMediaElement.idl
r87539 r89018 42 42 43 43 readonly attribute TimeRanges buffered; 44 [NeedsUserGestureCheck]void load()44 void load() 45 45 raises (DOMException); 46 46 DOMString canPlayType(in DOMString type); … … 68 68 attribute [Reflect] boolean autoplay; 69 69 attribute [Reflect] boolean loop; 70 [NeedsUserGestureCheck]void play();71 [NeedsUserGestureCheck]void pause();70 void play(); 71 void pause(); 72 72 73 73 // controls -
trunk/Source/WebCore/html/HTMLVideoElement.cpp
r87125 r89018 40 40 #include "RenderImage.h" 41 41 #include "RenderVideo.h" 42 #include "ScriptController.h" 42 43 43 44 namespace WebCore { … … 231 232 } 232 233 233 void HTMLVideoElement::webkitEnterFullscreen( bool isUserGesture,ExceptionCode& ec)234 void HTMLVideoElement::webkitEnterFullscreen(ExceptionCode& ec) 234 235 { 235 236 if (isFullscreen()) … … 238 239 // Generate an exception if this isn't called in response to a user gesture, or if the 239 240 // element does not support fullscreen. 240 if ((requireUserGestureForFullScreen() && ! isUserGesture) || !supportsFullscreen()) {241 if ((requireUserGestureForFullScreen() && !ScriptController::processingUserGesture()) || !supportsFullscreen()) { 241 242 ec = INVALID_STATE_ERR; 242 243 return; -
trunk/Source/WebCore/html/HTMLVideoElement.h
r87125 r89018 46 46 47 47 // Fullscreen 48 void webkitEnterFullscreen( bool isUserGesture,ExceptionCode&);48 void webkitEnterFullscreen(ExceptionCode&); 49 49 void webkitExitFullscreen(); 50 50 bool webkitSupportsFullscreen(); … … 53 53 // FIXME: Maintain "FullScreen" capitalization scheme for backwards compatibility. 54 54 // https://bugs.webkit.org/show_bug.cgi?id=36081 55 void webkitEnterFullScreen( bool isUserGesture, ExceptionCode& ec) { webkitEnterFullscreen(isUserGesture,ec); }55 void webkitEnterFullScreen(ExceptionCode& ec) { webkitEnterFullscreen(ec); } 56 56 void webkitExitFullScreen() { webkitExitFullscreen(); } 57 57 -
trunk/Source/WebCore/html/HTMLVideoElement.idl
r88619 r89018 38 38 readonly attribute boolean webkitDisplayingFullscreen; 39 39 40 [NeedsUserGestureCheck]void webkitEnterFullscreen() raises (DOMException);40 void webkitEnterFullscreen() raises (DOMException); 41 41 void webkitExitFullscreen(); 42 42 43 43 // Note the different capitalization of the "S" in FullScreen. 44 [NeedsUserGestureCheck]void webkitEnterFullScreen() raises (DOMException);44 void webkitEnterFullScreen() raises (DOMException); 45 45 void webkitExitFullScreen(); 46 46 -
trunk/Source/WebCore/html/MediaDocument.cpp
r89007 r89018 166 166 if (event->type() == eventNames().clickEvent) { 167 167 if (!video->canPlay()) { 168 video->pause( ScriptController::processingUserGesture());168 video->pause(); 169 169 event->setDefaultHandled(); 170 170 } 171 171 } else if (event->type() == eventNames().dblclickEvent) { 172 172 if (video->canPlay()) { 173 video->play( ScriptController::processingUserGesture());173 video->play(); 174 174 event->setDefaultHandled(); 175 175 } … … 186 186 if (video->paused()) { 187 187 if (video->canPlay()) 188 video->play( ScriptController::processingUserGesture());188 video->play(); 189 189 } else 190 video->pause( ScriptController::processingUserGesture());190 video->pause(); 191 191 event->setDefaultHandled(); 192 192 } -
trunk/Source/WebCore/html/shadow/MediaControlElements.cpp
r89007 r89018 549 549 frame->eventHandler()->setCapturingMouseEventsNode(this); 550 550 } 551 mediaElement()->pause( ScriptController::processingUserGesture());551 mediaElement()->pause(); 552 552 m_seekTimer.startRepeating(cSeekRepeatDelay); 553 553 event->setDefaultHandled(); -
trunk/Source/WebKit/chromium/ChangeLog
r89008 r89018 1 2011-06-16 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Remove HTMLVideoElement::processingUserGesture 6 https://bugs.webkit.org/show_bug.cgi?id=62784 7 8 * src/WebViewImpl.cpp: 9 (WebKit::WebViewImpl::performMediaPlayerAction): 10 1 11 2011-06-15 Mikhail Naganov <mnaganov@chromium.org> 2 12 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r88835 r89018 1798 1798 const WebPoint& location) 1799 1799 { 1800 HitTestResult result = 1801 hitTestResultForWindowPos(location); 1800 HitTestResult result = hitTestResultForWindowPos(location); 1802 1801 RefPtr<Node> node = result.innerNonSharedNode(); 1803 1802 if (!node->hasTagName(HTMLNames::videoTag) && !node->hasTagName(HTMLNames::audioTag)) … … 1809 1808 case WebMediaPlayerAction::Play: 1810 1809 if (action.enable) 1811 mediaElement->play( mediaElement->processingUserGesture());1810 mediaElement->play(); 1812 1811 else 1813 mediaElement->pause( mediaElement->processingUserGesture());1812 mediaElement->pause(); 1814 1813 break; 1815 1814 case WebMediaPlayerAction::Mute: -
trunk/Source/WebKit/gtk/ChangeLog
r88935 r89018 1 2011-06-16 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Remove HTMLVideoElement::processingUserGesture 6 https://bugs.webkit.org/show_bug.cgi?id=62784 7 8 * WebCoreSupport/FullscreenVideoController.cpp: 9 (FullscreenVideoController::play): 10 (FullscreenVideoController::pause): 11 1 12 2011-06-15 Claudio Saavedra <csaavedra@igalia.com> 2 13 -
trunk/Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
r75605 r89018 369 369 { 370 370 if (m_mediaElement) 371 m_mediaElement->play( m_mediaElement->processingUserGesture());371 m_mediaElement->play(); 372 372 373 373 playStateChanged(); … … 378 378 { 379 379 if (m_mediaElement) 380 m_mediaElement->pause( m_mediaElement->processingUserGesture());380 m_mediaElement->pause(); 381 381 382 382 playStateChanged(); -
trunk/Source/WebKit/mac/ChangeLog
r89001 r89018 1 2011-06-16 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Remove HTMLVideoElement::processingUserGesture 6 https://bugs.webkit.org/show_bug.cgi?id=62784 7 8 * WebView/WebVideoFullscreenHUDWindowController.mm: 9 (-[WebVideoFullscreenHUDWindowController setPlaying:]): 10 1 11 2011-06-15 Adam Barth <abarth@webkit.org> 2 12 -
trunk/Source/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
r85036 r89018 564 564 565 565 if (playing) 566 mediaElement->play( mediaElement->processingUserGesture());566 mediaElement->play(); 567 567 else 568 mediaElement->pause( mediaElement->processingUserGesture());568 mediaElement->pause(); 569 569 } 570 570 -
trunk/Source/WebKit/win/ChangeLog
r88737 r89018 1 2011-06-16 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Remove HTMLVideoElement::processingUserGesture 6 https://bugs.webkit.org/show_bug.cgi?id=62784 7 8 * FullscreenVideoController.cpp: 9 (FullscreenVideoController::play): 10 (FullscreenVideoController::pause): 11 1 12 2011-06-13 Kentaro Hara <haraken@google.com> 2 13 -
trunk/Source/WebKit/win/FullscreenVideoController.cpp
r85699 r89018 326 326 { 327 327 if (m_mediaElement) 328 m_mediaElement->play( m_mediaElement->processingUserGesture());328 m_mediaElement->play(); 329 329 } 330 330 … … 332 332 { 333 333 if (m_mediaElement) 334 m_mediaElement->pause( m_mediaElement->processingUserGesture());334 m_mediaElement->pause(); 335 335 } 336 336
Note: See TracChangeset
for help on using the changeset viewer.