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:
bors-servo 2019-09-05 23:41:15 -04:00 committed by GitHub
commit da237b4517
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 6 additions and 74 deletions

View file

@ -263,6 +263,11 @@ impl EventMethods for Event {
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
fn GetCurrentTarget(&self) -> Option<DomRoot<EventTarget>> {
self.current_target.get()

View file

@ -11,6 +11,7 @@ interface Event {
[Pure]
readonly attribute DOMString type;
readonly attribute EventTarget? target;
readonly attribute EventTarget? srcElement;
readonly attribute EventTarget? currentTarget;
const unsigned short NONE = 0;