layout: Fix baseline alignment of horizontal text in column flex container - #46697
Conversation
|
A test case that is improved by this change is <style>
* {
outline: 1px solid black;
}
div {
display: flex;
flex-direction: column;
align-items: baseline;
}
</style>
<body>
<div>
<h1>This text</h1>
<p>should be left aligned.</p>
</div>
</body> |
3e24119 to
c203622
Compare
|
Please take another look at the failing tests as |
6696195 to
ffbc462
Compare
|
🔨 Triggering try run (#30034882777) for Linux (WPT) |
ffbc462 to
141f7a7
Compare
|
Test results for linux-wpt from try job (#30034882777): Flaky unexpected result (33)
Stable unexpected results that are known to be intermittent (19)
|
|
✨ Try run (#30034882777) succeeded. |
141f7a7 to
d9aac0c
Compare
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#61505) with upstreamable changes. |
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#61505) title and body. |
1 similar comment
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#61505) title and body. |
d9aac0c to
c510046
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#61505). |
…ntainer Signed-off-by: Simon Wülker <[email protected]>
Signed-off-by: Simon Wülker <[email protected]>
Signed-off-by: Simon Wülker <[email protected]>
c510046 to
8d6cc58
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#61505). |
When flex items have no natural baseline (such as text items in a container with
flex-direction: column) then we must synthesize one from the items border box. In that case the baseline is given by the line-under border edge. So far we've been assuming that the line-under edge is always the cross-end edge of the flex item. But in reality, it depends on the flex axis and the writing mode of the item and its container. In particular, the current code incorrectly aligns items by their right border edge forwriting-mode: initialandflex-direction: column(the baseline should be the left border edge).This change instead follows the algorithm from the specification for computing a synthetic baseline.
Testing: New tests start to pass.
css/css-flexbox/align-items-baseline-column-vert-lr-items.htmlregresses - this test uses baselines from vertical text, but we don't support vertical writing modes yet. I've also added a new test as the interaction betweenflex-direction: row-reverseanddirection: rtlwas not covered by WPT.