-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1733952 - When computing inline intrinsic sizes, resolve with a 0…
… percentage basis rather than just resolving to zero if there's a percentage. r=jfkthame This matches other browsers, the spec (https://drafts.csswg.org/css-sizing/#cyclic-percentage-contribution): For the min size properties, as well as for margins and paddings (and gutters), a cyclic percentage is resolved against zero for determining intrinsic size contributions. And also what we do in SizeComputationInput::Compute{Margin,Padding}: https://searchfox.org/mozilla-central/rev/75e9d727ce5ba2c14653cf8fb0f1367f085271b7/layout/generic/ReflowInput.cpp#2811-2832 https://searchfox.org/mozilla-central/rev/75e9d727ce5ba2c14653cf8fb0f1367f085271b7/layout/generic/ReflowInput.cpp#2861-2868 This fixes a compat issue with the menu alignment in lume.io: webcompat/web-bugs#88484 (comment) It's also simpler. Differential Revision: https://phabricator.services.mozilla.com/D127441
- Loading branch information
Showing
3 changed files
with
43 additions
and
26 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
15 changes: 15 additions & 0 deletions
15
testing/web-platform/tests/css/css-sizing/inline-intrinsic-size-calc-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,15 @@ | ||
<!doctype html> | ||
<title>Calc gets resolved with 0 percent basis for intrinsic size computation</title> | ||
<style> | ||
div { | ||
background-color: green; | ||
width: max-content; | ||
} | ||
span { | ||
margin-left: 30px; | ||
padding-left: 50px; | ||
} | ||
</style> | ||
<div> | ||
<span>ABCD</span> | ||
</div> |
20 changes: 20 additions & 0 deletions
20
testing/web-platform/tests/css/css-sizing/inline-intrinsic-size-calc.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,20 @@ | ||
<!doctype html> | ||
<title>Calc gets resolved with 0 percent basis for intrinsic size computation</title> | ||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> | ||
<link rel="author" title="Mozilla" href="https://mozilla.org"> | ||
<link rel="match" href="inline-intrinsic-size-calc-ref.html"> | ||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1733952"> | ||
<link rel="help" href="https://drafts.csswg.org/css-sizing/#cyclic-percentage-contribution"> | ||
<style> | ||
div { | ||
background-color: green; | ||
width: max-content; | ||
} | ||
span { | ||
margin-left: calc(0% + 30px); | ||
padding-left: calc(0% + 50px); | ||
} | ||
</style> | ||
<div> | ||
<span>ABCD</span> | ||
</div> |