mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
#4508 Adding simple test and actually getting the event to dispatch
This commit is contained in:
parent
5938a4c0f5
commit
0bd717e470
3 changed files with 21 additions and 6 deletions
|
@ -13,7 +13,7 @@ use dom::bindings::codegen::InheritTypes::{ElementCast, EventTargetCast, HTMLEle
|
|||
use dom::bindings::codegen::InheritTypes::{HTMLTextAreaElementDerived, HTMLFieldSetElementDerived};
|
||||
use dom::bindings::codegen::InheritTypes::{KeyboardEventCast, TextDerived};
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::{JS, JSRef, LayoutJS, Temporary, OptionalRootable};
|
||||
use dom::bindings::js::{JSRef, LayoutJS, Temporary, OptionalRootable};
|
||||
use dom::bindings::refcounted::Trusted;
|
||||
use dom::document::{Document, DocumentHelpers};
|
||||
use dom::element::{Element, AttributeHandlers};
|
||||
|
@ -347,7 +347,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTextAreaElement> {
|
|||
KeyReaction::DispatchInput => {
|
||||
self.value_changed.set(true);
|
||||
|
||||
if event.IsTrusted() == true {
|
||||
if event.IsTrusted() {
|
||||
let window = window_from_node(*self).root();
|
||||
let window = window.r();
|
||||
let chan = window.script_chan();
|
||||
|
@ -355,7 +355,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTextAreaElement> {
|
|||
let dispatcher = ChangeEventRunnable {
|
||||
element: handler,
|
||||
};
|
||||
chan.send(ScriptMsg::RunnableMsg(box dispatcher));
|
||||
let _ = chan.send(ScriptMsg::RunnableMsg(box dispatcher));
|
||||
}
|
||||
|
||||
self.force_relayout();
|
||||
|
@ -382,4 +382,4 @@ impl Runnable for ChangeEventRunnable {
|
|||
let target = self.element.to_temporary().root();
|
||||
target.r().dispatch_change_event();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue