script: add initialize_ui_event method (#34524)

* retire UIEvent::InitUIEvent

Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com>

* fix fmt

Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com>

* remove unused changes

Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com>

* reimplement the spec and reuse wherever we can

Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com>

* fix lint

Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com>

---------

Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com>
This commit is contained in:
Jay Wang 2024-12-08 18:06:36 +09:00 committed by GitHub
parent 1b1a4eca55
commit 2fbe16876c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 37 additions and 5 deletions

View file

@ -126,6 +126,10 @@ impl Event {
self.cancelable.set(cancelable);
}
pub fn set_target(&self, target_: Option<&EventTarget>) {
self.target.set(target_);
}
/// <https://dom.spec.whatwg.org/#event-path>
// TODO: shadow roots put special flags in the path,
// and it will stop just being a list of bare EventTargets