Skip to content

Commit

Permalink
patch 2 - Also pass percentage basis when computing intrinsic contrib…
Browse files Browse the repository at this point in the history
…ution for fieldset contents.

Differential Revision: https://phabricator.services.mozilla.com/D222591

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1919220
gecko-commit: b51d80a6a0c4c1064f62a9e39c9752b58aec2131
gecko-reviewers: dshin
  • Loading branch information
jfkthame authored and moz-wptsync-bot committed Sep 20, 2024
1 parent 148f239 commit 2574834
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
27 changes: 27 additions & 0 deletions css/css-sizing/intrinsic-percent-replaced-022.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1919220">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<meta name="assert" content="This test verifies that fieldset's width is the same as the img's width, transferred from the img's height and aspect-ratio.">

<style>
fieldset {
margin: 0;
padding: 0;
border: 0;
height: 100px;
width: fit-content;
background: red;
}
img {
height: 100%;
}
</style>

<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<fieldset>
<img src="aspect-ratio/support/200x200-green.png">
</fieldset>
28 changes: 28 additions & 0 deletions css/css-sizing/intrinsic-percent-replaced-023.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1919220">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<meta name="assert" content="This test verifies that fieldset's width is the same as the img's width, transferred from the img's height and aspect-ratio.">

<style>
fieldset {
margin: 0;
padding: 10px;
border: 0;
height: 80px;
width: fit-content;
/* create a red dot that should be covered by the <img> */
background: radial-gradient(red, red 50%, green 50%, green 100%);
}
img {
height: 100%;
}
</style>

<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<fieldset>
<img src="aspect-ratio/support/200x200-green.png">
</fieldset>

0 comments on commit 2574834

Please sign in to comment.