mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
script: Change signature of Event::dispatch
to match the spec and simplify things (#38566)
- [Dispatch Event](https://dom.spec.whatwg.org/#concept-event-dispatch) should return a Boolean. This function is used frequently in spec and the change makes things easier to follow. - Remove `enum EventStatus` and related functions. - Update some dead spec link. - Update some steps. This is intended as cleanup before working on #38435 and reduces binary size by 488KB in Release profile. Testing: No behaviour change. --------- Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
21717158eb
commit
589d188a3f
9 changed files with 40 additions and 68 deletions
|
@ -24,7 +24,6 @@ use crate::dom::bindings::inheritance::Castable;
|
|||
use crate::dom::bindings::root::DomRoot;
|
||||
use crate::dom::bindings::trace::CustomTraceable;
|
||||
use crate::dom::bindings::utils::define_all_exposed_interfaces;
|
||||
use crate::dom::event::EventStatus;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::types::{DebuggerEvent, Event};
|
||||
#[cfg(feature = "testbinding")]
|
||||
|
@ -124,10 +123,9 @@ impl DebuggerGlobalScope {
|
|||
}
|
||||
|
||||
pub(crate) fn fire_add_debuggee(&self, can_gc: CanGc, global: &GlobalScope) {
|
||||
assert_eq!(
|
||||
assert!(
|
||||
DomRoot::upcast::<Event>(DebuggerEvent::new(self.upcast(), global, can_gc))
|
||||
.fire(self.upcast(), can_gc),
|
||||
EventStatus::NotCanceled,
|
||||
"Guaranteed by DebuggerEvent::new"
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue