5 <script src=
"../../../resources/js-test.js"></script>
10 description("Test to make sure border-image-slice is correctly parsed.")
12 var testContainer
= document
.createElement("div");
13 document
.body
.appendChild(testContainer
);
15 testContainer
.innerHTML
= '<div style="width:100px;height:100px"><div id="test">hello</div></div>';
17 e
= document
.getElementById('test');
18 computedStyle
= window
.getComputedStyle(e
, null);
20 var testValues
= [ "10", "30%", "10 10", "10 30%", "30% 30%", "10 10 10", "30% 10 10", "10 30% 10", "30% 30% 30% 10", "10 10 10 10", "30% 30% 30% 10", "30% 30% 30% 30%", "fill 30%", "fill 10", "fill 2 4 8% 16%", "30% fill", "10 fill", "2 4 8% 16% fill", "10 fill 10", "solid", "fill fill" ];
22 var expectedValues
= [ "'10'", "'30%'", "'10'", "'10 30%'", "'30%'", "'10'", "'30% 10 10'", "'10 30%'", "'30% 30% 30% 10'", "'10'", "'30% 30% 30% 10'", "'30%'", "'30% fill'", "'10 fill'", "'2 4 8% 16% fill'", "'30% fill'", "'10 fill'", "'2 4 8% 16% fill'", "'100%'", "'100%'", "'100%'" ];
24 for (i
= 0; i
< testValues
.length
; i
++) {
25 e
.style
.borderImageSlice
= "";
26 e
.style
.borderImageSlice
= testValues
[i
];
27 shouldBe("computedStyle.getPropertyValue('border-image-slice')", expectedValues
[i
]);
29 document
.body
.removeChild(testContainer
);