mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibWeb: Respect box-sizing value when getting width/height used value
This commit is contained in:
committed by
Jelle Raaijmakers
parent
9d2ebe90ed
commit
8179efb38e
Notes:
github-actions[bot]
2026-03-11 10:34:35 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/8179efb38e2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8358 Reviewed-by: https://github.com/gmta ✅
31
Tests/LibWeb/Text/input/css/computed-style-box-sizing.html
Normal file
31
Tests/LibWeb/Text/input/css/computed-style-box-sizing.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<style>
|
||||
#border-box {
|
||||
box-sizing: border-box;
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
border: 10px solid black;
|
||||
}
|
||||
|
||||
#content-box {
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
border: 10px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../include.js"></script>
|
||||
<div id="border-box"></div>
|
||||
<div id="content-box"><div style="height: 90px;"></div></div>
|
||||
<script>
|
||||
function dump_used_values(label, style, properties) {
|
||||
for (let property of properties)
|
||||
println(`${label} ${property}: ${style.getPropertyValue(property)}`);
|
||||
}
|
||||
|
||||
test(() => {
|
||||
const borderBox = document.getElementById("border-box");
|
||||
const contentBox = document.getElementById("content-box");
|
||||
dump_used_values("border-box", getComputedStyle(borderBox), ["width", "height"]);
|
||||
dump_used_values("content-box", getComputedStyle(contentBox), ["width", "height"]);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user