Title: [228519] trunk/Source/WebCore
Revision
228519
Author
[email protected]
Date
2018-02-15 10:03:55 -0800 (Thu, 15 Feb 2018)

Log Message

[Modern Media Controls] REGRESSION: Inline media controls are not disabled while in fullscreen on iOS
https://bugs.webkit.org/show_bug.cgi?id=182830
<rdar://problem/37537909>

Patch by Antoine Quint <[email protected]> on 2018-02-15
Reviewed by Eric Carlson.

The test media/modern-media-controls/media-controller/ios/media-controller-stop-updates-in-fullscreen.html
regressed when fixing webkit.org/b/182668 since we now started only caring about the presence of the "controls"
attribute to identify that WebKit media controls should be available.

We now have a dedicated _shouldControlsBeAvailable() method which more clearly establishes the conditions under
which controls should be available and correctly disables them while in fullscreen on iOS, regardless of the
"controls" attribute value.

* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._shouldControlsBeAvailable):
(MediaController.prototype._updateControlsAvailability):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228518 => 228519)


--- trunk/Source/WebCore/ChangeLog	2018-02-15 17:30:21 UTC (rev 228518)
+++ trunk/Source/WebCore/ChangeLog	2018-02-15 18:03:55 UTC (rev 228519)
@@ -1,3 +1,23 @@
+2018-02-15  Antoine Quint  <[email protected]>
+
+        [Modern Media Controls] REGRESSION: Inline media controls are not disabled while in fullscreen on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=182830
+        <rdar://problem/37537909>
+
+        Reviewed by Eric Carlson.
+
+        The test media/modern-media-controls/media-controller/ios/media-controller-stop-updates-in-fullscreen.html
+        regressed when fixing webkit.org/b/182668 since we now started only caring about the presence of the "controls"
+        attribute to identify that WebKit media controls should be available.
+
+        We now have a dedicated _shouldControlsBeAvailable() method which more clearly establishes the conditions under
+        which controls should be available and correctly disables them while in fullscreen on iOS, regardless of the
+        "controls" attribute value.
+
+        * Modules/modern-media-controls/media/media-controller.js:
+        (MediaController.prototype._shouldControlsBeAvailable):
+        (MediaController.prototype._updateControlsAvailability):
+
 2018-02-15  Matt Lewis  <[email protected]>
 
         Unreviewed, rolling out r228495.

Modified: trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js (228518 => 228519)


--- trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js	2018-02-15 17:30:21 UTC (rev 228518)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js	2018-02-15 18:03:55 UTC (rev 228519)
@@ -305,10 +305,20 @@
         this._supportingObjects.forEach(supportingObject => supportingObject.controlsUserVisibilityDidChange());
     }
 
+    _shouldControlsBeAvailable()
+    {
+        // Controls are always available while in fullscreen on macOS, and they are never available when in fullscreen on iOS.
+        if (this.isFullscreen)
+            return !!(this.layoutTraits & LayoutTraits.macOS);
+
+        // Otherwise, for controls to be available, the controls attribute must be present on the media element
+        // or the MediaControlsHost must indicate that controls are forced.
+        return this.media.controls || !!(this.host && this.host.shouldForceControlsDisplay);
+    }
+
     _updateControlsAvailability()
     {
-        const shouldControlsBeAvailable = !!(this.media.controls || (this.host && this.host.shouldForceControlsDisplay) || ((this.layoutTraits & LayoutTraits.macOS) && this.isFullscreen));
-
+        const shouldControlsBeAvailable = this._shouldControlsBeAvailable();
         if (!shouldControlsBeAvailable)
             this._supportingObjects.forEach(supportingObject => supportingObject.disable());
         else
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to