diff options
author | chansuke <chansuke@georepublic.de> | 2018-09-18 23:24:15 +0900 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2018-09-19 17:40:47 -0400 |
commit | c37a345dc9f4dda6ea29c42f96f6c7201c42cbac (patch) | |
tree | 1f05b49bac02318455a59d5b143c186fd872bdb9 /components/script/dom/activation.rs | |
parent | 2ca7a134736bb4759ff209c1bc0b6dc3cc1984c9 (diff) | |
download | servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.tar.gz servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.zip |
Format script component
Diffstat (limited to 'components/script/dom/activation.rs')
-rw-r--r-- | components/script/dom/activation.rs | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/components/script/dom/activation.rs b/components/script/dom/activation.rs index 029e77ed449..9498f17bf17 100644 --- a/components/script/dom/activation.rs +++ b/components/script/dom/activation.rs @@ -56,12 +56,14 @@ pub enum ActivationSource { } // https://html.spec.whatwg.org/multipage/#run-synthetic-click-activation-steps -pub fn synthetic_click_activation(element: &Element, - ctrl_key: bool, - shift_key: bool, - alt_key: bool, - meta_key: bool, - source: ActivationSource) { +pub fn synthetic_click_activation( + element: &Element, + ctrl_key: bool, + shift_key: bool, + alt_key: bool, + meta_key: bool, + source: ActivationSource, +) { // Step 1 if element.click_in_progress() { return; @@ -78,23 +80,25 @@ pub fn synthetic_click_activation(element: &Element, // https://html.spec.whatwg.org/multipage/#fire-a-synthetic-mouse-event let win = window_from_node(element); let target = element.upcast::<EventTarget>(); - let mouse = MouseEvent::new(&win, - DOMString::from("click"), - EventBubbles::DoesNotBubble, - EventCancelable::NotCancelable, - Some(&win), - 1, - 0, - 0, - 0, - 0, - ctrl_key, - shift_key, - alt_key, - meta_key, - 0, - None, - None); + let mouse = MouseEvent::new( + &win, + DOMString::from("click"), + EventBubbles::DoesNotBubble, + EventCancelable::NotCancelable, + Some(&win), + 1, + 0, + 0, + 0, + 0, + ctrl_key, + shift_key, + alt_key, + meta_key, + 0, + None, + None, + ); let event = mouse.upcast::<Event>(); if source == ActivationSource::FromClick { event.set_trusted(false); |