Changeset 202509 in webkit


Ignore:
Timestamp:
Jun 27, 2016 1:37:48 PM (8 years ago)
Author:
eric.carlson@apple.com
Message:

[Mac] PiP placeholder should remain visible when 'controls' attribute is removed
https://bugs.webkit.org/show_bug.cgi?id=159158
<rdar://problem/26727435>

Reviewed by Jer Noble.

Source/WebCore:

No new tests, existing test updated.

  • Modules/mediacontrols/mediaControlsApple.js:

(Controller.prototype.shouldHaveControls): Always return true when in PiP or AirPlay mode.

LayoutTests:

  • media/controls/picture-in-picture-expected.txt: Updated.
  • media/controls/picture-in-picture.html: Ditto.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202505 r202509  
     12016-06-27  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Mac] PiP placeholder should remain visible when 'controls' attribute is removed
     4        https://bugs.webkit.org/show_bug.cgi?id=159158
     5        <rdar://problem/26727435>
     6
     7        Reviewed by Jer Noble.
     8
     9        * media/controls/picture-in-picture-expected.txt: Updated.
     10        * media/controls/picture-in-picture.html: Ditto.
     11
    1122016-06-27  Antoine Quint  <graouts@apple.com>
    213
  • trunk/LayoutTests/media/controls/picture-in-picture-expected.txt

    r202219 r202509  
    2424PASS: Inline placeholder should be visible at this point
    2525
     26Test for the pip placeholder visibility in pip mode without a 'controls' attribute
     27
     28PASS: Should still be in pip mode
     29PASS: No controls attribute
     30PASS: Inline placeholder should still be visible
     31
    2632Testing finished.
    2733
  • trunk/LayoutTests/media/controls/picture-in-picture.html

    r202219 r202509  
    88                window.internals.settings.setAllowsPictureInPictureMediaPlayback(true);
    99
    10             var tester = new ControlsTest("non-existent-media-file", "error")
     10            const tester = new ControlsTest("non-existent-media-file", "error")
    1111                .whenReady(runTestsWithoutVideo)
    1212                .start();
     
    1414            function runTestsWithoutVideo()
    1515            {
    16                 var currentState = tester.currentState;
     16                const currentState = tester.currentState;
    1717                tester.test("We are using the apple idiom")
    1818                    .value(currentState.idiom)
     
    2121                tester.startNewSection("Test the picture-in-picture button without video", true);
    2222
    23                 var stateForPictureInPictureButton = tester.stateForControlsElement("Picture-in-picture Button");
     23                const stateForPictureInPictureButton = tester.stateForControlsElement("Picture-in-picture Button");
    2424                tester.test("Picture-in-picture button should not be visible if there's no video")
    2525                    .value(stateForPictureInPictureButton.className)
     
    3535                tester.startNewSection("Test the picture-in-picture button with valid video");
    3636
    37                 var stateForPictureInPictureButton = tester.stateForControlsElement("Picture-in-picture Button", true);
     37                const stateForPictureInPictureButton = tester.stateForControlsElement("Picture-in-picture Button", true);
    3838                tester.test("Picture-in-picture button should be visible if there's video")
    3939                    .value(stateForPictureInPictureButton.className)
     
    4444                    .isNotEqualTo(undefined);
    4545
    46                 var stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
     46                const stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
    4747                tester.test("Inline placeholder should not be visible at this point")
    4848                    .value(stateForPlaceholder.className)
     
    6363                    .isEqualTo("picture-in-picture");
    6464
    65                 var stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
     65                const stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
    6666                tester.test("Inline placeholder should be visible at this point")
    6767                    .value(stateForPlaceholder.className)
    6868                    .doesNotContain("hidden");
    6969
     70                const controlsObserver = new MutationObserver(controlsDidChange);
     71                controlsObserver.observe(tester.media, { attributes: true, attributeFilter: ['controls'] });
     72
     73                tester.media.removeAttribute('controls');
     74            }
     75
     76            function controlsDidChange()
     77            {
     78                tester.startNewSection("Test for the pip placeholder visibility in pip mode without a 'controls' attribute");
     79
     80                tester.test("Should still be in pip mode")
     81                    .value(tester.media.webkitPresentationMode)
     82                    .isEqualTo("picture-in-picture");
     83
     84                tester.test("No controls attribute")
     85                    .value(tester.media.hasAttribute('controls'))
     86                    .isFalse();
     87
     88                const stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
     89                tester.test("Inline placeholder should still be visible")
     90                    .value(stateForPlaceholder.className)
     91                    .doesNotContain("hidden");
     92
    7093                tester.media.webkitSetPresentationMode("inline");
     94
    7195                tester.end();
    7296            }
  • trunk/Source/WebCore/ChangeLog

    r202507 r202509  
     12016-06-27  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Mac] PiP placeholder should remain visible when 'controls' attribute is removed
     4        https://bugs.webkit.org/show_bug.cgi?id=159158
     5        <rdar://problem/26727435>
     6
     7        Reviewed by Jer Noble.
     8
     9        No new tests, existing test updated.
     10
     11        * Modules/mediacontrols/mediaControlsApple.js:
     12        (Controller.prototype.shouldHaveControls): Always return true when in PiP or AirPlay mode.
     13
    1142016-06-27  Oliver Hunt  <oliver@apple.com>
    215
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

    r202505 r202509  
    307307            return true;
    308308
    309         return this.video.controls || this.isFullScreen();
     309        if (this.isFullScreen() || this.presentationMode() === 'picture-in-picture' || this.currentPlaybackTargetIsWireless())
     310            return true;
     311
     312        return this.video.controls;
    310313    },
    311314
Note: See TracChangeset for help on using the changeset viewer.