Skip to content

Commit 65fc0c8

Browse files
Phinehas Fuachieaestes
authored andcommitted
Timeline scubber for mac inline controls is pushed too far to the right and overlaps with the rightContainerButtons
https://bugs.webkit.org/show_bug.cgi?id=304993 rdar://167634241 This patch restores the expected positioning by ensuring the scrubber does not inherit a fixed left offset from the shared controls. Reviewed by Andy Estes. * LayoutTests/media/modern-media-controls/macos-inline-media-controls/mac-inline-controls-time-control-no-overlap-expected.txt: Added. * LayoutTests/media/modern-media-controls/macos-inline-media-controls/mac-inline-controls-time-control-no-overlap.html: Added. * Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm: (WebCore::macOSInlineMediaControlsStyleSheet): Canonical link: https://commits.webkit.org/305177@main
1 parent 0ee5193 commit 65fc0c8

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Testing that time control doesn't overlap right button container in inline media controls.
2+
3+
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4+
5+
6+
PASS timeControlRect.right <= rightContainerRect.left is true
7+
PASS successfullyParsed is true
8+
9+
TEST COMPLETE
10+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script src="../../../resources/js-test-pre.js"></script>
2+
<script src="../resources/media-controls-utils.js" type="text/javascript"></script>
3+
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
4+
<body>
5+
<script type="text/javascript">
6+
7+
description("Testing that time control doesn't overlap right button container in inline media controls.");
8+
9+
const mediaControls = new MacOSInlineMediaControls({ width: 600, height: 300 });
10+
11+
const timeControlRect = mediaControls.timeControl.element.getBoundingClientRect();
12+
const rightContainerRect = mediaControls.rightContainer.element.getBoundingClientRect();
13+
14+
shouldBeTrue("timeControlRect.right <= rightContainerRect.left");
15+
16+
</script>
17+
<script src="../../../resources/js-test-post.js"></script>
18+
</body>

Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ static inline bool canShowCapsLockIndicator()
480480
" min-width: fit-content;"
481481
"}"
482482
".media-controls.mac.inline:not(.audio) > .controls-bar.bottom > .time-control {"
483+
" left: auto !important;"
483484
" max-width: 540px;"
484485
"}"
485486
".media-controls.mac.inline:not(.audio) > .controls-bar.bottom > .buttons-container.right {"

0 commit comments

Comments
 (0)