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

Side by Side Diff: LayoutTests/fast/events/hit-test-culled_inline.html

Issue 685963002: We need to account for culled inline parents of the hit-tested nodes.(Reland) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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>
pdr. 2014/12/10 07:16:19 Please rename this test hit-test-culled-inline.htm
Miyoung Shin(g) 2014/12/12 14:46:57 Ok. I will rethink which of name is proper.
2 <style type="text/css">
3 input, em { cursor: pointer; margin-right: 100px; }
4 label, span { cursor: pointer; background: transparent; }
5 </style>
6 <script src="../../resources/js-test.js"></script>
7 <div><label id="clickme1" for="checkbox"><input id="checkbox" type="checkbox">Cl ick the empty area on the left</input></label></div>
8 <div><span id="clickme2"><em id="em">Click the empty area</em><em>in middle</em> </span></div>
9 <p id="description"></p>
10 <div id="console"></div>
11 <script>
12 description('Click event should be fired when it occurs within culled inline .');
13 var parent;
14 var gotClick;
15 function hitTest(id) {
16 var element = document.getElementById(id);
17 parent = element.parentElement;
18 // the x, y coordinates on margin of element
19 x = element.offsetLeft + element.offsetWidth + 10;
20 y = element.offsetTop + element.offsetHeight / 2;
21
22 shouldBeEqualToString('document.elementFromPoint(x, y).id', parent.id);
23
24 if (window.eventSender) {
25 gotClick = false;
26 parent.addEventListener('click', function(e) {
27 debug(parent.nodeName + ' that is a parent of ' + element.nodeNa me + ' is clicked.');
28 gotClick = true;
29 });
30 eventSender.mouseMoveTo(x, y);
31 eventSender.mouseDown();
32 eventSender.mouseUp();
33 shouldBeTrue('gotClick');
34 }
35 debug('');
36 }
37
38 hitTest('checkbox');
39 hitTest('em');
40
41 if (window.eventSender)
42 shouldBeTrue('document.getElementById("checkbox").checked');
43 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698