Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Element / client-rect-list-argument.html
blob644642a72900a5b2fd1061c04dbfe57abb793f68
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <link rel="help" href="http://dev.w3.org/csswg/cssom-view/#dom-clientrectlist-item">
5 <script src="../../../resources/js-test.js"></script>
6 <style>
7 #testArea {
8 width: 300px;
10 #inner {
11 width: 200px;
12 height: 200px;
14 .testBox {
15 background-color: green;
17 </style>
18 </head>
19 <body>
20 <div id="testArea">
21 <p>14. Block in inline</p> <span id="testElement" class="testBox">Lorem<div id="inner"></div>ipsum</span>
22 </div>
23 <script>
24 description("Tests that the ClientRectList.item() argument is correctly validated.");
26 var clientRects = document.getElementById("testElement").getClientRects();
27 shouldBe("clientRects.__proto__", "ClientRectList.prototype");
29 shouldBe("clientRects.length", "3");
30 shouldNotBe("clientRects.item(0)", "null");
31 shouldNotBe("clientRects.item(1)", "null");
32 shouldNotBe("clientRects.item(2)", "null");
33 shouldThrow("clientRects.item()", '"TypeError: Failed to execute \'item\' on \'ClientRectList\': 1 argument required, but only 0 present."');
34 shouldBe("clientRects.item(-4294967294)", "clientRects.item(2)"); // -4294967294 wraps to 2.
36 // According to the specification, we should throw an IndexSizeError exception when index is
37 // greater than the number of ClientRect objects associated with the object.
38 // However, we currently just return null like Firefox 22.
39 shouldBeNull("clientRects.item(3)");
40 shouldBeNull("clientRects.item(999)");
41 shouldBeNull("clientRects.item(-1)");
43 </script>
44 </body>
45 </html>