mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
layout: Fix block SizeConstraint for replaced elements (#37758)
#37433 didn't handle intrinsic contributions. This patch computes the correct SizeConstraint to be used as the ConstraintSpace's block size when computing intrinsic inline sizes. Testing: Adding new test Fixes: #37478 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
f23e3e25b8
commit
4cd7c5196b
7 changed files with 168 additions and 33 deletions
7
tests/wpt/meta/MANIFEST.json
vendored
7
tests/wpt/meta/MANIFEST.json
vendored
|
@ -610358,6 +610358,13 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"keyword-sizes-for-intrinsic-contributions-002.html": [
|
||||
"a053d88c1eefd0379ff7e612dfd3d1c39e7c581e",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
]
|
||||
],
|
||||
"keyword-sizes-for-intrinsic-contributions.html": [
|
||||
"b42bd71b8e7ccc802ba11e3bf3384b3854a0c3fa",
|
||||
[
|
||||
|
|
44
tests/wpt/tests/css/css-sizing/keyword-sizes-for-intrinsic-contributions-002.html
vendored
Normal file
44
tests/wpt/tests/css/css-sizing/keyword-sizes-for-intrinsic-contributions-002.html
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Keyword sizes for intrinsic contributions</title>
|
||||
<link rel="author" title="Oriol Brufau" href="obrufau@igalia.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#sizing-values">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#intrinsic-contribution">
|
||||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/12333">
|
||||
<link rel="help" href="https://github.com/servo/servo/issues/37478">
|
||||
<meta assert="Intrinsic keywords for min/max block sizes on a replaced element affect the inline min/max-content contributions.">
|
||||
|
||||
<style>
|
||||
.test { width: max-content; background: red; border: 5px solid; margin: 5px; }
|
||||
.test.flex-row { display: flex; flex-direction: row; }
|
||||
.test.flex-col { display: flex; flex-direction: column; }
|
||||
canvas { display: block; background: green; height: 0px; width: max-content; }
|
||||
</style>
|
||||
<div id="log"></div>
|
||||
|
||||
<div class="test" data-expected-width="60" data-expected-height="60">
|
||||
<canvas width="50" height="50" style="height: 0px; min-height: max-content">
|
||||
</div>
|
||||
<div class="test" data-expected-width="60" data-expected-height="60">
|
||||
<canvas width="50" height="50" style="height: 100px; max-height: max-content"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="test flex-row" data-expected-width="60" data-expected-height="60">
|
||||
<canvas width="50" height="50" style="height: 0px; min-height: max-content">
|
||||
</div>
|
||||
<div class="test flex-row" data-expected-width="60" data-expected-height="60">
|
||||
<canvas width="50" height="50" style="height: 100px; max-height: max-content"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="test flex-col" data-expected-width="60" data-expected-height="60">
|
||||
<canvas width="50" height="50" style="height: 0px; min-height: max-content">
|
||||
</div>
|
||||
<div class="test flex-col" data-expected-width="60" data-expected-height="60">
|
||||
<canvas width="50" height="50" style="height: 100px; max-height: max-content"></canvas>
|
||||
</div>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/check-layout-th.js"></script>
|
||||
<script>
|
||||
checkLayout(".test");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue