Changeset 211209 in webkit


Ignore:
Timestamp:
Jan 26, 2017 6:58:10 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[Modern Media Controls] Hiding controls, changing their width and showing them again shows an incorrect layout
https://bugs.webkit.org/show_bug.cgi?id=167160
<rdar://problem/29612318>

Patch by Antoine Quint <Antoine Quint> on 2017-01-26
Reviewed by Dean Jackson.

Source/WebCore:

When we toggle visibility of the controls bar, we notify the hosting media controls and in the case of the
macOS inline media controls, we update the controls layout which would have failed to run last time it tried
due to the controls bar being hidden.

Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar.html

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

(ControlsBar.prototype.set visible):

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

(MacOSInlineMediaControls.prototype.controlsBarVisibilityDidChange):

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

(MediaControls.prototype.controlsBarVisibilityDidChange):

LayoutTests:

Add a new test that creates media controls at a given width, hides the controls bar, increases the width, makes
the controls bar visible again, and checks that the layout was correctly updated as a result.

  • media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar-expected.txt: Added.
  • media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r211201 r211209  
     12017-01-26  Antoine Quint  <graouts@apple.com>
     2
     3        [Modern Media Controls] Hiding controls, changing their width and showing them again shows an incorrect layout
     4        https://bugs.webkit.org/show_bug.cgi?id=167160
     5        <rdar://problem/29612318>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add a new test that creates media controls at a given width, hides the controls bar, increases the width, makes
     10        the controls bar visible again, and checks that the layout was correctly updated as a result.
     11
     12        * media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar-expected.txt: Added.
     13        * media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar.html: Added.
     14
    1152017-01-25  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/Source/WebCore/ChangeLog

    r211208 r211209  
     12017-01-26  Antoine Quint  <graouts@apple.com>
     2
     3        [Modern Media Controls] Hiding controls, changing their width and showing them again shows an incorrect layout
     4        https://bugs.webkit.org/show_bug.cgi?id=167160
     5        <rdar://problem/29612318>
     6
     7        Reviewed by Dean Jackson.
     8
     9        When we toggle visibility of the controls bar, we notify the hosting media controls and in the case of the
     10        macOS inline media controls, we update the controls layout which would have failed to run last time it tried
     11        due to the controls bar being hidden.
     12
     13        Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar.html
     14
     15        * Modules/modern-media-controls/controls/controls-bar.js:
     16        (ControlsBar.prototype.set visible):
     17        * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
     18        (MacOSInlineMediaControls.prototype.controlsBarVisibilityDidChange):
     19        * Modules/modern-media-controls/controls/media-controls.js:
     20        (MediaControls.prototype.controlsBarVisibilityDidChange):
     21
    1222017-01-26  Csaba Osztrogonác  <ossy@webkit.org>
    223
  • trunk/Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js

    r209451 r211209  
    112112    set visible(flag)
    113113    {
     114        if (this.visible === flag)
     115            return;
     116
    114117        // If we just got made visible again, let's fade the controls in.
    115118        if (flag && !this.visible)
     
    119122
    120123        super.visible = flag;
     124
     125        this._mediaControls.controlsBarVisibilityDidChange(this);
    121126    }
    122127
  • trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js

    r209227 r211209  
    132132    }
    133133
     134    controlsBarVisibilityDidChange(controlsBar)
     135    {
     136        if (controlsBar.visible)
     137            this.layout();
     138    }
     139
    134140}
  • trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.js

    r209615 r211209  
    133133    }
    134134
     135    controlsBarVisibilityDidChange(controlsBar)
     136    {
     137        // Implemented by subclasses as needed.
     138    }
     139
    135140    // Private
    136141
Note: See TracChangeset for help on using the changeset viewer.