Title: [171184] trunk
Revision
171184
Author
jer.no...@apple.com
Date
2014-07-17 09:27:32 -0700 (Thu, 17 Jul 2014)

Log Message

Enable legacy fullscreen API in media controls
https://bugs.webkit.org/show_bug.cgi?id=134985

Reviewed by Eric Carlson.

Source/WebCore:
Allow clients who have not enabled HTML5 Fullscreen APIs to still use fullscreen mode
with <video> elements by using the legacy, video-element-specific fullscreen APIs in
the <video> media controls.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller):
(Controller.prototype.handleReadyStateChange):
(Controller.prototype.isFullScreen):
(Controller.prototype.handlePlayButtonClicked):
(Controller.prototype.updateFullscreenButton):
(Controller.prototype.handleFullscreenButtonClicked):

LayoutTests:
Rebaseline expected results.

* platform/mac/fast/hidpi/video-controls-in-hidpi-expected.txt:
* platform/mac/fast/layers/video-layer-expected.txt:
* platform/mac/media/media-controls-clone-expected.txt:
* platform/mac/webarchive/loading/video-in-webarchive-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (171183 => 171184)


--- trunk/LayoutTests/ChangeLog	2014-07-17 15:58:13 UTC (rev 171183)
+++ trunk/LayoutTests/ChangeLog	2014-07-17 16:27:32 UTC (rev 171184)
@@ -1,3 +1,17 @@
+2014-07-17  Jer Noble  <jer.no...@apple.com>
+
+        Enable legacy fullscreen API in media controls
+        https://bugs.webkit.org/show_bug.cgi?id=134985
+
+        Reviewed by Eric Carlson.
+
+        Rebaseline expected results.
+
+        * platform/mac/fast/hidpi/video-controls-in-hidpi-expected.txt:
+        * platform/mac/fast/layers/video-layer-expected.txt:
+        * platform/mac/media/media-controls-clone-expected.txt:
+        * platform/mac/webarchive/loading/video-in-webarchive-expected.txt:
+
 2014-07-17  Manuel Rego Casasnovas  <r...@igalia.com>
 
         [CSS Grid Layout] Add element.style coverage for grid-auto-flow

Modified: trunk/LayoutTests/platform/mac/fast/hidpi/video-controls-in-hidpi-expected.txt (171183 => 171184)


--- trunk/LayoutTests/platform/mac/fast/hidpi/video-controls-in-hidpi-expected.txt	2014-07-17 15:58:13 UTC (rev 171183)
+++ trunk/LayoutTests/platform/mac/fast/hidpi/video-controls-in-hidpi-expected.txt	2014-07-17 16:27:32 UTC (rev 171184)
@@ -18,9 +18,7 @@
   RenderButton {BUTTON} at (6,4) size 16x17 [color=#FFFFFF]
 layer at (40,156) size 16x16
   RenderButton {BUTTON} at (32,5) size 16x16 [color=#FFFFFF]
-layer at (180,160) size 98x9
-  RenderFlexibleBox {DIV} at (171,8) size 99x10
-layer at (182,160) size 95x9
-  RenderFlexibleBox {DIV} at (2,0) size 95x9
-layer at (285,156) size 16x16
-  RenderButton {BUTTON} at (277,5) size 16x16 [color=#FFFFFF]
+layer at (195,160) size 113x9
+  RenderFlexibleBox {DIV} at (186,8) size 114x10
+layer at (197,160) size 110x9
+  RenderFlexibleBox {DIV} at (2,0) size 110x9

Modified: trunk/LayoutTests/platform/mac/fast/layers/video-layer-expected.txt (171183 => 171184)


--- trunk/LayoutTests/platform/mac/fast/layers/video-layer-expected.txt	2014-07-17 15:58:13 UTC (rev 171183)
+++ trunk/LayoutTests/platform/mac/fast/layers/video-layer-expected.txt	2014-07-17 16:27:32 UTC (rev 171184)
@@ -23,9 +23,7 @@
   RenderButton {BUTTON} at (6,4) size 16x17 [color=#FFFFFF]
 layer at (91,241) size 16x16
   RenderButton {BUTTON} at (32,5) size 16x16 [color=#FFFFFF]
-layer at (231,245) size 98x9
-  RenderFlexibleBox {DIV} at (171,8) size 99x10
-layer at (233,245) size 95x9
-  RenderFlexibleBox {DIV} at (2,0) size 95x9
-layer at (336,241) size 16x16
-  RenderButton {BUTTON} at (277,5) size 16x16 [color=#FFFFFF]
+layer at (246,245) size 113x9
+  RenderFlexibleBox {DIV} at (186,8) size 114x10
+layer at (248,245) size 110x9
+  RenderFlexibleBox {DIV} at (2,0) size 110x9

Modified: trunk/LayoutTests/platform/mac/media/media-controls-clone-expected.txt (171183 => 171184)


--- trunk/LayoutTests/platform/mac/media/media-controls-clone-expected.txt	2014-07-17 15:58:13 UTC (rev 171183)
+++ trunk/LayoutTests/platform/mac/media/media-controls-clone-expected.txt	2014-07-17 16:27:32 UTC (rev 171184)
@@ -19,12 +19,10 @@
   RenderButton {BUTTON} at (6,4) size 16x17 [color=#FFFFFF]
 layer at (40,138) size 16x16
   RenderButton {BUTTON} at (32,5) size 16x16 [color=#FFFFFF]
-layer at (180,142) size 98x9
-  RenderFlexibleBox {DIV} at (171,8) size 99x10
-layer at (182,142) size 95x9
-  RenderFlexibleBox {DIV} at (2,0) size 95x9
-layer at (285,138) size 16x16
-  RenderButton {BUTTON} at (277,5) size 16x16 [color=#FFFFFF]
+layer at (195,142) size 113x9
+  RenderFlexibleBox {DIV} at (186,8) size 114x10
+layer at (197,142) size 110x9
+  RenderFlexibleBox {DIV} at (2,0) size 110x9
 layer at (308,133) size 200x25
   RenderFlexibleBox {DIV} at (0,0) size 200x25
 layer at (308,133) size 200x25
@@ -45,12 +43,10 @@
   RenderButton {BUTTON} at (6,4) size 16x17 [color=#FFFFFF]
 layer at (40,292) size 16x16
   RenderButton {BUTTON} at (32,5) size 16x16 [color=#FFFFFF]
-layer at (180,296) size 98x9
-  RenderFlexibleBox {DIV} at (171,8) size 99x10
-layer at (182,296) size 95x9
-  RenderFlexibleBox {DIV} at (2,0) size 95x9
-layer at (285,292) size 16x16
-  RenderButton {BUTTON} at (277,5) size 16x16 [color=#FFFFFF]
+layer at (195,296) size 113x9
+  RenderFlexibleBox {DIV} at (186,8) size 114x10
+layer at (197,296) size 110x9
+  RenderFlexibleBox {DIV} at (2,0) size 110x9
 layer at (308,287) size 200x25
   RenderFlexibleBox {DIV} at (0,0) size 200x25
 layer at (308,287) size 200x25

Modified: trunk/LayoutTests/platform/mac/webarchive/loading/video-in-webarchive-expected.txt (171183 => 171184)


--- trunk/LayoutTests/platform/mac/webarchive/loading/video-in-webarchive-expected.txt	2014-07-17 15:58:13 UTC (rev 171183)
+++ trunk/LayoutTests/platform/mac/webarchive/loading/video-in-webarchive-expected.txt	2014-07-17 16:27:32 UTC (rev 171184)
@@ -11,6 +11,6 @@
 frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
 frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
 frame "<!--framePath //<!--frame0-->-->" - didFailLoadWithError
-main frame "webkitfullscreenchange" - didFinishLoadForFrame
+main frame "webkitendfullscreen" - didFinishLoadForFrame
 frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
 

Modified: trunk/Source/WebCore/ChangeLog (171183 => 171184)


--- trunk/Source/WebCore/ChangeLog	2014-07-17 15:58:13 UTC (rev 171183)
+++ trunk/Source/WebCore/ChangeLog	2014-07-17 16:27:32 UTC (rev 171184)
@@ -1,3 +1,22 @@
+2014-07-17  Jer Noble  <jer.no...@apple.com>
+
+        Enable legacy fullscreen API in media controls
+        https://bugs.webkit.org/show_bug.cgi?id=134985
+
+        Reviewed by Eric Carlson.
+
+        Allow clients who have not enabled HTML5 Fullscreen APIs to still use fullscreen mode
+        with <video> elements by using the legacy, video-element-specific fullscreen APIs in
+        the <video> media controls.
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller):
+        (Controller.prototype.handleReadyStateChange):
+        (Controller.prototype.isFullScreen):
+        (Controller.prototype.handlePlayButtonClicked):
+        (Controller.prototype.updateFullscreenButton):
+        (Controller.prototype.handleFullscreenButtonClicked):
+
 2014-07-17  Vineet Chaudhary  <code.vin...@gmail.com>
 
         [GObject] StrictTypeChecking extended attribute fails for methods with sequence<T>.

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (171183 => 171184)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2014-07-17 15:58:13 UTC (rev 171183)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2014-07-17 16:27:32 UTC (rev 171184)
@@ -26,6 +26,7 @@
     this.updateThumbnail();
     this.updateCaptionButton();
     this.updateCaptionContainer();
+    this.updateFullscreenButton();
     this.updateVolume();
     this.updateHasAudio();
     this.updateHasVideo();
@@ -63,6 +64,8 @@
         progress: 'handleProgress',
         volumechange: 'handleVolumeChange',
         webkitfullscreenchange: 'handleFullscreenChange',
+        webkitbeginfullscreen: 'handleFullscreenChange',
+        webkitendfullscreen: 'handleFullscreenChange',
     },
     HideControlsDelay: 4 * 1000,
     RewindAmount: 30,
@@ -552,6 +555,7 @@
         this.updateDuration();
         this.updateCaptionButton();
         this.updateCaptionContainer();
+        this.updateFullscreenButton();
         this.updateProgress();
     },
 
@@ -614,7 +618,7 @@
 
     isFullScreen: function()
     {
-        return document.webkitCurrentFullScreenElement === this.video;
+        return this.video.webkitDisplayingFullscreen;
     },
 
     handleFullscreenChange: function(event)
@@ -827,12 +831,17 @@
         return true;
     },
 
+    updateFullscreenButton: function()
+    {
+        this.controls.fullscreenButton.classList.toggle(this.ClassNames.hidden, !this.video.webkitSupportsFullscreen);
+    },
+
     handleFullscreenButtonClicked: function(event)
     {
         if (this.isFullScreen())
-            document.webkitExitFullscreen();
+            this.video.webkitExitFullscreen();
         else
-            this.video.webkitRequestFullscreen();
+            this.video.webkitEnterFullscreen();
         return true;
     },
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to