Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / borders / border-width-percent.html
blob00a616370d45adb639efd78700c20edaeed92940
1 <!doctype html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p>This tests the border width property with percent values for HTML elements.</p>
8 <div id="console"></div>
9 <script>
10 function elementBorderWidth(element, borderValue, style)
12 var element = document.createElement(element);
13 if (borderValue !== undefined)
14 element.setAttribute("border", borderValue);
15 element.setAttribute("style", style);
16 element.setAttribute("width", "0");
17 document.body.appendChild(element);
18 var borderBoxWidth = element.offsetWidth;
19 document.body.removeChild(element);
20 return borderBoxWidth / 2;
23 function inputElementBorderWidth(elementType, borderValue, style)
25 var inputElement = document.createElement("input");
26 inputElement.setAttribute("type", elementType);
27 if (borderValue != undefined)
28 inputElement.setAttribute("border", borderValue);
29 inputElement.setAttribute("style", style);
30 inputElement.setAttribute("width", "0");
31 document.body.appendChild(inputElement);
32 var borderBoxWidth = inputElement.offsetWidth;
33 document.body.removeChild(inputElement);
34 return borderBoxWidth / 2;
37 shouldBe("elementBorderWidth('img', '10%')", "10");
38 shouldBe("elementBorderWidth('img', '-10%')", "0");
39 shouldBe("elementBorderWidth('img', ' +10%')", "10");
41 shouldBe("elementBorderWidth('img', 0, 'border-width: 10%')", "0");
42 shouldBe("elementBorderWidth('img', 0, 'border-width: -10%')", "0");
44 shouldBe("elementBorderWidth('object', '10%')", "10");
45 shouldBe("elementBorderWidth('object', '-10%')", "0");
46 shouldBe("elementBorderWidth('object', ' +10%')", "10");
48 shouldBe("elementBorderWidth('object', 0, 'border-width: 10%')", "0");
49 shouldBe("elementBorderWidth('object', 0, 'border-width: -10%')", "0");
51 shouldBe("inputElementBorderWidth('image', '10%')", "10");
52 shouldBe("inputElementBorderWidth('image', '-10%')", "0");
53 shouldBe("inputElementBorderWidth('image', ' +10%')", "10");
55 shouldBe("inputElementBorderWidth('image', 0, 'border-width: 10%')", "0");
56 shouldBe("inputElementBorderWidth('image', 0, 'border-width: -10%')", "0");
57 </script>
58 </body>
59 </html>