mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
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).
43 lines
1.2 KiB
HTML
43 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<!--
|
|
Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/
|
|
-->
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>CSS Reftest Reference</title>
|
|
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
|
<style type="text/css">
|
|
div {
|
|
background: lightgray;
|
|
margin-right: 2px;
|
|
background-image: url("support/colors-16x8.svg");
|
|
background-size: contain;
|
|
background-repeat: no-repeat;
|
|
float: left;
|
|
width: 20px;
|
|
height: 20px;
|
|
}
|
|
|
|
.op_y-7 { background-position: 50% -7% }
|
|
.op_y13 { background-position: 50% 13% }
|
|
.op_y23 { background-position: 50% 23% }
|
|
.op_y50 { background-position: 50% 50% }
|
|
.op_y75 { background-position: 50% 75% }
|
|
.op_y88 { background-position: 50% 88% }
|
|
.op_y111 { background-position: 50% 111% }
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="op_y-7"></div>
|
|
<div class="op_y13"></div>
|
|
<div class="op_y23"></div>
|
|
<div class="op_y50"></div>
|
|
<div class="op_y75"></div>
|
|
<div class="op_y88"></div>
|
|
<div class="op_y111"></div>
|
|
</body>
|
|
</html>
|