-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[layout] Fix synthesis of inline baselines.
Previously for <button>, <input type=button> (and friends), and <input type=range> we'd explicitly produce a baseline at appropriate "end" edge. This wasn't strictly correct instead we should be synthesizing them within LogicalBoxFragment::BaselineMetrics. There are three different ways to synthesize these baseline, off the margin-box (the default), content-box (buttons), and border-box (range and checkbox/radio with effective appearance). Instead of checking all these conditions, this patch introduces an additional field to the computed style to tell BaselineMetrics which edge the synthesize off. This patch makes changes two WPT tests which (I believe) to be incorrect see: #45889 The TL;DR is that: <button></button> <button style="contain:layout"></button> Currently have different baselines when they shouldn't. The image rebaselines are ensuring that we synthesize the baseline for range controls consistently. Previously we'd synthesize them off the border-box if they were in the same writing-mode, and off the margin-box if in a different writing-mode. Bug: 40937312 Change-Id: I28eedfbce58ead9d5e3119ae3b164c559fb9267c
- Loading branch information
1 parent
6ae7875
commit e3a47d2
Showing
6 changed files
with
33 additions
and
4 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<link rel="help" href="https://drafts.csswg.org/css-contain-1/#containment-layout"> | ||
<link rel="help" href="https://github.com/web-platform-tests/wpt/issues/45889"> | ||
<link rel="match" href="reference/contain-layout-button-002-ref.html"> | ||
<meta name=assert content="An empty button and a button with layout containment should align the same."> | ||
<style> | ||
button { | ||
border: 5px solid green; | ||
padding: 10px; | ||
margin-bottom: 2px; | ||
color: transparent; | ||
width: 20px; | ||
height: 20px; | ||
} | ||
</style> | ||
|
||
<p>This test passes if it has the same output as the reference.</p> | ||
<button></button> <button style="contain:layout"></button> |
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
13 changes: 13 additions & 0 deletions
13
css/css-contain/reference/contain-layout-button-002-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,13 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
button { | ||
border: 5px solid green; | ||
padding: 10px; | ||
margin-bottom: 2px; | ||
color: transparent; | ||
width: 20px; | ||
height: 20px; | ||
} | ||
</style> | ||
<p>This test passes if it has the same output as the reference.</p> | ||
<button></button> <button></button> |