Skip to content

Commit

Permalink
Don't update row baseline if cell is empty
Browse files Browse the repository at this point in the history
Gecko, Blink and WebKit agree that the if a row only has empty cells,
its baseline should be at the bottom, not at the top.

There isn't interoperability when the cells are just empty-ish, so this
patch takes the simplest approach, aligning with Blink: any out-of-flow
or in-flow content other than collapsed whitespace counts as not empty.
  • Loading branch information
Loirooriol authored and servo-wpt-sync committed Mar 22, 2024
1 parent cc39a9a commit 6b88328
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions css/CSS2/tables/table-vertical-align-baseline-008.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Test for baseline alignment of table cells</title>
<link rel="author" title="Oriol Brufau" href="obrufau@igalia.com" />
<link rel="help" href="https://github.com/servo/servo/issues/31722" />
<link rel="help" href="https://drafts.csswg.org/css2/#height-layout" />
<link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
<meta name="assert" content="Since the cell is empty, its baseline is at the bottom." />
<style><![CDATA[
.wrapper { float: left; font-size: 0; background: red }
.wrapper > * { width: 50px; height: 100px; background: green }
]]></style>
</head>
<body>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class="wrapper">
<div style="display: inline-block"></div>
<table style="display: inline-table; border-spacing: 0">
<td style="vertical-align: baseline; padding: 0"></td>
</table>
</div>
</body>
</html>

0 comments on commit 6b88328

Please sign in to comment.