Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=656379 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 656379</title> |
michael@0 | 8 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | <style> |
michael@0 | 12 | input[type="button"]:hover { color: green; } |
michael@0 | 13 | </style> |
michael@0 | 14 | </head> |
michael@0 | 15 | <body> |
michael@0 | 16 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=656379">Mozilla Bug 656379</a> |
michael@0 | 17 | <p id="display"> |
michael@0 | 18 | <label for="button1" id="label1">Label 1</label> |
michael@0 | 19 | <input type="button" id="button1" value="Button 1"> |
michael@0 | 20 | <label> |
michael@0 | 21 | <span id="label2">Label 2</span> |
michael@0 | 22 | <input type="button" id="button2" value="Button 2"> |
michael@0 | 23 | </label> |
michael@0 | 24 | </p> |
michael@0 | 25 | <div id="content" style="display: none"> |
michael@0 | 26 | |
michael@0 | 27 | </div> |
michael@0 | 28 | <pre id="test"> |
michael@0 | 29 | <script type="application/javascript;version=1.8"> |
michael@0 | 30 | |
michael@0 | 31 | /** Test for Bug 656379 **/ |
michael@0 | 32 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 33 | function tests() { |
michael@0 | 34 | synthesizeMouseAtCenter($("label1"), { type: "mousemove" }); |
michael@0 | 35 | yield undefined; |
michael@0 | 36 | is($("button1").mozMatchesSelector(":hover"), true, |
michael@0 | 37 | "Button 1 should be hovered after mousemove over label1"); |
michael@0 | 38 | is($("label1").mozMatchesSelector(":hover"), true, |
michael@0 | 39 | "Label 1 should be hovered after mousemove over label1"); |
michael@0 | 40 | is($("button2").mozMatchesSelector(":hover"), false, |
michael@0 | 41 | "Button 2 should not be hovered after mousemove over label1"); |
michael@0 | 42 | is($("label2").mozMatchesSelector(":hover"), false, |
michael@0 | 43 | "Label 2 should not be hovered after mousemove over label1"); |
michael@0 | 44 | synthesizeMouseAtCenter($("button2"), { type: "mousemove" }); |
michael@0 | 45 | yield undefined; |
michael@0 | 46 | is($("button1").mozMatchesSelector(":hover"), false, |
michael@0 | 47 | "Button 1 should not be hovered after mousemove over button2"); |
michael@0 | 48 | is($("label1").mozMatchesSelector(":hover"), false, |
michael@0 | 49 | "Label 1 should not be hovered after mousemove over button2"); |
michael@0 | 50 | is($("button2").mozMatchesSelector(":hover"), true, |
michael@0 | 51 | "Button 2 should be hovered after mousemove over button2"); |
michael@0 | 52 | is($("label2").mozMatchesSelector(":hover"), false, |
michael@0 | 53 | "Label 2 should not be hovered after mousemove over label2"); |
michael@0 | 54 | synthesizeMouseAtCenter($("label2"), { type: "mousemove" }); |
michael@0 | 55 | yield undefined; |
michael@0 | 56 | is($("button1").mozMatchesSelector(":hover"), false, |
michael@0 | 57 | "Button 1 should not be hovered after mousemove over label2"); |
michael@0 | 58 | is($("label1").mozMatchesSelector(":hover"), false, |
michael@0 | 59 | "Label 1 should not be hovered after mousemove over label2"); |
michael@0 | 60 | is($("button2").mozMatchesSelector(":hover"), true, |
michael@0 | 61 | "Button 2 should be hovered after mousemove over label2"); |
michael@0 | 62 | is($("label2").mozMatchesSelector(":hover"), true, |
michael@0 | 63 | "Label 2 should be hovered after mousemove over label2"); |
michael@0 | 64 | SimpleTest.finish(); |
michael@0 | 65 | } |
michael@0 | 66 | |
michael@0 | 67 | function executeTests() { |
michael@0 | 68 | var testYielder = tests(); |
michael@0 | 69 | function execNext() { |
michael@0 | 70 | try { |
michael@0 | 71 | testYielder.next(); |
michael@0 | 72 | SimpleTest.executeSoon(execNext); |
michael@0 | 73 | } catch(e) {} |
michael@0 | 74 | } |
michael@0 | 75 | execNext(); |
michael@0 | 76 | } |
michael@0 | 77 | |
michael@0 | 78 | SimpleTest.waitForFocus(executeTests); |
michael@0 | 79 | |
michael@0 | 80 | </script> |
michael@0 | 81 | </pre> |
michael@0 | 82 | </body> |
michael@0 | 83 | </html> |