Skip to content

Commit bedbb49

Browse files
[Modern Media Controls] Controls are laid out incorrectly with RTL languages
https://bugs.webkit.org/show_bug.cgi?id=169605 <rdar://problem/30975709> Patch by Antoine Quint <[email protected]> on 2017-03-14 Reviewed by Eric Carlson. Source/WebCore: Encorce "direction: ltr" on the controls since the controls layout should not be changed by the host page's direction. Test: media/modern-media-controls/media-controls/media-controls-controls-bar-always-ltr.html * Modules/modern-media-controls/controls/controls-bar.css: (.controls-bar): LayoutTests: Add a test that enforces "direction: rtl" on a parent element to check that the controls bar use "direction: ltr" anyway. * media/modern-media-controls/media-controls/media-controls-controls-bar-always-ltr-expected.txt: Added. * media/modern-media-controls/media-controls/media-controls-controls-bar-always-ltr.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@213899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent d871585 commit bedbb49

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed

LayoutTests/ChangeLog

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2017-03-14 Antoine Quint <[email protected]>
2+
3+
[Modern Media Controls] Controls are laid out incorrectly with RTL languages
4+
https://bugs.webkit.org/show_bug.cgi?id=169605
5+
<rdar://problem/30975709>
6+
7+
Reviewed by Eric Carlson.
8+
9+
Add a test that enforces "direction: rtl" on a parent element to check that the controls
10+
bar use "direction: ltr" anyway.
11+
12+
* media/modern-media-controls/media-controls/media-controls-controls-bar-always-ltr-expected.txt: Added.
13+
* media/modern-media-controls/media-controls/media-controls-controls-bar-always-ltr.html: Added.
14+
115
2017-03-13 Wenson Hsieh <[email protected]>
216

317
Make RepaintRegionAccumulator hold a WeakPtr to its root RenderView
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Testing that the controls bar enforces left-to-right layout.
2+
3+
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4+
5+
6+
PASS getComputedStyle(mediaControls.controlsBar.element).direction became "ltr"
7+
PASS successfullyParsed is true
8+
9+
TEST COMPLETE
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script src="../../../resources/js-test-pre.js"></script>
2+
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
3+
<body>
4+
<script type="text/javascript">
5+
6+
window.jsTestIsAsync = true;
7+
8+
description("Testing that the controls bar enforces left-to-right layout.");
9+
10+
const mediaControls = new MediaControls({ layoutTraits: LayoutTraits.macOS });
11+
12+
// Add the media controls and set the direction to be RTL.
13+
document.body.appendChild(mediaControls.element).style.direction = "rtl";
14+
15+
// Ensure that the controls bar itself enforces an LTR direction.
16+
shouldBecomeEqualToString("getComputedStyle(mediaControls.controlsBar.element).direction", "ltr", finishJSTest);
17+
18+
</script>
19+
<script src="../../../resources/js-test-post.js"></script>
20+
</body>

Source/WebCore/ChangeLog

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2017-03-14 Antoine Quint <[email protected]>
2+
3+
[Modern Media Controls] Controls are laid out incorrectly with RTL languages
4+
https://bugs.webkit.org/show_bug.cgi?id=169605
5+
<rdar://problem/30975709>
6+
7+
Reviewed by Eric Carlson.
8+
9+
Encorce "direction: ltr" on the controls since the controls layout should not be changed
10+
by the host page's direction.
11+
12+
Test: media/modern-media-controls/media-controls/media-controls-controls-bar-always-ltr.html
13+
14+
* Modules/modern-media-controls/controls/controls-bar.css:
15+
(.controls-bar):
16+
117
2017-03-13 Wenson Hsieh <[email protected]>
218

319
Make RepaintRegionAccumulator hold a WeakPtr to its root RenderView

Source/WebCore/Modules/modern-media-controls/controls/controls-bar.css

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
.controls-bar {
2727
position: absolute;
2828
transition: opacity 0.1s linear;
29+
direction: ltr;
2930
}
3031

3132
.controls-bar.faded {

0 commit comments

Comments
 (0)