mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-23 17:07:31 +09:00
Test fractional border width rounding
This commit is contained in:
parent
cf8b773656
commit
2bd01e4236
1 changed files with 0 additions and 31 deletions
|
|
@ -24,8 +24,6 @@ var tests = [
|
|||
["2px", "2px"],
|
||||
["2.75px", "2px"],
|
||||
["2.999px", "2px"],
|
||||
["3px", "3px"],
|
||||
["3.001px", "3px"],
|
||||
];
|
||||
|
||||
function checkWidth(property, setupProperty, setupValue) {
|
||||
|
|
@ -44,37 +42,8 @@ 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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue