Changeset 230664 in webkit
- Timestamp:
- Apr 15, 2018 6:01:18 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r230632 r230664 1 2018-04-15 Chris Dumez <cdumez@apple.com> 2 3 Change Event's returnValue so it doesn't expose a new primitive 4 https://bugs.webkit.org/show_bug.cgi?id=184415 5 6 Reviewed by Darin Adler. 7 8 Import test coverage from https://github.com/w3c/web-platform-tests/pull/10258. 9 10 * web-platform-tests/dom/events/AddEventListenerOptions-passive-expected.txt: 11 * web-platform-tests/dom/events/AddEventListenerOptions-passive.html: 12 * web-platform-tests/dom/events/Event-constructors.html: 13 * web-platform-tests/dom/events/Event-defaultPrevented-after-dispatch-expected.txt: 14 * web-platform-tests/dom/events/Event-defaultPrevented-after-dispatch.html: 15 * web-platform-tests/dom/events/Event-defaultPrevented-expected.txt: 16 * web-platform-tests/dom/events/Event-defaultPrevented.html: 17 * web-platform-tests/dom/events/Event-dispatch-click.html: 18 * web-platform-tests/dom/events/Event-dispatch-detached-click.html: 19 * web-platform-tests/dom/events/Event-dispatch-other-document.html: 20 * web-platform-tests/dom/events/Event-initEvent.html: 21 * web-platform-tests/dom/events/Event-returnValue-expected.txt: Added. 22 * web-platform-tests/dom/events/Event-returnValue.html: Added. 23 * web-platform-tests/dom/events/EventListener-handleEvent.html: 24 * web-platform-tests/dom/events/EventTarget-dispatchEvent-returnvalue-expected.txt: 25 * web-platform-tests/dom/events/EventTarget-dispatchEvent-returnvalue.html: 26 * web-platform-tests/dom/events/w3c-import.log: 27 * web-platform-tests/dom/interfaces-expected.txt: 28 * web-platform-tests/interfaces/dom.idl: 29 1 30 2018-04-12 Antoine Quint <graouts@apple.com> 2 31 -
trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker-expected.txt
r230285 r230664 21 21 PASS ProcessingInstruction interface: existence and properties of interface object 22 22 PASS Comment interface: existence and properties of interface object 23 PASS AbstractRange interface: existence and properties of interface object 24 PASS StaticRange interface: existence and properties of interface object 23 25 PASS Range interface: existence and properties of interface object 24 26 PASS NodeIterator interface: existence and properties of interface object -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/AddEventListenerOptions-passive-expected.txt
r201826 r230664 2 2 PASS Supports passive option on addEventListener only 3 3 PASS preventDefault should be ignored if-and-only-if the passive option is true 4 PASS passive behavior of one listener should be unaffeted by the presence of other listeners 4 PASS returnValue should be ignored if-and-only-if the passive option is true 5 PASS passive behavior of one listener should be unaffected by the presence of other listeners 5 6 PASS Equivalence of option values 6 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/AddEventListenerOptions-passive.html
r217225 r230664 56 56 }, "preventDefault should be ignored if-and-only-if the passive option is true"); 57 57 58 function testPassiveValueOnReturnValue(test, optionsValue, expectedDefaultPrevented) { 59 var defaultPrevented = undefined; 60 var handler = test.step_func(e => { 61 assert_false(e.defaultPrevented, "Event prematurely marked defaultPrevented"); 62 e.returnValue = false; 63 defaultPrevented = e.defaultPrevented; 64 }); 65 document.addEventListener('test', handler, optionsValue); 66 var uncanceled = document.body.dispatchEvent(new Event('test', {bubbles: true, cancelable: true})); 67 68 assert_equals(defaultPrevented, expectedDefaultPrevented, "Incorrect defaultPrevented for options: " + JSON.stringify(optionsValue)); 69 assert_equals(uncanceled, !expectedDefaultPrevented, "Incorrect return value from dispatchEvent"); 70 71 document.removeEventListener('test', handler, optionsValue); 72 } 73 74 async_test(t => { 75 testPassiveValueOnReturnValue(t, undefined, true); 76 testPassiveValueOnReturnValue(t, {}, true); 77 testPassiveValueOnReturnValue(t, {passive: false}, true); 78 testPassiveValueOnReturnValue(t, {passive: true}, false); 79 testPassiveValueOnReturnValue(t, {passive: 0}, true); 80 testPassiveValueOnReturnValue(t, {passive: 1}, false); 81 t.done(); 82 }, "returnValue should be ignored if-and-only-if the passive option is true"); 83 58 84 function testPassiveWithOtherHandlers(optionsValue, expectedDefaultPrevented) { 59 85 var handlerInvoked1 = false; … … 82 108 testPassiveWithOtherHandlers({passive: false}, true); 83 109 testPassiveWithOtherHandlers({passive: true}, false); 84 }, "passive behavior of one listener should be unaffe ted by the presence of other listeners");110 }, "passive behavior of one listener should be unaffected by the presence of other listeners"); 85 111 86 112 function testOptionEquivalence(optionValue1, optionValue2, expectedEquality) { -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-constructors.html
r217225 r230664 20 20 assert_equals(ev.type, "") 21 21 assert_equals(ev.target, null) 22 assert_equals(ev.srcElement, null) 22 23 assert_equals(ev.currentTarget, null) 23 24 assert_equals(ev.eventPhase, Event.NONE) … … 25 26 assert_equals(ev.cancelable, false) 26 27 assert_equals(ev.defaultPrevented, false) 28 assert_equals(ev.returnValue, true) 27 29 assert_equals(ev.isTrusted, false) 28 30 assert_true(ev.timeStamp > 0) … … 33 35 assert_equals(ev.type, "test") 34 36 assert_equals(ev.target, null) 37 assert_equals(ev.srcElement, null) 35 38 assert_equals(ev.currentTarget, null) 36 39 assert_equals(ev.eventPhase, Event.NONE) … … 38 41 assert_equals(ev.cancelable, false) 39 42 assert_equals(ev.defaultPrevented, false) 43 assert_equals(ev.returnValue, true) 40 44 assert_equals(ev.isTrusted, false) 41 45 assert_true(ev.timeStamp > 0) -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-defaultPrevented-after-dispatch-expected.txt
r200309 r230664 1 1 2 PASS Event.defaultPrevented is not reset after dipatchEvent() 2 PASS Default prevention via preventDefault 3 PASS Default prevention via returnValue 3 4 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-defaultPrevented-after-dispatch.html
r217225 r230664 1 1 <!DOCTYPE html> 2 2 <meta charset=utf-8> 3 <title>Event.defaultPrevented is not reset after di patchEvent()</title>3 <title>Event.defaultPrevented is not reset after dispatchEvent()</title> 4 4 <script src="/resources/testharness.js"></script> 5 5 <script src="/resources/testharnessreport.js"></script> … … 23 23 assert_true(evt.defaultPrevented, "after dispatch"); 24 24 assert_equals(evt.target, TARGET); 25 }); 25 assert_equals(evt.srcElement, TARGET); 26 }, "Default prevention via preventDefault"); 27 28 test(function() { 29 var EVENT = "foo"; 30 var TARGET = document.getElementById("target"); 31 var evt = document.createEvent("Event"); 32 evt.initEvent(EVENT, true, true); 33 34 TARGET.addEventListener(EVENT, this.step_func(function(e) { 35 e.returnValue = false; 36 assert_true(e.defaultPrevented, "during dispatch"); 37 }), true); 38 TARGET.dispatchEvent(evt); 39 40 assert_true(evt.defaultPrevented, "after dispatch"); 41 assert_equals(evt.target, TARGET); 42 assert_equals(evt.srcElement, TARGET); 43 }, "Default prevention via returnValue"); 26 44 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-defaultPrevented-expected.txt
r202471 r230664 3 3 PASS initEvent should work correctly (not cancelable). 4 4 PASS preventDefault() should not change defaultPrevented if cancelable is false. 5 PASS returnValue should not change defaultPrevented if cancelable is false. 5 6 PASS initEvent should work correctly (cancelable). 6 7 PASS preventDefault() should change defaultPrevented if cancelable is true. 8 PASS returnValue should change defaultPrevented if cancelable is true. 7 9 PASS initEvent should unset defaultPrevented. 8 10 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-defaultPrevented.html
r217225 r230664 23 23 }, "preventDefault() should not change defaultPrevented if cancelable is false."); 24 24 test(function() { 25 assert_equals(ev.cancelable, false, "cancelable (before)"); 26 ev.returnValue = false; 27 assert_equals(ev.cancelable, false, "cancelable (after)"); 28 assert_equals(ev.defaultPrevented, false, "defaultPrevented"); 29 }, "returnValue should not change defaultPrevented if cancelable is false."); 30 test(function() { 25 31 ev.initEvent("foo", true, true); 26 32 assert_equals(ev.bubbles, true, "bubbles"); … … 35 41 }, "preventDefault() should change defaultPrevented if cancelable is true."); 36 42 test(function() { 43 assert_equals(ev.cancelable, true, "cancelable (before)"); 44 ev.returnValue = false; 45 assert_equals(ev.cancelable, true, "cancelable (after)"); 46 assert_equals(ev.defaultPrevented, true, "defaultPrevented"); 47 }, "returnValue should change defaultPrevented if cancelable is true."); 48 test(function() { 37 49 ev.initEvent("foo", true, true); 38 50 assert_equals(ev.bubbles, true, "bubbles"); -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-click.html
r220772 r230664 95 95 input.onchange = t.step_func_done(function() { 96 96 assert_false(clickEvent.defaultPrevented) 97 assert_true(clickEvent.returnValue) 97 98 assert_equals(clickEvent.eventPhase, 0) 98 99 assert_equals(clickEvent.currentTarget, null) 99 100 assert_equals(clickEvent.target, input) 101 assert_equals(clickEvent.srcElement, input) 100 102 assert_equals(clickEvent.composedPath().length, 0) 101 103 }) … … 111 113 finalTarget.onclick = t.step_func_done(function() { 112 114 assert_equals(clickEvent.target, finalTarget) 115 assert_equals(clickEvent.srcElement, finalTarget) 113 116 }) 114 117 input.onchange = t.step_func(function() { -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-detached-click.html
r217225 r230664 11 11 TARGET.addEventListener(EVENT, t.step_func(function(evt) { 12 12 assert_equals(evt.target, TARGET); 13 assert_equals(evt.srcElement, TARGET); 13 14 t.done(); 14 15 }), true); -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-other-document.html
r217225 r230664 13 13 called = true; 14 14 assert_equals(ev.target, element); 15 assert_equals(ev.srcElement, element); 15 16 })); 16 17 doc.body.appendChild(element); -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-initEvent.html
r217225 r230664 13 13 e.initEvent("type", bubbles, cancelable) 14 14 15 // Step 3.15 // Step 2. 16 16 // Stop (immediate) propagation flag is tested later 17 17 assert_equals(e.defaultPrevented, false, "defaultPrevented") 18 assert_equals(e.returnValue, true, "returnValue") 19 // Step 3. 20 assert_equals(e.isTrusted, false, "isTrusted") 18 21 // Step 4. 19 assert_equals(e.isTrusted, false, "isTrusted") 22 assert_equals(e.target, null, "target") 23 assert_equals(e.srcElement, null, "srcElement") 20 24 // Step 5. 21 assert_equals(e.t arget, null, "target")25 assert_equals(e.type, "type", "type") 22 26 // Step 6. 23 assert_equals(e. type, "type", "type")27 assert_equals(e.bubbles, bubbles, "bubbles") 24 28 // Step 7. 25 assert_equals(e.bubbles, bubbles, "bubbles")26 // Step 8.27 29 assert_equals(e.cancelable, cancelable, "cancelable") 28 30 }, "Properties of initEvent(type, " + bubbles + ", " + cancelable + ")") -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent.html
r217225 r230664 28 28 assert_equals(evt.type, event); 29 29 assert_equals(evt.target, target); 30 assert_equals(evt.srcElement, target); 30 31 assert_equals(that, event_listener); 31 32 }); -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventTarget-dispatchEvent-returnvalue-expected.txt
r189471 r230664 1 1 2 PASS Return value of EventTarget.dispatchEvent. 2 PASS Return value of EventTarget.dispatchEvent() affected by preventDefault(). 3 PASS Return value of EventTarget.dispatchEvent() affected by returnValue. 3 4 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventTarget-dispatchEvent-returnvalue.html
r217225 r230664 4 4 <link rel="help" href="https://dom.spec.whatwg.org/#concept-event-dispatch"> 5 5 <link rel="help" href="https://dom.spec.whatwg.org/#dom-event-preventdefault"> 6 <link rel="help" href="https://dom.spec.whatwg.org/#dom-event-returnvalue"> 6 7 <link rel="help" href="https://dom.spec.whatwg.org/#dom-event-defaultprevented"> 7 8 <script src="/resources/testharness.js"></script> … … 26 27 var parent = document.getElementById("parent"); 27 28 var default_prevented; 29 var return_value; 28 30 29 31 parent.addEventListener(event_type, function(e) {}, true); … … 31 33 evt.preventDefault(); 32 34 default_prevented = evt.defaultPrevented; 35 return_value = evt.returnValue; 33 36 }, true); 34 37 target.addEventListener(event_type, function(e) {}, true); … … 40 43 assert_false(target.dispatchEvent(evt)); 41 44 assert_true(default_prevented); 42 }, "Return value of EventTarget.dispatchEvent."); 45 assert_false(return_value); 46 }, "Return value of EventTarget.dispatchEvent() affected by preventDefault()."); 47 48 test(function() { 49 var event_type = "foo"; 50 var target = document.getElementById("target"); 51 var parent = document.getElementById("parent"); 52 var default_prevented; 53 var return_value; 54 55 parent.addEventListener(event_type, function(e) {}, true); 56 target.addEventListener(event_type, function(e) { 57 evt.returnValue = false; 58 default_prevented = evt.defaultPrevented; 59 return_value = evt.returnValue; 60 }, true); 61 target.addEventListener(event_type, function(e) {}, true); 62 63 var evt = document.createEvent("Event"); 64 evt.initEvent(event_type, true, true); 65 66 assert_true(parent.dispatchEvent(evt)); 67 assert_false(target.dispatchEvent(evt)); 68 assert_true(default_prevented); 69 assert_false(return_value); 70 }, "Return value of EventTarget.dispatchEvent() affected by returnValue."); 43 71 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/w3c-import.log
r229544 r230664 43 43 /LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-initEvent.html 44 44 /LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-propagation.html 45 /LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-returnValue.html 45 46 /LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors.html 46 47 /LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-timestamp-high-resolution.html -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt
r230285 r230664 25 25 PASS Event interface: attribute target 26 26 PASS Unscopable handled correctly for target property on Event 27 PASS Event interface: attribute srcElement 28 PASS Unscopable handled correctly for srcElement property on Event 27 29 PASS Event interface: attribute currentTarget 28 30 PASS Unscopable handled correctly for currentTarget property on Event … … 45 47 PASS Event interface: attribute cancelable 46 48 PASS Unscopable handled correctly for cancelable property on Event 49 PASS Event interface: attribute returnValue 50 PASS Unscopable handled correctly for returnValue property on Event 47 51 PASS Event interface: operation preventDefault() 48 52 PASS Unscopable handled correctly for preventDefault() on Event … … 57 61 PASS Event interface: document.createEvent("Event") must inherit property "type" with the proper type 58 62 PASS Event interface: document.createEvent("Event") must inherit property "target" with the proper type 63 PASS Event interface: document.createEvent("Event") must inherit property "srcElement" with the proper type 59 64 PASS Event interface: document.createEvent("Event") must inherit property "currentTarget" with the proper type 60 65 PASS Event interface: document.createEvent("Event") must inherit property "NONE" with the proper type … … 67 72 PASS Event interface: document.createEvent("Event") must inherit property "bubbles" with the proper type 68 73 PASS Event interface: document.createEvent("Event") must inherit property "cancelable" with the proper type 74 PASS Event interface: document.createEvent("Event") must inherit property "returnValue" with the proper type 69 75 PASS Event interface: document.createEvent("Event") must inherit property "preventDefault()" with the proper type 70 76 PASS Event interface: document.createEvent("Event") must inherit property "defaultPrevented" with the proper type … … 77 83 PASS Event interface: new Event("foo") must inherit property "type" with the proper type 78 84 PASS Event interface: new Event("foo") must inherit property "target" with the proper type 85 PASS Event interface: new Event("foo") must inherit property "srcElement" with the proper type 79 86 PASS Event interface: new Event("foo") must inherit property "currentTarget" with the proper type 80 87 PASS Event interface: new Event("foo") must inherit property "NONE" with the proper type … … 87 94 PASS Event interface: new Event("foo") must inherit property "bubbles" with the proper type 88 95 PASS Event interface: new Event("foo") must inherit property "cancelable" with the proper type 96 PASS Event interface: new Event("foo") must inherit property "returnValue" with the proper type 89 97 PASS Event interface: new Event("foo") must inherit property "preventDefault()" with the proper type 90 98 PASS Event interface: new Event("foo") must inherit property "defaultPrevented" with the proper type … … 110 118 PASS Event interface: new CustomEvent("foo") must inherit property "type" with the proper type 111 119 PASS Event interface: new CustomEvent("foo") must inherit property "target" with the proper type 120 PASS Event interface: new CustomEvent("foo") must inherit property "srcElement" with the proper type 112 121 PASS Event interface: new CustomEvent("foo") must inherit property "currentTarget" with the proper type 113 122 PASS Event interface: new CustomEvent("foo") must inherit property "NONE" with the proper type … … 120 129 PASS Event interface: new CustomEvent("foo") must inherit property "bubbles" with the proper type 121 130 PASS Event interface: new CustomEvent("foo") must inherit property "cancelable" with the proper type 131 PASS Event interface: new CustomEvent("foo") must inherit property "returnValue" with the proper type 122 132 PASS Event interface: new CustomEvent("foo") must inherit property "preventDefault()" with the proper type 123 133 PASS Event interface: new CustomEvent("foo") must inherit property "defaultPrevented" with the proper type … … 1638 1648 PASS EventTarget interface: document.createComment("abc") must inherit property "dispatchEvent(Event)" with the proper type 1639 1649 PASS EventTarget interface: calling dispatchEvent(Event) on document.createComment("abc") with too few arguments must throw TypeError 1640 PASS Range interface: existence and properties of interface object 1650 FAIL AbstractRange interface: existence and properties of interface object assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1651 FAIL AbstractRange interface object length assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1652 FAIL AbstractRange interface object name assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1653 FAIL AbstractRange interface: existence and properties of interface prototype object assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1654 FAIL AbstractRange interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1655 FAIL AbstractRange interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1656 FAIL AbstractRange interface: attribute startContainer assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1657 PASS Unscopable handled correctly for startContainer property on AbstractRange 1658 FAIL AbstractRange interface: attribute startOffset assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1659 PASS Unscopable handled correctly for startOffset property on AbstractRange 1660 FAIL AbstractRange interface: attribute endContainer assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1661 PASS Unscopable handled correctly for endContainer property on AbstractRange 1662 FAIL AbstractRange interface: attribute endOffset assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1663 PASS Unscopable handled correctly for endOffset property on AbstractRange 1664 FAIL AbstractRange interface: attribute collapsed assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1665 PASS Unscopable handled correctly for collapsed property on AbstractRange 1666 FAIL StaticRange interface: existence and properties of interface object assert_own_property: should inherit from AbstractRange, but self has no such property expected property "AbstractRange" missing 1667 PASS StaticRange interface object length 1668 PASS StaticRange interface object name 1669 FAIL StaticRange interface: existence and properties of interface prototype object assert_own_property: should inherit from AbstractRange, but self has no such property expected property "AbstractRange" missing 1670 PASS StaticRange interface: existence and properties of interface prototype object's "constructor" property 1671 PASS StaticRange interface: existence and properties of interface prototype object's @@unscopables property 1672 FAIL Range interface: existence and properties of interface object assert_own_property: should inherit from AbstractRange, but self has no such property expected property "AbstractRange" missing 1641 1673 PASS Range interface object length 1642 1674 PASS Range interface object name 1643 PASS Range interface: existence and properties of interface prototype object 1675 FAIL Range interface: existence and properties of interface prototype object assert_own_property: should inherit from AbstractRange, but self has no such property expected property "AbstractRange" missing 1644 1676 PASS Range interface: existence and properties of interface prototype object's "constructor" property 1645 1677 PASS Range interface: existence and properties of interface prototype object's @@unscopables property 1646 PASS Range interface: attribute startContainer1647 PASS Unscopable handled correctly for startContainer property on Range1648 PASS Range interface: attribute startOffset1649 PASS Unscopable handled correctly for startOffset property on Range1650 PASS Range interface: attribute endContainer1651 PASS Unscopable handled correctly for endContainer property on Range1652 PASS Range interface: attribute endOffset1653 PASS Unscopable handled correctly for endOffset property on Range1654 PASS Range interface: attribute collapsed1655 PASS Unscopable handled correctly for collapsed property on Range1656 1678 PASS Range interface: attribute commonAncestorContainer 1657 1679 PASS Unscopable handled correctly for commonAncestorContainer property on Range … … 1707 1729 PASS Range must be primary interface of document.createRange() 1708 1730 PASS Stringification of document.createRange() 1709 PASS Range interface: document.createRange() must inherit property "startContainer" with the proper type1710 PASS Range interface: document.createRange() must inherit property "startOffset" with the proper type1711 PASS Range interface: document.createRange() must inherit property "endContainer" with the proper type1712 PASS Range interface: document.createRange() must inherit property "endOffset" with the proper type1713 PASS Range interface: document.createRange() must inherit property "collapsed" with the proper type1714 1731 PASS Range interface: document.createRange() must inherit property "commonAncestorContainer" with the proper type 1715 1732 PASS Range interface: document.createRange() must inherit property "setStart(Node, unsigned long)" with the proper type … … 1752 1769 PASS Range interface: document.createRange() must inherit property "intersectsNode(Node)" with the proper type 1753 1770 PASS Range interface: calling intersectsNode(Node) on document.createRange() with too few arguments must throw TypeError 1771 PASS AbstractRange interface: document.createRange() must inherit property "startContainer" with the proper type 1772 PASS AbstractRange interface: document.createRange() must inherit property "startOffset" with the proper type 1773 PASS AbstractRange interface: document.createRange() must inherit property "endContainer" with the proper type 1774 PASS AbstractRange interface: document.createRange() must inherit property "endOffset" with the proper type 1775 PASS AbstractRange interface: document.createRange() must inherit property "collapsed" with the proper type 1754 1776 PASS Range must be primary interface of detachedRange 1755 1777 PASS Stringification of detachedRange 1756 PASS Range interface: detachedRange must inherit property "startContainer" with the proper type1757 PASS Range interface: detachedRange must inherit property "startOffset" with the proper type1758 PASS Range interface: detachedRange must inherit property "endContainer" with the proper type1759 PASS Range interface: detachedRange must inherit property "endOffset" with the proper type1760 PASS Range interface: detachedRange must inherit property "collapsed" with the proper type1761 1778 PASS Range interface: detachedRange must inherit property "commonAncestorContainer" with the proper type 1762 1779 PASS Range interface: detachedRange must inherit property "setStart(Node, unsigned long)" with the proper type … … 1799 1816 PASS Range interface: detachedRange must inherit property "intersectsNode(Node)" with the proper type 1800 1817 PASS Range interface: calling intersectsNode(Node) on detachedRange with too few arguments must throw TypeError 1818 PASS AbstractRange interface: detachedRange must inherit property "startContainer" with the proper type 1819 PASS AbstractRange interface: detachedRange must inherit property "startOffset" with the proper type 1820 PASS AbstractRange interface: detachedRange must inherit property "endContainer" with the proper type 1821 PASS AbstractRange interface: detachedRange must inherit property "endOffset" with the proper type 1822 PASS AbstractRange interface: detachedRange must inherit property "collapsed" with the proper type 1801 1823 PASS NodeIterator interface: existence and properties of interface object 1802 1824 PASS NodeIterator interface object length -
trunk/LayoutTests/imported/w3c/web-platform-tests/interfaces/dom.idl
r229544 r230664 4 4 readonly attribute DOMString type; 5 5 readonly attribute EventTarget? target; 6 readonly attribute EventTarget? srcElement; 6 7 readonly attribute EventTarget? currentTarget; 7 8 … … 17 18 readonly attribute boolean bubbles; 18 19 readonly attribute boolean cancelable; 20 attribute boolean returnValue; 19 21 void preventDefault(); 20 22 readonly attribute boolean defaultPrevented; … … 441 443 442 444 443 [Constructor, 444 Exposed=Window] 445 interface Range { 445 [Exposed=Window] 446 interface AbstractRange { 446 447 readonly attribute Node startContainer; 447 448 readonly attribute unsigned long startOffset; … … 449 450 readonly attribute unsigned long endOffset; 450 451 readonly attribute boolean collapsed; 452 }; 453 454 [Exposed=Window] 455 interface StaticRange : AbstractRange { 456 }; 457 458 [Constructor, 459 Exposed=Window] 460 interface Range : AbstractRange { 451 461 readonly attribute Node commonAncestorContainer; 452 462 -
trunk/Source/WebCore/ChangeLog
r230658 r230664 1 2018-04-15 Chris Dumez <cdumez@apple.com> 2 3 Change Event's returnValue so it doesn't expose a new primitive 4 https://bugs.webkit.org/show_bug.cgi?id=184415 5 6 Reviewed by Darin Adler. 7 8 Update Event.returnValue setter to match the latest DOM specification after: 9 - https://github.com/whatwg/dom/pull/626 10 11 In particular, the returnValue setter is now a no-op if the new flag value 12 is true. If the input flag value is false, it only sets the 'canceled' flag 13 if the event is cancelable and the event’s in passive listener flag is unset. 14 15 Test: imported/w3c/web-platform-tests/dom/events/Event-returnValue.html 16 17 * dom/Event.cpp: 18 (WebCore::Event::setLegacyReturnValue): 19 (WebCore::Event::setCanceledFlagIfPossible): 20 (WebCore::Event::preventDefault): 21 * dom/Event.h: 22 1 23 2018-04-14 Thibault Saunier <tsaunier@igalia.com> 2 24 -
trunk/Source/WebCore/dom/Event.h
r228260 r230664 97 97 98 98 bool legacyReturnValue() const { return !m_wasCanceled; } 99 void setLegacyReturnValue(bool returnValue) { m_wasCanceled = !returnValue; }99 void setLegacyReturnValue(bool); 100 100 101 101 virtual EventInterface eventInterface() const { return EventInterfaceType; } … … 154 154 AtomicString m_type; 155 155 156 void setCanceledFlagIfPossible(); 157 156 158 bool m_isInitialized { false }; 157 159 bool m_canBubble { false }; … … 177 179 inline void Event::preventDefault() 178 180 { 181 setCanceledFlagIfPossible(); 182 } 183 184 inline void Event::setLegacyReturnValue(bool returnValue) 185 { 186 if (!returnValue) 187 setCanceledFlagIfPossible(); 188 } 189 190 // https://dom.spec.whatwg.org/#set-the-canceled-flag 191 inline void Event::setCanceledFlagIfPossible() 192 { 179 193 if (m_cancelable && !m_isExecutingPassiveEventListener) 180 194 m_wasCanceled = true;
Note: See TracChangeset
for help on using the changeset viewer.