diff options
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/event.rs | 1 | ||||
-rw-r--r-- | components/script/dom/macros.rs | 1 | ||||
-rw-r--r-- | components/script/dom/webidls/EventHandler.webidl | 1 | ||||
-rw-r--r-- | components/script/script_thread.rs | 17 |
4 files changed, 13 insertions, 7 deletions
diff --git a/components/script/dom/event.rs b/components/script/dom/event.rs index aba0179a59b..3a0e7490fc9 100644 --- a/components/script/dom/event.rs +++ b/components/script/dom/event.rs @@ -647,6 +647,7 @@ fn invoke( atom!("animationiteration") => Some(atom!("webkitAnimationIteration")), atom!("animationstart") => Some(atom!("webkitAnimationStart")), atom!("transitionend") => Some(atom!("webkitTransitionEnd")), + atom!("transitionrun") => Some(atom!("webkitTransitionRun")), _ => None, } { let original_type = event.type_(); diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs index df0a929a0ff..b1ea4f5cde2 100644 --- a/components/script/dom/macros.rs +++ b/components/script/dom/macros.rs @@ -498,6 +498,7 @@ macro_rules! global_event_handlers( event_handler!(toggle, GetOntoggle, SetOntoggle); event_handler!(transitioncancel, GetOntransitioncancel, SetOntransitioncancel); event_handler!(transitionend, GetOntransitionend, SetOntransitionend); + event_handler!(transitionrun, GetOntransitionrun, SetOntransitionrun); event_handler!(volumechange, GetOnvolumechange, SetOnvolumechange); event_handler!(waiting, GetOnwaiting, SetOnwaiting); ) diff --git a/components/script/dom/webidls/EventHandler.webidl b/components/script/dom/webidls/EventHandler.webidl index 772c47facd2..a3514182806 100644 --- a/components/script/dom/webidls/EventHandler.webidl +++ b/components/script/dom/webidls/EventHandler.webidl @@ -92,6 +92,7 @@ interface mixin GlobalEventHandlers { // https://drafts.csswg.org/css-transitions/#interface-globaleventhandlers-idl partial interface mixin GlobalEventHandlers { + attribute EventHandler ontransitionrun; attribute EventHandler ontransitionend; attribute EventHandler ontransitioncancel; }; diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 7a672851ba6..606ac81493e 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -2920,22 +2920,20 @@ impl ScriptThread { let js_runtime = self.js_runtime.rt(); let node = unsafe { from_untrusted_node_address(js_runtime, unsafe_node) }; - let idx = self + let node_index = self .transitioning_nodes .borrow() .iter() .position(|n| &**n as *const _ == &*node as *const _); - match idx { - Some(idx) => { - self.transitioning_nodes.borrow_mut().remove(idx); - }, + let node_index = match node_index { + Some(node_index) => node_index, None => { // If no index is found, we can't know whether this node is safe to use. // It's better not to fire a DOM event than crash. warn!("Ignoring transition end notification for unknown node."); return; }, - } + }; if self.closed_pipelines.borrow().contains(&pipeline_id) { warn!("Ignoring transition event for closed pipeline."); @@ -2943,12 +2941,17 @@ impl ScriptThread { } let event_atom = match event_type { + TransitionEventType::TransitionRun => atom!("transitionrun"), TransitionEventType::TransitionEnd => { // Not quite the right thing - see #13865. node.dirty(NodeDamage::NodeStyleDamaged); + self.transitioning_nodes.borrow_mut().remove(node_index); atom!("transitionend") }, - TransitionEventType::TransitionCancel => atom!("transitioncancel"), + TransitionEventType::TransitionCancel => { + self.transitioning_nodes.borrow_mut().remove(node_index); + atom!("transitioncancel") + }, }; let event_init = TransitionEventInit { |