Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various events-related improvements #15133

Merged
merged 10 commits into from Jan 21, 2017

Make TransitionEvent::new take a &Window

  • Loading branch information
nox committed Jan 21, 2017
commit 707f8f881ebcf1ebf531ea3437d8148e47409092
@@ -12,7 +12,6 @@ use dom::bindings::num::Finite;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::DOMString;
use dom::event::Event;
use dom::globalscope::GlobalScope;
use dom::window::Window;
use servo_atoms::Atom;

@@ -34,11 +33,11 @@ impl TransitionEvent {
}
}

pub fn new(global: &GlobalScope,
pub fn new(window: &Window,
type_: Atom,
init: &TransitionEventInit) -> Root<TransitionEvent> {
let ev = reflect_dom_object(box TransitionEvent::new_inherited(init),
global,
window,
TransitionEventBinding::Wrap);
{
let event = ev.upcast::<Event>();
@@ -50,8 +49,7 @@ impl TransitionEvent {
pub fn Constructor(window: &Window,
type_: DOMString,
init: &TransitionEventInit) -> Fallible<Root<TransitionEvent>> {
let global = window.upcast::<GlobalScope>();
Ok(TransitionEvent::new(global, Atom::from(type_), init))
Ok(TransitionEvent::new(window, Atom::from(type_), init))
}
}

@@ -1624,7 +1624,7 @@ impl ScriptThread {
// FIXME: Handle pseudo-elements properly
pseudoElement: DOMString::new()
};
let transition_event = TransitionEvent::new(window.upcast(),
let transition_event = TransitionEvent::new(&window,
atom!("transitionend"),
&init);
transition_event.upcast::<Event>().fire(node.upcast());
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.