mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Rustfmt some of script.
This commit is contained in:
parent
ceb72e54e4
commit
0c61be7a57
50 changed files with 1499 additions and 885 deletions
|
@ -31,7 +31,11 @@ pub trait Activatable {
|
|||
fn implicit_submission(&self, ctrlKey: bool, shiftKey: bool, altKey: bool, metaKey: bool);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#run-synthetic-click-activation-steps
|
||||
fn synthetic_click_activation(&self, ctrlKey: bool, shiftKey: bool, altKey: bool, metaKey: bool) {
|
||||
fn synthetic_click_activation(&self,
|
||||
ctrlKey: bool,
|
||||
shiftKey: bool,
|
||||
altKey: bool,
|
||||
metaKey: bool) {
|
||||
let element = self.as_element();
|
||||
// Step 1
|
||||
if element.click_in_progress() {
|
||||
|
@ -46,10 +50,22 @@ pub trait Activatable {
|
|||
// https://html.spec.whatwg.org/multipage/#fire-a-synthetic-mouse-event
|
||||
let win = window_from_node(element);
|
||||
let target = element.upcast();
|
||||
let mouse = MouseEvent::new(win.r(), DOMString::from("click"),
|
||||
EventBubbles::DoesNotBubble, EventCancelable::NotCancelable, Some(win.r()), 1,
|
||||
0, 0, 0, 0, ctrlKey, shiftKey, altKey, metaKey,
|
||||
0, None);
|
||||
let mouse = MouseEvent::new(win.r(),
|
||||
DOMString::from("click"),
|
||||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::NotCancelable,
|
||||
Some(win.r()),
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
ctrlKey,
|
||||
shiftKey,
|
||||
altKey,
|
||||
metaKey,
|
||||
0,
|
||||
None);
|
||||
let event = mouse.upcast::<Event>();
|
||||
event.fire(target);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue