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

Unified Diff: LayoutTests/fast/events/event-on-culled_inline.html

Issue 947793002: Reland "We need to account for culled inline parents of hit-tested nodes" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/events/event-on-culled_inline.html
diff --git a/LayoutTests/fast/events/event-on-culled_inline.html b/LayoutTests/fast/events/event-on-culled_inline.html
new file mode 100644
index 0000000000000000000000000000000000000000..d9b9b881f349e4f9fb954cfc7b928c76ef7b63b3
--- /dev/null
+++ b/LayoutTests/fast/events/event-on-culled_inline.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<style type="text/css">
+input, em { cursor: pointer; margin-right: 100px; }
+label, span { cursor: pointer; background: transparent; }
+</style>
+<script src="../../resources/js-test.js"></script>
+<div><label id="clickme1" for="checkbox"><input id="checkbox" type="checkbox">Click the empty area on the left</input></label></div>
+<div><span id="clickme2"> <em id="em">Click the empty area</em><em>in middle</em></span></div>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+ description('Click event should be fired when it occurs within culled inline.');
+ var parent;
+ var gotClick;
+ function hitTest(id) {
+ var element = document.getElementById(id);
+ parent = element.parentElement;
+ // the x, y coordinates on margin of element
+ x = element.offsetLeft + element.offsetWidth + 10;
+ y = element.offsetTop + element.offsetHeight / 2;
+
+ shouldBeEqualToString('document.elementFromPoint(x, y).id', parent.id);
+
+ if (window.eventSender) {
+ gotClick = false;
+ parent.addEventListener('click', function(e) {
+ debug(parent.nodeName + ' that is a parent of ' + element.nodeName + ' is clicked.');
+ gotClick = true;
+ });
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ shouldBeTrue('gotClick');
+ }
+ debug('');
+ }
+
+ hitTest('checkbox');
+ hitTest('em');
+
+ if (window.eventSender)
+ shouldBeTrue('document.getElementById("checkbox").checked');
+</script>

Powered by Google App Engine
This is Rietveld 408576698