Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Modern Media Controls] Controls size lags behind media size
https://bugs.webkit.org/show_bug.cgi?id=169962 <rdar://problem/30340293> Patch by Antoine Quint <graouts@apple.com> on 2017-03-22 Reviewed by Dean Jackson. Source/WebCore: We used to dispatch the "resize" event to the shadow root on a timer and commit changes to the DOM when handling it inside of a requestAnimationFrame() callback. We now dispatch the "resize" event as a post-layout task and commit to the DOM right away which ensures immediate size changes of the controls. * Modules/modern-media-controls/controls/ios-inline-media-controls.js: (IOSInlineMediaControls.prototype.layout): * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js: (MacOSFullscreenMediaControls.prototype.layout): * Modules/modern-media-controls/controls/macos-inline-media-controls.js: (MacOSInlineMediaControls.prototype.layout): Making some layout() safer by returning early in case they're called during the object construction phase, due to the LayoutNode "width" setter now calling that method. * Modules/modern-media-controls/controls/media-controls.js: (MediaControls.prototype.get width): (MediaControls.prototype.set width): Calling layout() in the "width" setter to ensure that the inline controls layout is invalidated as soon as the controls width changes instead of waiting on the next rAF to update the layout. * Modules/modern-media-controls/controls/scheduler.js: (const.scheduler.new.prototype.flushScheduledLayoutCallbacks): Add a new method to immediately call queued layouts. * Modules/modern-media-controls/media/media-controller.js: (MediaController.prototype.handleEvent): Flush all queued layouts when handling a "resize" event. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::layoutSizeChanged): Queue the "resize" event as a post-layout task. (WebCore::HTMLMediaElement::contextDestroyed): * html/HTMLMediaElement.h: Remove the queue we no longer use. LayoutTests: Updating an existing test to use a "resize" event handler to check that a size change on the element is reflected on the shadow root. This would have failed prior to this patch. Also rebaselining a test which now reports correct values. * media/modern-media-controls/media-controller/media-controller-resize-expected.txt: * media/modern-media-controls/media-controller/media-controller-resize.html: * media/modern-media-controls/media-controller/media-controller-scale-factor-audio-expected.txt: * media/modern-media-controls/media-controller/media-controller-scale-factor-audio.html: Canonical link: https://commits.webkit.org/186909@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
2fc3128
commit 166445e
Showing
14 changed files
with
109 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters