Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/borders/border-radius-hittest.html

Issue 1513663002: Include inner border radius in block hit testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Create hittesting directory for tests Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <script>
4 var x, y;
5
6 function test() {
7 var innerBox = document.getElementById('roundedBox');
8 var rect = innerBox.getBoundingClientRect();
9 x = rect.left;
10 y = rect.top;
11 // At top-left corner.
12 shouldBe("document.elementFromPoint(x + 5, y + 5).id", "'container'");
13 // At top-right corner.
14 shouldBe("document.elementFromPoint(x + 195, y + 5).id", "'container'");
15 // At bottom-left corner.
16 shouldBe("document.elementFromPoint(x + 5, y + 195).id", "'container'");
17 // At bottom-right corner.
18 shouldBe("document.elementFromPoint(x + 195, y + 195).id", "'container'");
19 // At the center.
20 shouldBe("document.elementFromPoint(x + 100, y + 100).id", "'roundedBox'");
21 }
22 </script>
23 <style>
24 #container {
25 width: 200px;
26 height: 200px;
27 background-color: lightgray;
28 }
29 #roundedBox {
30 width: 200px;
31 height: 200px;
32 border-radius: 50px;
33 background-color: lightgreen;
34 }
35 </style>
36 <body onload="test()">
37 <p>This test checks that div block should not get events on clicking outside the rounded border but within the bounding box of the block.</p>
38 <div id="container">
39 <div id="roundedBox"></div>
40 </div>
41 <div id="console"></div>
42 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698