Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / annotated-regions.html
blob9b67e519fd164754e16e01bb5587e6e4d5c93b67
1 <html>
2 <head>
3 <style>
4 .drag {
5 -webkit-app-region: drag;
8 .nodrag {
9 -webkit-app-region: no-drag;
12 .transform {
13 transform: scale(0.5, 0.5);
16 #draggable {
17 position: absolute;
18 top: 10px;
19 left: 20px;
20 width: 100px;
21 height: 60px;
22 background-color: green;
25 #nondraggable {
26 left: 0px;
27 top: 0px;
28 width: 60px;
29 height: 20px;
30 background-color: blue;
32 </style>
33 </head>
35 <script src="../../resources/js-test.js"></script>
36 <script>
37 description("This tests that transformed annotated regions have the correct bounds.");
38 function getBoundsFromClientRectList(rects) {
39 if (rects && rects.length == 1)
40 return rects[0].left + "," + rects[0].top + "+" + rects[0].width + "x" + rects[0].height;
41 return '';
44 function draggableRegions() {
45 return getBoundsFromClientRectList(window.internals.draggableRegions(document));
48 function nonDraggableRegions() {
49 return getBoundsFromClientRectList(window.internals.nonDraggableRegions(document));
52 function startTest() {
53 shouldBe("draggableRegions()", "''");
54 shouldBe("nonDraggableRegions()", "''");
56 draggable.classList.add("drag");
57 shouldBe("draggableRegions()", "'20,10+100x60'");
58 shouldBe("nonDraggableRegions()", "''");
60 draggable.classList.add('transform');
61 shouldBe("draggableRegions()", "'45,25+50x30'");
62 shouldBe("nonDraggableRegions()", "''");
64 nondraggable.classList.add('nodrag');
65 shouldBe("draggableRegions()", "'45,25+50x30'");
66 shouldBe("nonDraggableRegions()", "'45,25+30x10'");
68 draggable.classList.remove('transform');
69 shouldBe("draggableRegions()", "'20,10+100x60'");
70 shouldBe("nonDraggableRegions()", "'20,10+60x20'");
72 finishJSTest();
75 window.jsTestIsAsync = true;
76 window.onload = startTest;
77 </script>
79 <body>
80 <div id="draggable">
81 <div id="nondraggable"></div>
82 </div>
83 <p id="description"></p>
84 <div id="console"></div>
85 </body>
86 </html>