[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric.carlson at apple.com eric.carlson at apple.com
Wed Apr 7 23:34:42 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 8cb301d6ed8d749e602116be171aa9c4b03c98b5
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 12 20:23:15 2009 +0000

    2009-11-12  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Dan Bernstein.
    
            <rdar://problem/7388969> Add DOM API for fullscreen video
    
            DOM API for fullscreen <video>.
    
            Tests: media/media-fullscreen-inline.html
                   media/media-fullscreen-not-in-document.html
    
            * dom/EventNames.h:
                Add webkitbeginfullscreen and webkitendfullscreen.
    
            * html/HTMLAttributeNames.in:
                Add onwebkitbeginfullscreen and onwebkitendfullscreen.
    
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::parseMappedAttribute):
                Deal with onwebkitbeginfullscreen and onwebkitendfullscreen.
            (WebCore::HTMLMediaElement::enterFullscreen):
                Schedule webkitbeginfullscreenEvent event, don't set m_isFullscreen unless we
                actually do enter fullscreen.
            (WebCore::HTMLMediaElement::exitFullscreen):
                Schedule webkitendfullscreenEvent event.
            (WebCore::HTMLMediaElement::webkitEnterFullScreen):
            (WebCore::HTMLMediaElement::webkitExitFullScreen):
            (WebCore::HTMLMediaElement::webkitSupportsFullscreen):
            (WebCore::HTMLMediaElement::webkitDisplayingFullscreen):
                New, access to fullscreen properties and methods.
    
            * html/HTMLMediaElement.h:
            * html/HTMLMediaElement.idl:
                Declare methods needed for fullscreen API.
    
            * html/HTMLVideoElement.cpp:
            (WebCore::HTMLVideoElement::supportsFullscreen):
                Return false if a movie does not have video.
    
            * page/DOMWindow.h:
                Add webkitbeginfullscreen and webkitendfullscreen.
    
    2009-11-12  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Dan Bernstein.
    
            <rdar://problem/7388969> Add DOM API for fullscreen video
    
            Tests for fullscreen <video> DOM API.
    
            * media/media-fullscreen-inline-expected.txt: Added.
            * media/media-fullscreen-inline.html: Added.
            * media/media-fullscreen-not-in-document-expected.txt: Added.
            * media/media-fullscreen-not-in-document.html: Added.
            * media/media-fullscreen.js: Added.
    
            * platform/gtk/Skipped:
            * platform/mac-tiger/Skipped:
            * platform/win/Skipped:
                Skipped on platforms that don't support fullscreen yet.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50893 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 0116919..c24fff5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,23 @@
+2009-11-12  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        <rdar://problem/7388969> Add DOM API for fullscreen video
+        
+        Tests for fullscreen <video> DOM API.
+
+        * media/media-fullscreen-inline-expected.txt: Added.
+        * media/media-fullscreen-inline.html: Added.
+        * media/media-fullscreen-not-in-document-expected.txt: Added.
+        * media/media-fullscreen-not-in-document.html: Added.
+        * media/media-fullscreen.js: Added.
+
+        * platform/gtk/Skipped:
+        * platform/mac-leopard/Skipped:
+        * platform/mac-tiger/Skipped:
+        * platform/win/Skipped:
+            Skipped on platforms that don't support fullscreen yet.
+
 2009-11-12  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by David Levin.
diff --git a/LayoutTests/media/media-fullscreen-inline-expected.txt b/LayoutTests/media/media-fullscreen-inline-expected.txt
new file mode 100644
index 0000000..7d0f5dc
--- /dev/null
+++ b/LayoutTests/media/media-fullscreen-inline-expected.txt
@@ -0,0 +1,50 @@
+Test media element fullscreen API when an element is in the DOM.
+
+
+
+
+*** Creating <audio> element with "content/test.mp4" in the document, should NOT support fullscreen even though it has video
+EVENT(loadstart)
+EVENT(durationchange)
+EVENT(canplaythrough)
+* event handler NOT triggered by a user gesture
+EXPECTED (mediaElement.webkitSupportsFullscreen == 'false') OK
+EXPECTED (mediaElement.webkitDisplayingFullscreen == 'false') OK
+TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
+* clicking on button
+EVENT(mouseup)
+* event handler triggered by user gesture
+TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
+
+*** Creating <video> element with "content/silence.mpg" in the document, should NOT support fullscreen because it is an audio-only <video> element
+EVENT(loadstart)
+EVENT(durationchange)
+EVENT(canplaythrough)
+* event handler NOT triggered by a user gesture
+EXPECTED (mediaElement.webkitSupportsFullscreen == 'false') OK
+EXPECTED (mediaElement.webkitDisplayingFullscreen == 'false') OK
+TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
+* clicking on button
+EVENT(mouseup)
+* event handler triggered by user gesture
+TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
+
+*** Creating <video> element with "content/test.mp4" in the document, should support fullscreen because it is a <video> element with video media
+EVENT(loadstart)
+EVENT(durationchange)
+EVENT(canplaythrough)
+* event handler NOT triggered by a user gesture
+EXPECTED (mediaElement.webkitSupportsFullscreen == 'true') OK
+EXPECTED (mediaElement.webkitDisplayingFullscreen == 'false') OK
+TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
+* clicking on button
+EVENT(mouseup)
+* event handler triggered by user gesture
+RUN(mediaElement.webkitEnterFullScreen())
+EVENT(webkitbeginfullscreen)
+EXPECTED (mediaElement.webkitDisplayingFullscreen == 'true') OK
+RUN(mediaElement.webkitExitFullScreen())
+EVENT(webkitendfullscreen)
+
+END OF TEST
+
diff --git a/LayoutTests/media/media-fullscreen-inline.html b/LayoutTests/media/media-fullscreen-inline.html
new file mode 100644
index 0000000..571ec81
--- /dev/null
+++ b/LayoutTests/media/media-fullscreen-inline.html
@@ -0,0 +1,52 @@
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+        <title>inline &lt;video&gt; element fullscreen test</title>
+
+        <script src=video-test.js></script>
+        <script src=media-fullscreen.js></script>
+
+        <script>
+            var movieInfo = 
+            {
+                current : -1,
+                movies : 
+                [ 
+                    {
+                        url : "content/test.mp4", 
+                        description : "even though it has video", 
+                        supportsFS : false,
+                        inline : true,
+                        type : 'audio',
+                    },
+                    {
+                        url : "content/silence.mpg", 
+                        description : "because it is an audio-only &lt;video&gt element", 
+                        supportsFS : false,
+                        inline : true,
+                        type : 'video',
+                    },
+                    {
+                        url : "content/test.mp4", 
+                        description : "because it is a &lt;video&gt element with video media", 
+                        supportsFS : true,
+                        inline : true,
+                        type : 'video',
+                    },
+                ]
+            };
+        </script>
+
+    </head>
+
+    <body onload="openNextMovie()">
+
+        <p>Test media element fullscreen API when an element is in the DOM.</p>
+
+        <div id='parent'>
+        </div>
+        <br>
+        <input type="button" id="button" value="Enter Fullscreen" onmouseup="buttonClickHandler()"> 
+
+    </body>
+</html>
diff --git a/LayoutTests/media/media-fullscreen-not-in-document-expected.txt b/LayoutTests/media/media-fullscreen-not-in-document-expected.txt
new file mode 100644
index 0000000..f83ebdd
--- /dev/null
+++ b/LayoutTests/media/media-fullscreen-not-in-document-expected.txt
@@ -0,0 +1,37 @@
+Test media element fullscreen API when an element is not in the DOM.
+
+
+
+
+*** Creating <video> element with "content/counting.mp4" not in the document, should support fullscreen because it has video
+EVENT(loadstart)
+EVENT(durationchange)
+EVENT(canplaythrough)
+* event handler NOT triggered by a user gesture
+EXPECTED (mediaElement.webkitSupportsFullscreen == 'true') OK
+EXPECTED (mediaElement.webkitDisplayingFullscreen == 'false') OK
+TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
+* clicking on button
+EVENT(mouseup)
+* event handler triggered by user gesture
+RUN(mediaElement.webkitEnterFullScreen())
+EVENT(webkitbeginfullscreen)
+EXPECTED (mediaElement.webkitDisplayingFullscreen == 'true') OK
+RUN(mediaElement.webkitExitFullScreen())
+EVENT(webkitendfullscreen)
+
+*** Creating <audio> element with "content/silence.mpg" not in the document, should NOT support fullscreen 
+EVENT(loadstart)
+EVENT(durationchange)
+EVENT(canplaythrough)
+* event handler NOT triggered by a user gesture
+EXPECTED (mediaElement.webkitSupportsFullscreen == 'false') OK
+EXPECTED (mediaElement.webkitDisplayingFullscreen == 'false') OK
+TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
+* clicking on button
+EVENT(mouseup)
+* event handler triggered by user gesture
+TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
+
+END OF TEST
+
diff --git a/LayoutTests/media/media-fullscreen-not-in-document.html b/LayoutTests/media/media-fullscreen-not-in-document.html
new file mode 100644
index 0000000..dbb5bee
--- /dev/null
+++ b/LayoutTests/media/media-fullscreen-not-in-document.html
@@ -0,0 +1,43 @@
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+        <title>not in document &lt;video&gt; element fullscreen test</title>
+
+        <script src=video-test.js></script>
+        <script src=media-fullscreen.js></script>
+        <script>
+            var movieInfo = 
+            {
+                current : -1,
+                movies : 
+                [ 
+                    {
+                        url : "content/counting.mp4", 
+                        description : "because it has video", 
+                        supportsFS : true,
+                        inline : false,
+                        type : 'video',
+                    },
+                    {
+                        url : "content/silence.mpg", 
+                        description : "", 
+                        supportsFS : false,
+                        inline : false,
+                        type : 'audio',
+                    },
+                ]
+            };
+        </script>
+    </head>
+
+    <body onload="openNextMovie()">
+
+        <p>Test media element fullscreen API when an element is not in the DOM.</p>
+
+        <div id='parent'>
+        </div>
+        <br>
+        <input type="button" id="button" value="Enter Fullscreen" onmouseup="buttonClickHandler()"> 
+
+    </body>
+</html>
diff --git a/LayoutTests/media/media-fullscreen.js b/LayoutTests/media/media-fullscreen.js
new file mode 100644
index 0000000..fde255c
--- /dev/null
+++ b/LayoutTests/media/media-fullscreen.js
@@ -0,0 +1,109 @@
+
+function buttonClickHandler()
+{
+    consoleWrite("EVENT(mouseup)");
+    
+    consoleWrite("* event handler triggered by user gesture");
+
+    // Try to enter fullscreen in response to a mouse click
+
+    if (movieInfo.movies[movieInfo.current].supportsFS)
+        run("mediaElement.webkitEnterFullScreen()");
+    else {
+        testException("mediaElement.webkitEnterFullScreen()", "DOMException.INVALID_STATE_ERR");
+        openNextMovie();
+    }
+}
+
+function clickEnterFullscreenButton()
+{
+    consoleWrite("* clicking on button");
+    var button = document.getElementById('button');
+    eventSender.mouseMoveTo(button.offsetLeft + 20, button.offsetTop + 7);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+}
+
+function beginfullscreen()
+{
+    testExpected("mediaElement.webkitDisplayingFullscreen", true);
+    run("mediaElement.webkitExitFullScreen()");
+}
+
+function endfullscreen()
+{
+    setTimeout(openNextMovie, 10);
+}
+
+function canplaythrough()
+{
+    var movie = movieInfo.movies[movieInfo.current];
+
+    consoleWrite("* event handler NOT triggered by a user gesture");
+
+    testExpected("mediaElement.webkitSupportsFullscreen", movie.supportsFS);
+    testExpected("mediaElement.webkitDisplayingFullscreen", false);
+    
+    // Verify that we get an exception when trying to enter fullscreen since this isn't
+    // called in response to a user gesture.
+    testException("mediaElement.webkitEnterFullScreen()", "DOMException.INVALID_STATE_ERR");
+
+    // Click on the button
+    if (window.layoutTestController)
+        setTimeout(clickEnterFullscreenButton, 10);
+    else
+        openNextMovie();
+}
+
+function openNextMovie()
+{
+    consoleWrite("");
+
+    movieInfo.current++;
+    if (movieInfo.current >= movieInfo.movies.length) {
+        endTest();
+        return;
+    }
+
+    var movie = movieInfo.movies[movieInfo.current];
+    var url = movie.url;
+    var container = document.getElementById('parent');
+
+    // Remove the current media element, if any
+    if (container.firstChild)
+        container.removeChild(container.firstChild);
+
+    var desc = "*** Creating &lt;" + movie.type  + "&gt; element with <em>\"" + url + "\"</em> "
+                + (!movie.inline ? "not " : "") + "in the document, should " 
+                + (!movie.supportsFS ? "<b>NOT</b> " : "") + "support fullscreen " + movie.description;
+    consoleWrite(desc);
+
+    // Create a new element, maybe insert it into the DOM
+    mediaElement = document.createElement(movie.type);
+    if (movie.inline)
+        mediaElement = container.appendChild(mediaElement);
+    addEventListeners();
+    mediaElement.setAttribute('controls', 'controls'); 
+    mediaElement.setAttribute('src', url); 
+
+    if (!movie.inline)
+        mediaElement.load();
+}
+
+function addEventListeners(elem)
+{
+    waitForEvent("error");
+    waitForEvent("loadstart");
+    waitForEvent("waiting");
+    waitForEvent("ratechange");
+    waitForEvent("durationchange");
+    waitForEvent("pause");
+    waitForEvent("play");
+    waitForEvent("playing");
+
+    waitForEvent('canplaythrough', canplaythrough);
+
+    waitForEvent('webkitbeginfullscreen', beginfullscreen);
+    waitForEvent('webkitendfullscreen', endfullscreen);
+}
+
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index cf0e51d..2916b26 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -3602,6 +3602,9 @@ media/video-zoom-controls.html
 media/video-zoom.html
 # This test requires media controls has a volume slider.
 media/video-volume-slider.html
+# Tests requiring fullscreen <video> support
+media-fullscreen-inline.html
+media-fullscreen-not-in-document.html
 
 # Tests in plugins/ directory
 #   These tests require ObjC plugin, do not bother trying to get them to work
diff --git a/LayoutTests/platform/mac-leopard/Skipped b/LayoutTests/platform/mac-leopard/Skipped
index ae2da71..509b436 100644
--- a/LayoutTests/platform/mac-leopard/Skipped
+++ b/LayoutTests/platform/mac-leopard/Skipped
@@ -18,3 +18,7 @@ platform/mac/fast/text/thai-combining-mark-positioning.html
 # Hardware compositing is disabled for Leopard until <rdar://problem/7189153> can be fixed.
 # https://bugs.webkit.org/show_bug.cgi?id=28624
 transforms/3d
+
+# These tests requires fullscreen <video> support
+media-fullscreen-inline.html
+media-fullscreen-not-in-document.html
diff --git a/LayoutTests/platform/mac-tiger/Skipped b/LayoutTests/platform/mac-tiger/Skipped
index 1bd43cd..ef358ee 100644
--- a/LayoutTests/platform/mac-tiger/Skipped
+++ b/LayoutTests/platform/mac-tiger/Skipped
@@ -60,3 +60,7 @@ http/tests/loading/basic-auth-resend-wrong-credentials.html
 
 # See <rdar://problem/5081884> and https://bugs.webkit.org/show_bug.cgi?id=29329
 http/tests/loading/redirect-with-no-location-crash.html
+
+# We don't support fullscreen <video> on Tiger
+media-fullscreen-inline.html
+media-fullscreen-not-in-document.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 3cf5188..72a6d58 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -51,6 +51,10 @@ media/video-error-abort.html
 # This test requires media controls has a volume slider.
 media/video-volume-slider.html
 
+# These tests requires fullscreen <video> support
+media-fullscreen-inline.html
+media-fullscreen-not-in-document.html
+
 # <rdar://problem/5075790> Layout tests that depend on certain fonts don't match Mac results:
 #                          - Mac OS X and Windows do not have an Arabic font in common
 fast/text/international/bidi-AN-after-L.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fd317dd..95a038d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,45 @@
+2009-11-12  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        <rdar://problem/7388969> Add DOM API for fullscreen video
+        
+        DOM API for fullscreen <video>.
+
+        Tests: media/media-fullscreen-inline.html
+               media/media-fullscreen-not-in-document.html
+
+        * dom/EventNames.h:
+            Add webkitbeginfullscreen and webkitendfullscreen.
+
+        * html/HTMLAttributeNames.in:
+            Add onwebkitbeginfullscreen and onwebkitendfullscreen.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::parseMappedAttribute):
+            Deal with onwebkitbeginfullscreen and onwebkitendfullscreen.
+        (WebCore::HTMLMediaElement::enterFullscreen):
+            Schedule webkitbeginfullscreenEvent event, don't set m_isFullscreen unless we
+            actually do enter fullscreen.
+        (WebCore::HTMLMediaElement::exitFullscreen):
+            Schedule webkitendfullscreenEvent event.
+        (WebCore::HTMLMediaElement::webkitEnterFullScreen):
+        (WebCore::HTMLMediaElement::webkitExitFullScreen):
+        (WebCore::HTMLMediaElement::webkitSupportsFullscreen):
+        (WebCore::HTMLMediaElement::webkitDisplayingFullscreen):
+            New, access to fullscreen properties and methods.
+
+        * html/HTMLMediaElement.h:
+        * html/HTMLMediaElement.idl:
+            Declare methods needed for fullscreen API.
+
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::supportsFullscreen):
+            Return false if a movie does not have video.
+
+        * page/DOMWindow.h:
+            Add webkitbeginfullscreen and webkitendfullscreen.
+
 2009-11-12  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebCore/dom/EventNames.h b/WebCore/dom/EventNames.h
index 270d515..8111336 100644
--- a/WebCore/dom/EventNames.h
+++ b/WebCore/dom/EventNames.h
@@ -127,6 +127,9 @@ namespace WebCore {
     macro(volumechange) \
     macro(waiting) \
     \
+    macro(webkitbeginfullscreen) \
+    macro(webkitendfullscreen) \
+    \
     macro(progress) \
     macro(stalled) \
     macro(suspend) \
diff --git a/WebCore/html/HTMLAttributeNames.in b/WebCore/html/HTMLAttributeNames.in
index df39eb9..7fef3c2 100644
--- a/WebCore/html/HTMLAttributeNames.in
+++ b/WebCore/html/HTMLAttributeNames.in
@@ -199,6 +199,8 @@ onwaiting
 onwebkitanimationstart
 onwebkitanimationiteration
 onwebkitanimationend
+onwebkitbeginfullscreen
+onwebkitendfullscreen
 onwebkittransitionend
 pattern
 placeholder
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 86785a1..9cad25d 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -213,6 +213,10 @@ void HTMLMediaElement::parseMappedAttribute(MappedAttribute* attr)
         setAttributeEventListener(eventNames().volumechangeEvent, createAttributeEventListener(this, attr));
     else if (attrName == onwaitingAttr)
         setAttributeEventListener(eventNames().waitingEvent, createAttributeEventListener(this, attr));
+    else if (attrName == onwebkitbeginfullscreenAttr)
+        setAttributeEventListener(eventNames().webkitbeginfullscreenEvent, createAttributeEventListener(this, attr));
+    else if (attrName == onwebkitendfullscreenAttr)
+        setAttributeEventListener(eventNames().webkitendfullscreenEvent, createAttributeEventListener(this, attr));
     else
         HTMLElement::parseMappedAttribute(attr);
 }
@@ -1795,25 +1799,59 @@ void HTMLMediaElement::finishParsingChildren()
 void HTMLMediaElement::enterFullscreen()
 {
     ASSERT(!m_isFullscreen);
-    if (!renderer())
-        return;
-    if (document() && document()->page())
+    if (document() && document()->page()) {
         document()->page()->chrome()->client()->enterFullscreenForNode(this);
-    m_isFullscreen = true;
+        scheduleEvent(eventNames().webkitbeginfullscreenEvent);
+        m_isFullscreen = true;
+    }
 }
 
 void HTMLMediaElement::exitFullscreen()
 {
     ASSERT(m_isFullscreen);
-    if (document() && document()->page())
+    if (document() && document()->page()) {
         document()->page()->chrome()->client()->exitFullscreenForNode(this);
+        scheduleEvent(eventNames().webkitendfullscreenEvent);
+    }
     m_isFullscreen = false;
 }
 
 PlatformMedia HTMLMediaElement::platformMedia() const
 {
     return m_player ? m_player->platformMedia() : NoPlatformMedia;
-}        
+}
+
+void HTMLMediaElement::webkitEnterFullScreen(ExceptionCode& ec)
+{
+    if (m_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 (!processingUserGesture() || !supportsFullscreen()) {
+        ec = INVALID_STATE_ERR;
+        return;
+    }
+
+    enterFullscreen();
+}
+
+void HTMLMediaElement::webkitExitFullScreen()
+{
+    if (m_isFullscreen)
+        exitFullscreen();
+}
+
+bool HTMLMediaElement::webkitSupportsFullscreen()
+{
+    return supportsFullscreen();
+}
+
+bool HTMLMediaElement::webkitDisplayingFullscreen()
+{
+    return m_isFullscreen;
+}
+
 }
 
 #endif
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index 405f013..fb6b8ce 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -131,6 +131,12 @@ public:
     void setLoop(bool b);
     void play();
     void pause();
+
+// fullscreen
+    void webkitEnterFullScreen(ExceptionCode&);
+    void webkitExitFullScreen();
+    bool webkitSupportsFullscreen();
+    bool webkitDisplayingFullscreen();
     
 // controls
     bool controls() const;
diff --git a/WebCore/html/HTMLMediaElement.idl b/WebCore/html/HTMLMediaElement.idl
index 7278fa6..20d3a2e 100644
--- a/WebCore/html/HTMLMediaElement.idl
+++ b/WebCore/html/HTMLMediaElement.idl
@@ -77,7 +77,14 @@ interface [GenerateConstructor, Conditional=VIDEO] HTMLMediaElement : HTMLElemen
         setter raises (DOMException);
     attribute boolean muted;
     
-    // WebKit extension
+    // WebKit extensions
     attribute boolean webkitPreservesPitch;
+
+    readonly attribute boolean webkitSupportsFullscreen;
+    readonly attribute boolean webkitDisplayingFullscreen;
+
+    void webkitEnterFullScreen()
+        raises (DOMException);
+    void webkitExitFullScreen();
 };
 }
diff --git a/WebCore/html/HTMLVideoElement.cpp b/WebCore/html/HTMLVideoElement.cpp
index c4f4d93..d0b1042 100644
--- a/WebCore/html/HTMLVideoElement.cpp
+++ b/WebCore/html/HTMLVideoElement.cpp
@@ -120,9 +120,10 @@ bool HTMLVideoElement::supportsFullscreen() const
     if (!page) 
         return false;
 
-    if (!m_player || !m_player->supportsFullscreen())
+    if (!m_player || !m_player->supportsFullscreen() || !m_player->hasVideo())
         return false;
-    
+
+    // Check with the platform client.
     return page->chrome()->client()->supportsFullscreenForNode(this);
 }
 
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index 8960843..fefb7b9 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -302,6 +302,8 @@ namespace WebCore {
         DEFINE_ATTRIBUTE_EVENT_LISTENER(volumechange);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(waiting);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(loadstart);
+        DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitbeginfullscreen);
+        DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitendfullscreen);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(progress);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(stalled);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(suspend);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list