mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #24144 - stephenmuss:event-src-element, r=jdm
Event src element <!-- Please describe your changes on the following line: --> This builds on top of the work done in https://github.com/servo/servo/pull/22918 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #22880 - [X] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24144) <!-- Reviewable:end -->
This commit is contained in:
commit
da237b4517
11 changed files with 6 additions and 74 deletions
|
@ -263,6 +263,11 @@ impl EventMethods for Event {
|
||||||
self.target.get()
|
self.target.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://dom.spec.whatwg.org/#dom-event-srcelement
|
||||||
|
fn GetSrcElement(&self) -> Option<DomRoot<EventTarget>> {
|
||||||
|
self.target.get()
|
||||||
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#dom-event-currenttarget
|
// https://dom.spec.whatwg.org/#dom-event-currenttarget
|
||||||
fn GetCurrentTarget(&self) -> Option<DomRoot<EventTarget>> {
|
fn GetCurrentTarget(&self) -> Option<DomRoot<EventTarget>> {
|
||||||
self.current_target.get()
|
self.current_target.get()
|
||||||
|
|
|
@ -11,6 +11,7 @@ interface Event {
|
||||||
[Pure]
|
[Pure]
|
||||||
readonly attribute DOMString type;
|
readonly attribute DOMString type;
|
||||||
readonly attribute EventTarget? target;
|
readonly attribute EventTarget? target;
|
||||||
|
readonly attribute EventTarget? srcElement;
|
||||||
readonly attribute EventTarget? currentTarget;
|
readonly attribute EventTarget? currentTarget;
|
||||||
|
|
||||||
const unsigned short NONE = 0;
|
const unsigned short NONE = 0;
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
[Event-constructors.html]
|
|
||||||
[Event constructors 2]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Event constructors 3]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
[Event-defaultPrevented-after-dispatch.html]
|
|
||||||
[Default prevention via preventDefault]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Default prevention via returnValue]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[Event-dispatch-detached-click.html]
|
|
||||||
[Click event can be dispatched to an element that is not in the document.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[Event-dispatch-other-document.html]
|
|
||||||
[Custom event on an element in another document]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
[Event-initEvent.html]
|
|
||||||
type: testharness
|
|
||||||
|
|
||||||
[Properties of initEvent(type, true, true)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Properties of initEvent(type, true, false)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Properties of initEvent(type, false, true)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Properties of initEvent(type, false, false)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -5,12 +5,8 @@
|
||||||
[throws if `handleEvent` is not callable]
|
[throws if `handleEvent` is not callable]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[calls `handleEvent` method of `EventListener`]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[throws if `handleEvent` is falsy and not callable]
|
[throws if `handleEvent` is falsy and not callable]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[throws if `handleEvent` is thruthy and not callable]
|
[throws if `handleEvent` is thruthy and not callable]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
[AbortController interface: existence and properties of interface prototype object's @@unscopables property]
|
[AbortController interface: existence and properties of interface prototype object's @@unscopables property]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: new CustomEvent("foo") must inherit property "srcElement" with the proper type]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Event interface: new Event("foo") must inherit property "composed" with the proper type]
|
[Event interface: new Event("foo") must inherit property "composed" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -20,9 +17,6 @@
|
||||||
[AbortController interface object name]
|
[AbortController interface object name]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: new Event("foo") must inherit property "srcElement" with the proper type]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Event interface: attribute composed]
|
[Event interface: attribute composed]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -47,9 +41,6 @@
|
||||||
[EventTarget interface: new AbortController().signal must inherit property "dispatchEvent(Event)" with the proper type]
|
[EventTarget interface: new AbortController().signal must inherit property "dispatchEvent(Event)" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: attribute srcElement]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[EventTarget interface: calling addEventListener(DOMString, EventListener, [object Object\],[object Object\]) on new AbortController().signal with too few arguments must throw TypeError]
|
[EventTarget interface: calling addEventListener(DOMString, EventListener, [object Object\],[object Object\]) on new AbortController().signal with too few arguments must throw TypeError]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -199,9 +199,6 @@
|
||||||
|
|
||||||
|
|
||||||
[idlharness.window.html?exclude=Node]
|
[idlharness.window.html?exclude=Node]
|
||||||
[Event interface: new CustomEvent("foo") must inherit property "srcElement" with the proper type]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[EventTarget interface: new AbortController().signal must inherit property "addEventListener(DOMString, EventListener, [object Object\],[object Object\])" with the proper type]
|
[EventTarget interface: new AbortController().signal must inherit property "addEventListener(DOMString, EventListener, [object Object\],[object Object\])" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -331,9 +328,6 @@
|
||||||
[AbstractRange interface: attribute endContainer]
|
[AbstractRange interface: attribute endContainer]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: new Event("foo") must inherit property "srcElement" with the proper type]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[AbortController must be primary interface of new AbortController()]
|
[AbortController must be primary interface of new AbortController()]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -346,9 +340,6 @@
|
||||||
[CharacterData interface: operation remove()]
|
[CharacterData interface: operation remove()]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: attribute srcElement]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Range interface: existence and properties of interface object]
|
[Range interface: existence and properties of interface object]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -532,9 +523,6 @@
|
||||||
[Attr interface: existence and properties of interface prototype object]
|
[Attr interface: existence and properties of interface prototype object]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: document.createEvent("Event") must inherit property "srcElement" with the proper type]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Element interface: operation replaceWith([object Object\],[object Object\])]
|
[Element interface: operation replaceWith([object Object\],[object Object\])]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -827,27 +827,18 @@
|
||||||
[DOM IDL tests]
|
[DOM IDL tests]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: attribute srcElement]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Event interface: operation composedPath()]
|
[Event interface: operation composedPath()]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: attribute composed]
|
[Event interface: attribute composed]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: document.createEvent("Event") must inherit property "srcElement" with the proper type]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Event interface: document.createEvent("Event") must inherit property "composedPath()" with the proper type]
|
[Event interface: document.createEvent("Event") must inherit property "composedPath()" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: document.createEvent("Event") must inherit property "composed" with the proper type]
|
[Event interface: document.createEvent("Event") must inherit property "composed" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: new Event("foo") must inherit property "srcElement" with the proper type]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Event interface: new Event("foo") must inherit property "composedPath()" with the proper type]
|
[Event interface: new Event("foo") must inherit property "composedPath()" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -857,9 +848,6 @@
|
||||||
[CustomEvent interface: operation initCustomEvent(DOMString, boolean, boolean, any)]
|
[CustomEvent interface: operation initCustomEvent(DOMString, boolean, boolean, any)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event interface: new CustomEvent("foo") must inherit property "srcElement" with the proper type]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Event interface: new CustomEvent("foo") must inherit property "composedPath()" with the proper type]
|
[Event interface: new CustomEvent("foo") must inherit property "composedPath()" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue