mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Add "composed" param to "fire_event_with_composed"
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
6cc3e2934c
commit
30731dd5ae
2 changed files with 15 additions and 3 deletions
|
@ -1124,7 +1124,13 @@ impl TaskOnce for EventTask {
|
||||||
let target = self.target.root();
|
let target = self.target.root();
|
||||||
let bubbles = self.bubbles;
|
let bubbles = self.bubbles;
|
||||||
let cancelable = self.cancelable;
|
let cancelable = self.cancelable;
|
||||||
target.fire_event_with_params(self.name, bubbles, cancelable, CanGc::note());
|
target.fire_event_with_params(
|
||||||
|
self.name,
|
||||||
|
bubbles,
|
||||||
|
cancelable,
|
||||||
|
EventComposed::NotComposed,
|
||||||
|
CanGc::note(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ use crate::dom::bindings::trace::HashMapTracedValues;
|
||||||
use crate::dom::document::Document;
|
use crate::dom::document::Document;
|
||||||
use crate::dom::element::Element;
|
use crate::dom::element::Element;
|
||||||
use crate::dom::errorevent::ErrorEvent;
|
use crate::dom::errorevent::ErrorEvent;
|
||||||
use crate::dom::event::{Event, EventBubbles, EventCancelable, EventStatus};
|
use crate::dom::event::{Event, EventBubbles, EventCancelable, EventComposed, EventStatus};
|
||||||
use crate::dom::globalscope::GlobalScope;
|
use crate::dom::globalscope::GlobalScope;
|
||||||
use crate::dom::htmlformelement::FormControlElementHelpers;
|
use crate::dom::htmlformelement::FormControlElementHelpers;
|
||||||
use crate::dom::node::{Node, NodeTraits};
|
use crate::dom::node::{Node, NodeTraits};
|
||||||
|
@ -767,6 +767,7 @@ impl EventTarget {
|
||||||
name,
|
name,
|
||||||
EventBubbles::DoesNotBubble,
|
EventBubbles::DoesNotBubble,
|
||||||
EventCancelable::NotCancelable,
|
EventCancelable::NotCancelable,
|
||||||
|
EventComposed::NotComposed,
|
||||||
can_gc,
|
can_gc,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -777,6 +778,7 @@ impl EventTarget {
|
||||||
name,
|
name,
|
||||||
EventBubbles::Bubbles,
|
EventBubbles::Bubbles,
|
||||||
EventCancelable::NotCancelable,
|
EventCancelable::NotCancelable,
|
||||||
|
EventComposed::NotComposed,
|
||||||
can_gc,
|
can_gc,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -787,6 +789,7 @@ impl EventTarget {
|
||||||
name,
|
name,
|
||||||
EventBubbles::DoesNotBubble,
|
EventBubbles::DoesNotBubble,
|
||||||
EventCancelable::Cancelable,
|
EventCancelable::Cancelable,
|
||||||
|
EventComposed::NotComposed,
|
||||||
can_gc,
|
can_gc,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -801,19 +804,22 @@ impl EventTarget {
|
||||||
name,
|
name,
|
||||||
EventBubbles::Bubbles,
|
EventBubbles::Bubbles,
|
||||||
EventCancelable::Cancelable,
|
EventCancelable::Cancelable,
|
||||||
|
EventComposed::NotComposed,
|
||||||
can_gc,
|
can_gc,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#concept-event-fire
|
/// <https://dom.spec.whatwg.org/#concept-event-fire>
|
||||||
pub(crate) fn fire_event_with_params(
|
pub(crate) fn fire_event_with_params(
|
||||||
&self,
|
&self,
|
||||||
name: Atom,
|
name: Atom,
|
||||||
bubbles: EventBubbles,
|
bubbles: EventBubbles,
|
||||||
cancelable: EventCancelable,
|
cancelable: EventCancelable,
|
||||||
|
composed: EventComposed,
|
||||||
can_gc: CanGc,
|
can_gc: CanGc,
|
||||||
) -> DomRoot<Event> {
|
) -> DomRoot<Event> {
|
||||||
let event = Event::new(&self.global(), name, bubbles, cancelable, can_gc);
|
let event = Event::new(&self.global(), name, bubbles, cancelable, can_gc);
|
||||||
|
event.set_composed(composed.into());
|
||||||
event.fire(self, can_gc);
|
event.fire(self, can_gc);
|
||||||
event
|
event
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue