Skip to content

Commit

Permalink
[ReplacedNG] Compute min-content/max-content within ComputeReplacedSize.
Browse files Browse the repository at this point in the history
\o/

This computes the min/max content sizes for replaced elements directly
within ComputeReplacedSize.

This allows us to simply call:
  ComputeReplacedSize(node, space)

and get the correct size for replaced elements with only those
arguments!

Bug: 1114280
Change-Id: Ieedacf5f0ee814668f1c2c4633946b0bbb27e89f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2818210
Commit-Queue: Ian Kilpatrick <[email protected]>
Reviewed-by: David Grogan <[email protected]>
Cr-Commit-Position: refs/heads/master@{#872558}
  • Loading branch information
bfgeek authored and chromium-wpt-export-bot committed Apr 14, 2021
1 parent 7011e12 commit 1c760ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!DOCTYPE html>
<link rel="help" href="https://www.w3.org/TR/CSS22/visudet.html#abs-replaced-width">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div style="position: relative;">
<img style="position: absolute; height: 100px; min-width: max-content; background: green;" src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'><rect width='100%' height='100%' fill='green'/></svg>">
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!DOCTYPE html>
<link rel="help" href="https://www.w3.org/TR/CSS22/visudet.html#abs-replaced-width">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div style="position: relative; width: 200; height: 200px; margin-top: -50px;">
<img style="position: absolute; top: 0; bottom: 0; height: max-content; margin: auto; width: 100px; background: green;" src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'><rect width='100%' height='100%' fill='green'/></svg>">
</div>

0 comments on commit 1c760ed

Please sign in to comment.