layout/base/tests/test_border_radius_hit_testing.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=595652
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <title>Test for Bug 595652</title>
michael@0 8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 10 </head>
michael@0 11 <body onload="run()">
michael@0 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=595652">Mozilla Bug 595652</a>
michael@0 13 <iframe src="border_radius_hit_testing_iframe.html" id="iframe" height="600" width="500" style="border:none"></iframe>
michael@0 14 <pre id="test">
michael@0 15 <script type="application/javascript">
michael@0 16
michael@0 17 /** Test for Bug 595652 **/
michael@0 18
michael@0 19 SimpleTest.waitForExplicitFinish();
michael@0 20
michael@0 21 function run() {
michael@0 22 var iframe = document.getElementById("iframe");
michael@0 23
michael@0 24 var doc = iframe.contentDocument;
michael@0 25
michael@0 26 var container = doc.body;
michael@0 27 var one = doc.getElementById("one");
michael@0 28 var two = doc.getElementById("two").firstChild;
michael@0 29
michael@0 30 //container.addEventListener("click", function(event) { alert(event.clientX + "," + event.clientY) }, false);
michael@0 31
michael@0 32 function check(x, y, expected_element, description)
michael@0 33 {
michael@0 34 is(doc.elementFromPoint(x, y), expected_element,
michael@0 35 "point (" + x + ", " + y + "): " + description);
michael@0 36 }
michael@0 37
michael@0 38 check(42, 6, container, "outside top left corner of #one");
michael@0 39 check(11, 21, container, "outside top left corner of #one");
michael@0 40 check(476, 10, container, "outside top right corner of #one");
michael@0 41 check(495, 28, container, "outside top right corner of #one");
michael@0 42 check(483, 197, container, "outside bottom right corner of #one");
michael@0 43 check(497, 175, container, "outside bottom right corner of #one");
michael@0 44 check(29, 182, container, "outside bottom left corner of #one");
michael@0 45 check(73, 198, container, "outside bottom left corner of #one");
michael@0 46
michael@0 47 check(95, 2, one, "inside top left corner of #one (curved quadrant)");
michael@0 48 check(16, 27, one, "inside top left corner of #one (curved quadrant)");
michael@0 49 check(87, 37, one, "inside top left corner of #one (curved quadrant)");
michael@0 50 check(465, 10, one, "inside top right corner of #one (curved quadrant)");
michael@0 51 check(489, 33, one, "inside top right corner of #one (curved quadrant)");
michael@0 52 check(443, 56, one, "inside top right corner of #one (curved quadrant)");
michael@0 53 check(493, 167, one, "inside bottom right corner of #one (curved quadrant)");
michael@0 54 check(476, 188, one, "inside bottom right corner of #one (curved quadrant)");
michael@0 55 check(462, 144, one, "inside bottom right corner of #one (curved quadrant)");
michael@0 56 check(74, 186, one, "inside bottom left corner of #one (curved quadrant)");
michael@0 57 check(16, 153, one, "inside bottom left corner of #one (curved quadrant)");
michael@0 58 check(112, 124, one, "inside bottom left corner of #one (curved quadrant)");
michael@0 59
michael@0 60 check(250, 1, one, "along top edge of #one");
michael@0 61 check(250, 199, one, "along bottom edge of #one");
michael@0 62 check(1, 100, one, "along left edge of #one");
michael@0 63 check(499, 100, one, "along right edge of #one");
michael@0 64 check(250, 100, one, "in center of #one");
michael@0 65
michael@0 66 check(2, 52, one, "inside top left corner of #one (left edge, outside ellipse)");
michael@0 67 check(82, 52, one, "inside top left corner of #one (left edge, inside ellipse)");
michael@0 68
michael@0 69 check(42, 306, container, "outside top left corner of #two");
michael@0 70 check(11, 321, container, "outside top left corner of #two");
michael@0 71 check(476, 310, container, "outside top right corner of #two");
michael@0 72 check(495, 328, container, "outside top right corner of #two");
michael@0 73 check(483, 497, container, "outside bottom right corner of #two");
michael@0 74 check(497, 475, container, "outside bottom right corner of #two");
michael@0 75 check(29, 482, container, "outside bottom left corner of #two");
michael@0 76 check(73, 498, container, "outside bottom left corner of #two");
michael@0 77
michael@0 78 check(95, 302, two, "inside top left corner of #two (curved quadrant)");
michael@0 79 check(16, 327, two, "inside top left corner of #two (curved quadrant)");
michael@0 80 check(87, 337, two, "inside top left corner of #two (curved quadrant)");
michael@0 81 check(465, 310, two, "inside top right corner of #two (curved quadrant)");
michael@0 82 check(489, 333, two, "inside top right corner of #two (curved quadrant)");
michael@0 83 check(443, 356, two, "inside top right corner of #two (curved quadrant)");
michael@0 84 check(493, 467, two, "inside bottom right corner of #two (curved quadrant)");
michael@0 85 check(476, 488, two, "inside bottom right corner of #two (curved quadrant)");
michael@0 86 check(462, 444, two, "inside bottom right corner of #two (curved quadrant)");
michael@0 87 check(74, 486, two, "inside bottom left corner of #two (curved quadrant)");
michael@0 88 check(16, 453, two, "inside bottom left corner of #two (curved quadrant)");
michael@0 89 check(112, 424, two, "inside bottom left corner of #two (curved quadrant)");
michael@0 90
michael@0 91 check(250, 301, two, "along top edge of #two");
michael@0 92 check(250, 499, two, "along bottom edge of #two");
michael@0 93 check(1, 400, two, "along left edge of #two");
michael@0 94 check(499, 400, two, "along right edge of #two");
michael@0 95 check(250, 400, two, "in center of #two");
michael@0 96
michael@0 97 check(2, 352, two, "inside top left corner of #two (left edge, outside ellipse)");
michael@0 98 check(82, 352, two, "inside top left corner of #two (left edge, inside ellipse)");
michael@0 99
michael@0 100 SimpleTest.finish();
michael@0 101 }
michael@0 102
michael@0 103 </script>
michael@0 104 </pre>
michael@0 105 </body>
michael@0 106 </html>

mercurial