Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Modern Media Controls] [macOS] Only show total duration when the ela…
…psed time is visible https://bugs.webkit.org/show_bug.cgi?id=228191 <rdar://problem/80529918> Reviewed by Eric Carlson. Source/WebCore: When a `<video>` is narrow (~250px) WebKit will drop the elapsed time, meaning that only the scrubber and duration are visible. It's not very helpful to show just the duration because it never changes, requiring the user to do the mental math of dividing the scrubber width by the total duration to figure out how much time is left (and has elapsed). Showing the remaining time is better because it at least helps the user not have to figure out how much longer the `<video>` will play (which is more useful/actionable than knowing the duration). Test: media/modern-media-controls/time-control/time-control.html * Modules/modern-media-controls/controls/time-control.js: (TimeControl): (TimeControl.prototype.handleEvent): (TimeControl.prototype.get _canShowDurationTimeLabel): Added. (TimeControl.prototype._durationOrRemainingTimeLabel): (TimeControl.prototype._performIdealLayout): Rename `_showDurationTimeLabel` to `_shouldShowDurationTimeLabel` and add another private getter `_canShowDurationTimeLabel` that only is true when `this.elapsedTimeLabel.visible`. Use both to decide whether duration or remaining is shown/updated/etc.. LayoutTests: * media/modern-media-controls/time-control/time-control.html: * media/modern-media-controls/time-control/time-control-expected.txt: Canonical link: https://commits.webkit.org/239910@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
5 changed files
with
162 additions
and
13 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