-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
synthesizedBaseline uses incorrect line under edge for vertical-lr an…
…d sideways items https://bugs.webkit.org/show_bug.cgi?id=263461 rdar://117273063 Reviewed by Alan Baradlay. To synthesize a baseline, the spec says the following: "synthesize the alphabetic baseline from the line-under line, and the central baseline by averaging the positions of the two edges or lines." When the writing mode is vertical-lr and text-orientation is sideways, we must synthesize the alphabetic baseline. This means that the baseline for the item in this writing-mode is its block-start and not the block-end like in vertical-rl writing mode. We can first determine the baseline that we are synthesizing according to the logic in: https://drafts.csswg.org/css-inline-3/#dominant-baseline-property If the baseline type is alphabetic and we are in a vertical-lr writing mode according to the formatting context root, then we can return 0_lu for the synthesized baseline. * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/baseline-synthesis-vert-lr-line-under-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/baseline-synthesis-vert-lr-line-under.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-container-baseline-001-expected.txt: * Source/WebCore/rendering/RenderBox.cpp: (WebCore::synthesizedBaseline): Canonical link: https://commits.webkit.org/269668@main
- Loading branch information
Showing
5 changed files
with
70 additions
and
6 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
7 changes: 7 additions & 0 deletions
7
...3c/web-platform-tests/css/css-flexbox/baseline-synthesis-vert-lr-line-under-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,7 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div style="width:100px; height: 100px; background-color: green;"></div> | ||
</body> | ||
</html> |
39 changes: 39 additions & 0 deletions
39
...mported/w3c/web-platform-tests/css/css-flexbox/baseline-synthesis-vert-lr-line-under.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> | ||
<head> | ||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> | ||
<link rel="author" title="Sammy Gill" href="mailto:sammy.gill@apple.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-align-3/#baseline-export"> | ||
<link rel="help" href="https://drafts.csswg.org/css-writing-modes-4/#line-under"> | ||
<meta name="assert" content="Line under edge of vertical-lr/sideways item is at its block start edge"> | ||
<style> | ||
.flexbox { | ||
display: flex; | ||
writing-mode: vertical-lr; | ||
text-orientation: sideways; | ||
align-items: baseline; | ||
background-color: red; | ||
position: relative; | ||
} | ||
.item { | ||
width: 50px; | ||
height: 50px; | ||
background-color: green; | ||
} | ||
.wide { | ||
width: 100px; | ||
} | ||
.absolute { | ||
position: absolute; | ||
top: 50px; | ||
left: 50px; | ||
} | ||
</style> | ||
</head> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<body> | ||
<div class="flexbox"> | ||
<div class="item wide"></div> | ||
<div class="item"></div> | ||
<div class="item absolute"></div> | ||
</div> | ||
</body> |
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