diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2014-11-16 07:41:22 +0530 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2014-12-05 18:32:12 -0800 |
commit | 03207dea81fc4500c9df047de90083cf9af378c1 (patch) | |
tree | 15ec2f399a51344e92f41a019ee61f1d83b5a42a /components/script/script_task.rs | |
parent | ddfa0c7de74d707959704f0c035b46df451549fc (diff) | |
download | servo-03207dea81fc4500c9df047de90083cf9af378c1.tar.gz servo-03207dea81fc4500c9df047de90083cf9af378c1.zip |
Hook up authentic click activation to the script task
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r-- | components/script/script_task.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index fdd4795ab25..acbd2cfbab3 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -18,8 +18,8 @@ use dom::bindings::trace::JSTraceable; use dom::bindings::utils::{wrap_for_same_compartment, pre_wrap}; use dom::document::{Document, HTMLDocument, DocumentHelpers, FromParser}; use dom::element::{Element, HTMLButtonElementTypeId, HTMLInputElementTypeId}; -use dom::element::{HTMLSelectElementTypeId, HTMLTextAreaElementTypeId, HTMLOptionElementTypeId}; -use dom::event::{Event, Bubbles, DoesNotBubble, Cancelable, NotCancelable}; +use dom::element::{HTMLSelectElementTypeId, HTMLTextAreaElementTypeId, HTMLOptionElementTypeId, ActivationElementHelpers}; +use dom::event::{Event, EventHelpers, Bubbles, DoesNotBubble, Cancelable, NotCancelable}; use dom::uievent::UIEvent; use dom::eventtarget::{EventTarget, EventTargetHelpers}; use dom::keyboardevent::KeyboardEvent; @@ -1018,8 +1018,11 @@ impl ScriptTask { Event::new(global::Window(*window), "click".to_string(), Bubbles, Cancelable).root(); - let eventtarget: JSRef<EventTarget> = EventTargetCast::from_ref(node); - let _ = eventtarget.dispatch_event_with_target(None, *event); + // https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#trusted-events + event.set_trusted(true); + // https://html.spec.whatwg.org/multipage/interaction.html#run-authentic-click-activation-steps + let el = ElementCast::to_ref(node).unwrap(); // is_element() check already exists above + el.authentic_click_activation(*event); doc.commit_focus_transaction(); window.flush_layout(); |