Fix CSS border rounding and currentcolor clipping

This commit is contained in:
Basilisk-Dev 2026-05-09 14:27:59 -04:00 committed by wuggy
commit 956b9caced

View file

@ -42,8 +42,37 @@ function checkWidth(property, setupProperty, setupValue) {
});
}
function checkOffset(property) {
tests.forEach(function(test) {
var specified = test[0];
var expected = test[1];
var div = document.createElement("div");
div.style[property] = specified;
display.appendChild(div);
is(document.defaultView.getComputedStyle(div, "")[property], expected,
property + " computes " + specified + " as " + expected);
display.removeChild(div);
});
tests.forEach(function(test) {
var specified = test[0];
var expected = test[0] == "0px" ? "0px" : "-" + test[1];
var div = document.createElement("div");
div.style[property] = "-" + specified;
display.appendChild(div);
is(document.defaultView.getComputedStyle(div, "")[property], expected,
property + " computes -" + specified + " as " + expected);
display.removeChild(div);
});
}
checkWidth("borderWidth", "borderStyle", "solid");
checkWidth("outlineWidth", "outlineStyle", "solid");
checkOffset("outlineOffset");
</script>
</pre>