Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Slider thumb is wrongly placed in vertical writing-mode + RTL
https://bugs.webkit.org/show_bug.cgi?id=248320 rdar://102652014 Reviewed by Cameron McCormack. thumb->setLocation() uses logical coordinates, so we can't share the same path with appearance: slider-vertical, otherwise we end up placing the thumb outside of the track. Add reftests that check that we don't paint anything outside the bounds of the input. * LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/forms/range-input-painting-ref.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/forms/range-input-vertical-ltr-painting-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/forms/range-input-vertical-ltr-painting.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/forms/range-input-vertical-rtl-painting-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/forms/range-input-vertical-rtl-painting.html: Added. * Source/WebCore/html/shadow/SliderThumbElement.cpp: (WebCore::RenderSliderContainer::layout): Canonical link: https://commits.webkit.org/257002@main
- Loading branch information
Showing
6 changed files
with
91 additions
and
5 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...imported/w3c/web-platform-tests/css/css-writing-modes/forms/range-input-painting-ref.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<!DOCTYPE html> | ||
<title>Reference: painting of input[type=range] does not happen outside of its bounds</title> | ||
<p>The range input below should be fully covered.</p> |
3 changes: 3 additions & 0 deletions
3
...latform-tests/css/css-writing-modes/forms/range-input-vertical-ltr-painting-expected.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<!DOCTYPE html> | ||
<title>Reference: painting of input[type=range] does not happen outside of its bounds</title> | ||
<p>The range input below should be fully covered.</p> |
37 changes: 37 additions & 0 deletions
37
...w3c/web-platform-tests/css/css-writing-modes/forms/range-input-vertical-ltr-painting.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> | ||
<link rel="help" href="https://html.spec.whatwg.org/#range-state-(type=range)"> | ||
<link rel="help" href="https://drafts.csswg.org/css-writing-modes-4/#block-flow"> | ||
<title>Test that painting of input[type=range] does not happen outside of its bounds</title> | ||
<meta charset="utf-8"> | ||
<link rel="match" href="range-input-painting-ref.html"> | ||
|
||
<style> | ||
#container { | ||
position: relative; | ||
} | ||
#cover { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: red; | ||
} | ||
@supports (writing-mode: vertical-lr) { | ||
#cover { | ||
background-color: Canvas; | ||
} | ||
} | ||
input { | ||
appearance: none; /* Disable any native appearance that could cause ink overflow */ | ||
writing-mode: vertical-lr; | ||
} | ||
</style> | ||
|
||
<p>The range input below should be fully covered.</p> | ||
|
||
<div id="container"> | ||
<input type="range"> | ||
<div id="cover"></div> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
...latform-tests/css/css-writing-modes/forms/range-input-vertical-rtl-painting-expected.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<!DOCTYPE html> | ||
<title>Reference: painting of input[type=range] does not happen outside of its bounds</title> | ||
<p>The range input below should be fully covered.</p> |
39 changes: 39 additions & 0 deletions
39
...w3c/web-platform-tests/css/css-writing-modes/forms/range-input-vertical-rtl-painting.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html> | ||
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> | ||
<link rel="help" href="https://html.spec.whatwg.org/#range-state-(type=range)"> | ||
<link rel="help" href="https://drafts.csswg.org/css-writing-modes-4/#block-flow"> | ||
<title>Test that painting of input[type=range] does not happen outside of its bounds</title> | ||
<meta charset="utf-8"> | ||
<link rel="match" href="range-input-painting-ref.html"> | ||
|
||
<style> | ||
#container { | ||
position: relative; | ||
} | ||
#cover { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: red; | ||
} | ||
@supports (writing-mode: vertical-lr) and (direction: rtl) { | ||
#cover { | ||
background-color: Canvas; | ||
} | ||
} | ||
input { | ||
appearance: none; /* Disable any native appearance that could cause ink overflow */ | ||
writing-mode: vertical-lr; | ||
direction: rtl; | ||
} | ||
</style> | ||
|
||
<p>The range input below should be fully covered.</p> | ||
|
||
<div id="container"> | ||
<input type="range"> | ||
<div id="cover"></div> | ||
</div> | ||
|
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