aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlformelement.rs
diff options
context:
space:
mode:
authorKeith Yeung <kungfukeith11@gmail.com>2016-01-06 11:44:54 -0500
committerKeith Yeung <kungfukeith11@gmail.com>2016-03-10 01:05:53 -0500
commit3f2cbf002520289f706e7a7c6448a39ca7fa4bef (patch)
tree668324ce1c47e981314f28aab246b6524f92fda9 /components/script/dom/htmlformelement.rs
parentfa93d3f4674c0e326a644826f5c394136a858f2b (diff)
downloadservo-3f2cbf002520289f706e7a7c6448a39ca7fa4bef.tar.gz
servo-3f2cbf002520289f706e7a7c6448a39ca7fa4bef.zip
Add task_source directory
Use DOMManipulationTaskSource whenever possible
Diffstat (limited to 'components/script/dom/htmlformelement.rs')
-rw-r--r--components/script/dom/htmlformelement.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs
index 167e1698845..1d84c78f78b 100644
--- a/components/script/dom/htmlformelement.rs
+++ b/components/script/dom/htmlformelement.rs
@@ -37,12 +37,12 @@ use hyper::header::ContentType;
use hyper::method::Method;
use hyper::mime;
use msg::constellation_msg::{LoadData, PipelineId};
-use script_thread::ScriptThreadEventCategory::FormPlannedNavigation;
-use script_thread::{CommonScriptMsg, MainThreadScriptMsg, Runnable, ScriptChan};
+use script_thread::{MainThreadScriptChan, MainThreadScriptMsg, Runnable, ScriptChan};
use std::borrow::ToOwned;
use std::cell::Cell;
use std::sync::mpsc::Sender;
use string_cache::Atom;
+use task_source::dom_manipulation::DOMManipulationTask;
use url::form_urlencoded::serialize;
use util::str::DOMString;
@@ -76,6 +76,10 @@ impl HTMLFormElement {
let element = HTMLFormElement::new_inherited(localName, prefix, document);
Node::reflect_node(box element, document, HTMLFormElementBinding::Wrap)
}
+
+ pub fn generation_id(&self) -> GenerationId {
+ self.generation_id.get()
+ }
}
impl HTMLFormElementMethods for HTMLFormElement {
@@ -322,17 +326,20 @@ impl HTMLFormElement {
// generation ID is the same as its own generation ID.
let GenerationId(prev_id) = self.generation_id.get();
self.generation_id.set(GenerationId(prev_id + 1));
+
// Step 2
+ let chan = MainThreadScriptChan(window.main_thread_script_chan().clone()).clone();
let nav = box PlannedNavigation {
load_data: load_data,
pipeline_id: window.pipeline(),
script_chan: window.main_thread_script_chan().clone(),
generation_id: self.generation_id.get(),
- form: Trusted::new(self, window.dom_manipulation_task_source())
+ form: Trusted::new(self, chan)
};
+
// Step 3
- window.dom_manipulation_task_source().send(
- CommonScriptMsg::RunnableMsg(FormPlannedNavigation, nav)).unwrap();
+ window.dom_manipulation_task_source().queue(
+ DOMManipulationTask::PlannedNavigation(nav)).unwrap();
}
/// Interactively validate the constraints of form elements