Changeset 218400 in webkit


Ignore:
Timestamp:
Jun 16, 2017 11:55:03 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION: AirPlay placard is not shown when in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=173447
<rdar://problem/32803773>

Patch by Antoine Quint <Antoine Quint> on 2017-06-16
Reviewed by Jon Lee.

Source/WebCore:

We only allowed a placard to be set on inline controls, but that was an oversight: placards
should be displayed in fullscreen as well. As such, we move the "placard" property up from
InlineMediaControls to MediaControls, and update the layout() logic in MacOSFullscreenMediaControls
to display a placard.

Test: media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html

  • Modules/modern-media-controls/controls/inline-media-controls.js:

(InlineMediaControls):
(InlineMediaControls.prototype.layout):
(InlineMediaControls.prototype.get placard): Deleted.
(InlineMediaControls.prototype.set placard): Deleted.

  • Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:

(MacOSFullscreenMediaControls.prototype.layout):

  • Modules/modern-media-controls/controls/media-controls.js:

(MediaControls.prototype.get placard):
(MediaControls.prototype.set placard):
(MediaControls.prototype.placardPreventsControlsBarDisplay):
(MediaControls.prototype.layout):

  • Modules/modern-media-controls/media/placard-support.js:

(PlacardSupport.prototype._updatePlacard):
(PlacardSupport):

LayoutTests:

Add a new test to check that we display the AirPlay placard on macOS in fullscreen.

  • media/modern-media-controls/placard-support/placard-support-airplay-fullscreen-expected.txt: Added.
  • media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html: Added.
  • platform/ios-simulator/TestExpectations:
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r218398 r218400  
     12017-06-16  Antoine Quint  <graouts@apple.com>
     2
     3        REGRESSION: AirPlay placard is not shown when in fullscreen
     4        https://bugs.webkit.org/show_bug.cgi?id=173447
     5        <rdar://problem/32803773>
     6
     7        Reviewed by Jon Lee.
     8
     9        Add a new test to check that we display the AirPlay placard on macOS in fullscreen.
     10
     11        * media/modern-media-controls/placard-support/placard-support-airplay-fullscreen-expected.txt: Added.
     12        * media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html: Added.
     13        * platform/ios-simulator/TestExpectations:
     14
    1152017-06-16  Antoine Quint  <graouts@apple.com>
    216
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r218398 r218400  
    116116media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-parent-element.html [ Skip ]
    117117media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html [ Skip ]
     118media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html [ Skip ]
    118119
    119120# These tests specifically test iOS-only media controls features
  • trunk/Source/WebCore/ChangeLog

    r218399 r218400  
     12017-06-16  Antoine Quint  <graouts@apple.com>
     2
     3        REGRESSION: AirPlay placard is not shown when in fullscreen
     4        https://bugs.webkit.org/show_bug.cgi?id=173447
     5        <rdar://problem/32803773>
     6
     7        Reviewed by Jon Lee.
     8
     9        We only allowed a placard to be set on inline controls, but that was an oversight: placards
     10        should be displayed in fullscreen as well. As such, we move the "placard" property up from
     11        InlineMediaControls to MediaControls, and update the layout() logic in MacOSFullscreenMediaControls
     12        to display a placard.
     13
     14        Test: media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html
     15
     16        * Modules/modern-media-controls/controls/inline-media-controls.js:
     17        (InlineMediaControls):
     18        (InlineMediaControls.prototype.layout):
     19        (InlineMediaControls.prototype.get placard): Deleted.
     20        (InlineMediaControls.prototype.set placard): Deleted.
     21        * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
     22        (MacOSFullscreenMediaControls.prototype.layout):
     23        * Modules/modern-media-controls/controls/media-controls.js:
     24        (MediaControls.prototype.get placard):
     25        (MediaControls.prototype.set placard):
     26        (MediaControls.prototype.placardPreventsControlsBarDisplay):
     27        (MediaControls.prototype.layout):
     28        * Modules/modern-media-controls/media/placard-support.js:
     29        (PlacardSupport.prototype._updatePlacard):
     30        (PlacardSupport):
     31
    1322017-06-16  Jer Noble  <jer.noble@apple.com>
    233
  • trunk/Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js

    r218241 r218400  
    3838        this.element.classList.add("inline");
    3939
    40         this._placard = null;
    41 
    42         this.airplayPlacard = new AirplayPlacard(this);
    43         this.invalidPlacard = new InvalidPlacard(this);
    44         this.pipPlacard = new PiPPlacard(this);
    45 
    4640        this.skipBackButton = new SkipBackButton(this);
    4741        this.skipForwardButton = new SkipForwardButton(this);
     
    9589    }
    9690
    97     get placard()
    98     {
    99         return this._placard;
    100     }
    101 
    102     set placard(placard)
    103     {
    104         if (this._placard === placard)
    105             return;
    106 
    107         this._placard = placard;
    108         this.layout();
    109     }
    110 
    11191    // Protected
    11292
     
    11797        const children = [];
    11898
    119         if (this._placard) {
    120             this._placard.width = this.width;
    121             this._placard.height = this.height;
    122             children.push(this._placard);
    123             // The AirPlay placard is the only one allowing controls to show as well.
    124             if (this._placard !== this.airplayPlacard) {
     99        if (this.placard) {
     100            children.push(this.placard);
     101            if (this.placardPreventsControlsBarDisplay()) {
    125102                this.children = children;
    126103                return;
  • trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js

    r217823 r218400  
    7676        this.bottomControlsBar.children = [this._leftContainer, this._centerContainer, this._rightContainer];
    7777
    78         this.children = [this.bottomControlsBar];
    79 
    8078        this.bottomControlsBar.element.addEventListener("mousedown", this);
    8179
     
    10098    {
    10199        super.layout();
     100
     101        const children = [];
     102
     103        if (this.placard) {
     104            children.push(this.placard);
     105            if (this.placardPreventsControlsBarDisplay()) {
     106                this.children = children;
     107                return;
     108            }
     109        }
     110
     111        children.push(this.bottomControlsBar);
    102112
    103113        if (!this._rightContainer)
     
    126136            this.timeControl.width = FullscreenTimeControlWidth;
    127137        }
     138
     139        this.children = children;
    128140    }
    129141
  • trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.js

    r217823 r218400  
    5656        this.autoHideController.hasSecondaryUIAttached = false;
    5757
     58        this._placard = null;
     59        this.airplayPlacard = new AirplayPlacard(this);
     60        this.invalidPlacard = new InvalidPlacard(this);
     61        this.pipPlacard = new PiPPlacard(this);
     62
    5863        this.element.addEventListener("focusin", this);
    5964        window.addEventListener("dragstart", this, true);
     
    138143        this._shouldCenterControlsVertically = flag;
    139144        this.markDirtyProperty("scaleFactor");
     145    }
     146
     147    get placard()
     148    {
     149        return this._placard;
     150    }
     151
     152    set placard(placard)
     153    {
     154        if (this._placard === placard)
     155            return;
     156
     157        this._placard = placard;
     158        this.layout();
     159    }
     160
     161    placardPreventsControlsBarDisplay()
     162    {
     163        return this._placard && this._placard !== this.airplayPlacard;
    140164    }
    141165
     
    199223        else if (event.type === "dragstart" && this.isPointInControls(new DOMPoint(event.clientX, event.clientY)))
    200224            event.preventDefault();
     225    }
     226
     227    layout()
     228    {
     229        super.layout();
     230
     231        if (this._placard) {
     232            this._placard.width = this.width;
     233            this._placard.height = this.height;
     234        }
    201235    }
    202236
  • trunk/Source/WebCore/Modules/modern-media-controls/media/placard-support.js

    r218241 r218400  
    4949    _updatePlacard()
    5050    {
    51         if (this.mediaController.layoutTraits & LayoutTraits.Fullscreen)
    52             return;
    53 
    5451        const controls = this.mediaController.controls;
    5552        const media = this.mediaController.media;
Note: See TracChangeset for help on using the changeset viewer.