mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Format script component
This commit is contained in:
parent
2ca7a13473
commit
c37a345dc9
357 changed files with 25485 additions and 18076 deletions
|
@ -37,17 +37,20 @@ impl PopStateEvent {
|
|||
}
|
||||
|
||||
pub fn new_uninitialized(window: &Window) -> DomRoot<PopStateEvent> {
|
||||
reflect_dom_object(Box::new(PopStateEvent::new_inherited()),
|
||||
window,
|
||||
PopStateEventBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(PopStateEvent::new_inherited()),
|
||||
window,
|
||||
PopStateEventBinding::Wrap,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn new(window: &Window,
|
||||
type_: Atom,
|
||||
bubbles: bool,
|
||||
cancelable: bool,
|
||||
state: HandleValue)
|
||||
-> DomRoot<PopStateEvent> {
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
type_: Atom,
|
||||
bubbles: bool,
|
||||
cancelable: bool,
|
||||
state: HandleValue,
|
||||
) -> DomRoot<PopStateEvent> {
|
||||
let ev = PopStateEvent::new_uninitialized(window);
|
||||
ev.state.set(state.get());
|
||||
{
|
||||
|
@ -57,20 +60,21 @@ impl PopStateEvent {
|
|||
ev
|
||||
}
|
||||
|
||||
pub fn Constructor(window: &Window,
|
||||
type_: DOMString,
|
||||
init: RootedTraceableBox<PopStateEventBinding::PopStateEventInit>)
|
||||
-> Fallible<DomRoot<PopStateEvent>> {
|
||||
Ok(PopStateEvent::new(window,
|
||||
Atom::from(type_),
|
||||
init.parent.bubbles,
|
||||
init.parent.cancelable,
|
||||
init.state.handle()))
|
||||
pub fn Constructor(
|
||||
window: &Window,
|
||||
type_: DOMString,
|
||||
init: RootedTraceableBox<PopStateEventBinding::PopStateEventInit>,
|
||||
) -> Fallible<DomRoot<PopStateEvent>> {
|
||||
Ok(PopStateEvent::new(
|
||||
window,
|
||||
Atom::from(type_),
|
||||
init.parent.bubbles,
|
||||
init.parent.cancelable,
|
||||
init.state.handle(),
|
||||
))
|
||||
}
|
||||
|
||||
pub fn dispatch_jsval(target: &EventTarget,
|
||||
window: &Window,
|
||||
state: HandleValue) {
|
||||
pub fn dispatch_jsval(target: &EventTarget, window: &Window, state: HandleValue) {
|
||||
let event = PopStateEvent::new(window, atom!("popstate"), false, false, state);
|
||||
event.upcast::<Event>().fire(target);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue