mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-24 01:17:34 +09:00
Test fractional border width rounding
This commit is contained in:
parent
e0fc46e19c
commit
6c7e6095b5
2 changed files with 52 additions and 0 deletions
|
|
@ -76,6 +76,7 @@ support-files = file_animations_with_disabled_properties.html
|
||||||
[test_nesting_flattening_parser_edges.html]
|
[test_nesting_flattening_parser_edges.html]
|
||||||
[test_nesting_flattening_recovery.html]
|
[test_nesting_flattening_recovery.html]
|
||||||
[test_box_size_keywords.html]
|
[test_box_size_keywords.html]
|
||||||
|
[test_border_width_rounding.html]
|
||||||
[test_bug73586.html]
|
[test_bug73586.html]
|
||||||
[test_css_math_functions.html]
|
[test_css_math_functions.html]
|
||||||
[test_bug74880.html]
|
[test_bug74880.html]
|
||||||
|
|
|
||||||
51
layout/style/test/test_border_width_rounding.html
Normal file
51
layout/style/test/test_border_width_rounding.html
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Test fractional border and outline width rounding</title>
|
||||||
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="display"></div>
|
||||||
|
<pre id="test">
|
||||||
|
<script class="testbody" type="text/javascript">
|
||||||
|
|
||||||
|
var display = document.getElementById("display");
|
||||||
|
|
||||||
|
var tests = [
|
||||||
|
["0px", "0px"],
|
||||||
|
["0.1px", "1px"],
|
||||||
|
["0.25px", "1px"],
|
||||||
|
["0.5px", "1px"],
|
||||||
|
["0.9px", "1px"],
|
||||||
|
["1px", "1px"],
|
||||||
|
["1.25px", "1px"],
|
||||||
|
["1.5px", "1px"],
|
||||||
|
["2px", "2px"],
|
||||||
|
["2.75px", "2px"],
|
||||||
|
["2.999px", "2px"],
|
||||||
|
];
|
||||||
|
|
||||||
|
function checkWidth(property, setupProperty, setupValue) {
|
||||||
|
tests.forEach(function(test) {
|
||||||
|
var specified = test[0];
|
||||||
|
var expected = test[1];
|
||||||
|
var div = document.createElement("div");
|
||||||
|
div.style[setupProperty] = setupValue;
|
||||||
|
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");
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue