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

Unified Diff: LayoutTests/fast/events/mouseenter-mouseleave-capture.html

Issue 18836002: Implement 'mouseenter' and 'mouseleave' from DOM Level 3 Events. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: new tests + esprehn is smart. Created 7 years, 5 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/mouseenter-mouseleave-capture.html
diff --git a/LayoutTests/fast/events/mouseenter-mouseleave-capture.html b/LayoutTests/fast/events/mouseenter-mouseleave-capture.html
new file mode 100644
index 0000000000000000000000000000000000000000..db2d19b4a6e454bb00d896fbf89e2c2986324292
--- /dev/null
+++ b/LayoutTests/fast/events/mouseenter-mouseleave-capture.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src="../js/resources/js-test-pre.js"></script>
+ <script>
+ window.jsTestIsAsync = true;
+
+ document.addEventListener('DOMContentLoaded', function () {
+ document.body.addEventListener('mouseenter', handleEvent, true);
+ document.body.addEventListener('mouseleave', handleEvent, true);
+
+ if (window.testRunner) {
+ eventSender.mouseMoveTo(1, 1);
+ eventSender.mouseMoveTo(90,140);
+ debug("// Entering #outer");
+ eventSender.mouseMoveTo(110,140);
+ debug("// Entering #inner1");
+ eventSender.mouseMoveTo(130,140);
+ debug("// Entering #inner3 (and therefore also #inner2)");
+ eventSender.mouseMoveTo(170,140);
+ debug("// Leaving #inner3 and #inner2, but not #outer");
+ eventSender.mouseMoveTo(180,140);
+ debug("// Leaving #outer");
+ eventSender.mouseMoveTo(210,140);
+ }
+
+ finishJSTest();
+ });
+
+ function handleEvent(e) {
+ var target = e.target ? e.target : e.srcElement;
+ if (target.id && target.id != "console")
+ debug(e.type + " on " + target.id);
+ }
+ </script>
+ <script src="../js/resources/js-test-post.js"></script>
+
+ <style>
+ #outer {
+ background: blue;
+ height: 100px;
+ left: 100px;
+ position: absolute;
+ top: 100px;
+ width: 100px;
+ }
+
+ #inner1 {
+ background: red;
+ height: 50px;
+ left: 20px;
+ position: absolute;
+ top: 20px;
+ width: 50px;
+ }
+
+ #inner2 {
+ background: yellow;
+ height: 20px;
+ left: 60px;
+ position: absolute;
+ top: 30px;
+ width: 20px;
+ }
+
+ #inner3 {
+ background-color: green;
+ height: 10px;
+ margin: 5px;
+ width: 10px;
+ }
+ </style>
+</head>
+<body>
+ <div id="outer">
+ <div id="inner1"></div>
+ <div id="inner2">
+ <div id="inner3"></div>
+ </div>
+ </div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698