mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update CustomEvent webidl interface (#33481)
The [idl interface](https://dom.spec.whatwg.org/#interface-customevent) and servo's implementation had diverged. * Extra arguments to initCustomEvent are optional (fixes `dom/events/CustomEvent.html`) * The CustomEvent constructor is infallible * "[Exposed=*]" (and the same for the "Event" interface since it's CustomEvent's parent.) Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
4c3b3529a8
commit
7cbc5f6ee6
6 changed files with 14 additions and 17 deletions
|
@ -11,7 +11,6 @@ use servo_atoms::Atom;
|
|||
use crate::dom::bindings::codegen::Bindings::CustomEventBinding;
|
||||
use crate::dom::bindings::codegen::Bindings::CustomEventBinding::CustomEventMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::EventBinding::EventMethods;
|
||||
use crate::dom::bindings::error::Fallible;
|
||||
use crate::dom::bindings::inheritance::Castable;
|
||||
use crate::dom::bindings::reflector::reflect_dom_object_with_proto;
|
||||
use crate::dom::bindings::root::DomRoot;
|
||||
|
@ -75,8 +74,8 @@ impl CustomEvent {
|
|||
can_gc: CanGc,
|
||||
type_: DOMString,
|
||||
init: RootedTraceableBox<CustomEventBinding::CustomEventInit>,
|
||||
) -> Fallible<DomRoot<CustomEvent>> {
|
||||
Ok(CustomEvent::new(
|
||||
) -> DomRoot<CustomEvent> {
|
||||
CustomEvent::new(
|
||||
global,
|
||||
proto,
|
||||
Atom::from(type_),
|
||||
|
@ -84,7 +83,7 @@ impl CustomEvent {
|
|||
init.parent.cancelable,
|
||||
init.detail.handle(),
|
||||
can_gc,
|
||||
))
|
||||
)
|
||||
}
|
||||
|
||||
fn init_custom_event(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue