1
0
Fork 0
firefox/testing/web-platform/tests/css/cssom/computed-style-003.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

20 lines
916 B
HTML

<!DOCTYPE html>
<title>CSS Test: getComputedStyle - resolved width in iframe dynamic display</title>
<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org" />
<link rel="help" href="https://drafts.csswg.org/cssom/#resolved-values" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="frm" width="100" style="display:none"></iframe>
<script>
const frmDoc = frm.contentWindow.document;
frmDoc.open();
frmDoc.write('<body style="margin:0"><div style="width:100%"></div>');
frmDoc.close();
document.body.offsetWidth; // Make sure we layout the top document.
test(() => {
frm.style.display = "inline";
assert_equals(frm.contentWindow.getComputedStyle(frmDoc.querySelector("div")).width, "100px");
}, "Check that a percent width in an iframe is the resolved width when the iframe is displayed.");
</script>