mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout
Instead, compute them on demand. This affects ReplacedBox and its subclasses. This commit is centered around a new Box::auto_content_box_size method. It returns a SizeWithAspectRatio representing the natural size of a replaced element, or the size derived from attributes for text input and textarea. These values are used when the corresponding axis is auto or indefinite. Although introducing this API choke-point for sizing replaced and replaced-like elements was the main goal, it's notable that layout becomes more robust in the face of dynamic changes due to reduced potential for stale size values (at the cost of extra calculations and allocations).
This commit is contained in:
committed by
Sam Atkins
parent
b8ee6ec476
commit
ec50525675
Notes:
github-actions[bot]
2026-02-06 10:41:24 +00:00
Author: https://github.com/jonbgamble Commit: https://github.com/LadybirdBrowser/ladybird/commit/ec50525675b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7028 Reviewed-by: https://github.com/AtkinsSJ ✅ Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/circl-lastname Reviewed-by: https://github.com/shannonbooth
@@ -0,0 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1153028">
|
||||
<meta name="assert" content="When determining a auto row, an indefinite percentage block-size should be considered auto, and use the inline-size + aspect-ratio.">
|
||||
<link rel="match" href="../../../../../expected/wpt-import/css/css-grid/grid-items/../../reference/ref-filled-green-100px-square-only.html">
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div style="display: grid; width: 50px;">
|
||||
<canvas width=200 height=200 style="background: green; height: 100%; width: 200%;"></canvas>
|
||||
</div>
|
||||
Reference in New Issue
Block a user