| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>onauxclick</title> | 2 <title>onauxclick</title> |
| 3 <link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me"> | 3 <link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me"> |
| 4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#handler-onauxclic
k"> | 4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#handler-onauxclic
k"> |
| 5 <script src="/resources/testharness.js"></script> | 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> | 6 <script src="/resources/testharnessreport.js"></script> |
| 7 | 7 |
| 8 <div id="auxclickme1" onauxclick="window.auxClick1Happened = true;"></div> | 8 <div id="auxclickme1" onauxclick="window.auxClick1Happened = true;"></div> |
| 9 <div id="auxclickme2" onauxclick="window.auxClick2Happened = true;"></div> | 9 <div id="auxclickme2" onauxclick="window.auxClick2Happened = true;"></div> |
| 10 | 10 |
| 11 <script> | 11 <script> |
| 12 "use strict"; | 12 "use strict"; |
| 13 window.auxClick1Happened = false; | 13 window.auxClick1Happened = false; |
| 14 window.auxClick2Happened = false; | 14 window.auxClick2Happened = false; |
| 15 | 15 |
| 16 test(() => { | 16 test(() => { |
| 17 for (const location of [window, HTMLElement.prototype, SVGElement.prototype, D
ocument.prototype]) { | 17 for (var location of [window, HTMLElement.prototype, SVGElement.prototype, Doc
ument.prototype]) { |
| 18 assert_true(location.hasOwnProperty("onauxclick"), | 18 assert_true(location.hasOwnProperty("onauxclick"), |
| 19 `${location.constructor.name} has an own property named "onauxclick"`); | 19 `${location.constructor.name} has an own property named "onauxclick"`); |
| 20 } | 20 } |
| 21 }, "onauxclick is on the appropriate locations for GlobalEventHandlers"); | 21 }, "onauxclick is on the appropriate locations for GlobalEventHandlers"); |
| 22 | 22 |
| 23 test(() => { | 23 test(() => { |
| 24 const htmlElement = document.createElement("span"); | 24 const htmlElement = document.createElement("span"); |
| 25 const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "g")
; | 25 const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "g")
; |
| 26 | 26 |
| 27 for (const location of [window, htmlElement, svgElement, document]) { | 27 for (var location of [window, htmlElement, svgElement, document]) { |
| 28 assert_equals(location.onauxclick, null, | 28 assert_equals(location.onauxclick, null, |
| 29 `The default value of the property is null for a ${location.constructor.na
me} instance`); | 29 `The default value of the property is null for a ${location.constructor.na
me} instance`); |
| 30 } | 30 } |
| 31 }, "The default value of onauxclick is always null"); | 31 }, "The default value of onauxclick is always null"); |
| 32 | 32 |
| 33 test(() => { | 33 test(() => { |
| 34 const element = document.querySelector("#auxclickme1"); | 34 const element = document.querySelector("#auxclickme1"); |
| 35 const compiledHandler = element.onauxclick; | 35 const compiledHandler = element.onauxclick; |
| 36 | 36 |
| 37 assert_equals(typeof compiledHandler, "function", "The onauxclick property mus
t be a function"); | 37 assert_equals(typeof compiledHandler, "function", "The onauxclick property mus
t be a function"); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 49 test(() => { | 49 test(() => { |
| 50 const element = document.createElement("meta"); | 50 const element = document.createElement("meta"); |
| 51 element.onauxclick = e => { | 51 element.onauxclick = e => { |
| 52 assert_equals(e.currentTarget, element, "The event must be fired at the <met
a> element"); | 52 assert_equals(e.currentTarget, element, "The event must be fired at the <met
a> element"); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 element.dispatchEvent(new Event("auxclick")); | 55 element.dispatchEvent(new Event("auxclick")); |
| 56 }, "dispatching an auxclick event must trigger element.onauxclick"); | 56 }, "dispatching an auxclick event must trigger element.onauxclick"); |
| 57 | 57 |
| 58 </script> | 58 </script> |
| OLD | NEW |