WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
FullScreen-WebCore-MediaElements
FullScreen-WebCore-MediaElements.patch (text/plain), 4.45 KB, created by
Jer Noble
on 2010-08-05 13:39:59 PDT
(
hide
)
Description:
FullScreen-WebCore-MediaElements
Filename:
MIME Type:
Creator:
Jer Noble
Created:
2010-08-05 13:39:59 PDT
Size:
4.45 KB
patch
obsolete
>Index: WebCore/html/HTMLMediaElement.cpp >=================================================================== >--- WebCore/html/HTMLMediaElement.cpp (revision 64653) >+++ WebCore/html/HTMLMediaElement.cpp (working copy) >@@ -312,8 +312,12 @@ void HTMLMediaElement::removedFromDocume > { > if (m_networkState > NETWORK_EMPTY) > pause(processingUserGesture()); >- if (m_isFullscreen) >+#if !ENABLE(FULLSCREEN_API) >+ // Only manually exit full-screen mode if >+ // we are not using the new full-screen API. >+ if (isFullscreen()) > exitFullscreen(); >+#endif > HTMLElement::removedFromDocument(); > } > >@@ -1852,8 +1856,12 @@ void HTMLMediaElement::userCancelledLoad > > void HTMLMediaElement::documentWillBecomeInactive() > { >- if (m_isFullscreen) >+#if !ENABLE(FULLSCREEN_API) >+ // Only manually exit full-screen mode if >+ // we are not using the new full-screen API. >+ if (isFullscreen()) > exitFullscreen(); >+#endif > > m_inActiveDocument = false; > userCancelledLoad(); >@@ -2013,24 +2021,44 @@ void HTMLMediaElement::createMediaPlayer > } > #endif // ENABLE(PLUGIN_PROXY_FOR_VIDEO) > >+bool HTMLMediaElement::isFullscreen() const >+{ >+#if ENABLE(FULLSCREEN_API) >+ return document() ? document()->webkitCurrentFullScreenElement() == this : false; >+#else >+ return m_isFullscreen; >+#endif >+} >+ > void HTMLMediaElement::enterFullscreen() > { >+#if ENABLE(FULLSCREEN_API) >+ ASSERT(!isFullscreen()); >+ webkitRequestFullScreenWithKeys(); >+#else > ASSERT(!m_isFullscreen); > m_isFullscreen = true; > if (document() && document()->page()) { >- document()->page()->chrome()->client()->enterFullscreenForNode(this); >+ document()->page()->chrome()->client()->enterFullscreenForElement(this); > scheduleEvent(eventNames().webkitbeginfullscreenEvent); > } >+#endif > } > > void HTMLMediaElement::exitFullscreen() > { >+#if ENABLE(FULLSCREEN_API) >+ ASSERT(isFullscreen()); >+ if (document()) >+ document()->webkitCancelFullScreen(); >+#else > ASSERT(m_isFullscreen); > m_isFullscreen = false; > if (document() && document()->page()) { >- document()->page()->chrome()->client()->exitFullscreenForNode(this); >+ document()->page()->chrome()->client()->exitFullscreenForElement(this); > scheduleEvent(eventNames().webkitendfullscreenEvent); > } >+#endif > } > > PlatformMedia HTMLMediaElement::platformMedia() const >Index: WebCore/html/HTMLMediaElement.h >=================================================================== >--- WebCore/html/HTMLMediaElement.h (revision 64653) >+++ WebCore/html/HTMLMediaElement.h (working copy) >@@ -157,7 +157,7 @@ public: > > bool hasSingleSecurityOrigin() const { return !m_player || m_player->hasSingleSecurityOrigin(); } > >- bool isFullscreen() const { return m_isFullscreen; } >+ bool isFullscreen() const; > void enterFullscreen(); > void exitFullscreen(); > >Index: WebCore/html/HTMLVideoElement.cpp >=================================================================== >--- WebCore/html/HTMLVideoElement.cpp (revision 64653) >+++ WebCore/html/HTMLVideoElement.cpp (working copy) >@@ -40,6 +40,7 @@ > #include "Page.h" > #include "RenderImage.h" > #include "RenderVideo.h" >+#include "Settings.h" > > namespace WebCore { > >@@ -126,11 +127,16 @@ bool HTMLVideoElement::supportsFullscree > if (!page) > return false; > >+#if ENABLE(FULLSCREEN_API) >+ if (!page->settings()->fullScreenEnabled()) >+ return false; >+#endif >+ > if (!player() || !player()->supportsFullscreen() || !player()->hasVideo()) > return false; > > // Check with the platform client. >- return page->chrome()->client()->supportsFullscreenForNode(this); >+ return page->chrome()->client()->supportsFullscreenForElement(this); > } > > unsigned HTMLVideoElement::videoWidth() const >Index: WebCore/rendering/MediaControlElements.cpp >=================================================================== >--- WebCore/rendering/MediaControlElements.cpp (revision 64653) >+++ WebCore/rendering/MediaControlElements.cpp (working copy) >@@ -776,7 +776,10 @@ PassRefPtr<MediaControlFullscreenButtonE > void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event) > { > if (event->type() == eventNames().clickEvent) { >- mediaElement()->enterFullscreen(); >+ if (mediaElement()->isFullscreen()) >+ mediaElement()->exitFullscreen(); >+ else >+ mediaElement()->enterFullscreen(); > event->setDefaultHandled(); > } > HTMLInputElement::defaultEventHandler(event);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
simon.fraser
:
review-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 43099
:
62784
|
62785
|
62786
|
62787
|
62793
|
62797
|
62799
|
62833
|
62835
|
62874
|
62954
|
62968
|
63360
|
63361
|
63397
|
63476
|
63477
|
63623
|
63624
|
63626
|
63627
|
63628
|
63936
|
63937
|
63938
|
63939
|
63941
|
63943
|
63949
|
63955
|
64545
|
64997
|
65593