Files
sousa-gecko/testing/web-platform/tests/css/cssom/resolved-border-width.html
T
Emilio Cobos Álvarez b042e3fda6 Bug 1951562 - Do not return used border-width values from getComputedStyle(). r=layout-reviewers,dholbert
border-*-width is not on the list of properties with resolved values:
https://drafts.csswg.org/cssom-1/#resolved-values

This used to be more useful when our buttons and so on didn't respect
the UA sheet borders.

Let's try to do this? Otherwise we should file a bug to change the spec.

Differential Revision: https://phabricator.services.mozilla.com/D240312
2025-03-04 15:25:41 +00:00

20 lines
835 B
HTML

<!doctype html>
<meta charset="utf-8">
<link rel="help" href="https://drafts.csswg.org/cssom-1/#resolved-values">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<title>border-*-width returns computed rather than used values from getComputedStyle()</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<input type=checkbox style="border: 5px solid red">
<input type=radio style="border: 5px solid red">
<script>
for (let input of document.querySelectorAll("input")) {
test(() => {
let cs = getComputedStyle(input);
for (let prop of ["border-width", "border-top-width", "border-right-width", "border-bottom-width", "border-left-width"]) {
assert_equals(cs.getPropertyValue(prop), "5px", prop);
}
}, input.type);
}
</script>