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
|
@ -130,7 +130,7 @@ use crate::dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration
|
|||
use crate::dom::customelementregistry::CustomElementRegistry;
|
||||
use crate::dom::document::{AnimationFrameCallback, Document};
|
||||
use crate::dom::element::Element;
|
||||
use crate::dom::event::{Event, EventBubbles, EventCancelable, EventStatus};
|
||||
use crate::dom::event::{Event, EventBubbles, EventCancelable};
|
||||
use crate::dom::eventtarget::EventTarget;
|
||||
use crate::dom::gamepad::{Gamepad, contains_user_gesture};
|
||||
use crate::dom::gamepadevent::GamepadEventType;
|
||||
|
@ -705,12 +705,8 @@ impl Window {
|
|||
}
|
||||
|
||||
// see note at https://dom.spec.whatwg.org/#concept-event-dispatch step 2
|
||||
pub(crate) fn dispatch_event_with_target_override(
|
||||
&self,
|
||||
event: &Event,
|
||||
can_gc: CanGc,
|
||||
) -> EventStatus {
|
||||
event.dispatch(self.upcast(), true, can_gc)
|
||||
pub(crate) fn dispatch_event_with_target_override(&self, event: &Event, can_gc: CanGc) {
|
||||
event.dispatch(self.upcast(), true, can_gc);
|
||||
}
|
||||
|
||||
pub(crate) fn font_context(&self) -> &Arc<FontContext> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue