mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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()
|
||||
}
|
||||
|
||||
// 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()
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue