make use of ScriptToConstellationChan

This commit is contained in:
Paul Rouget 2017-07-18 08:19:44 +02:00
parent 817de15735
commit d241389129
24 changed files with 285 additions and 280 deletions

View file

@ -38,13 +38,13 @@ use dom::validitystate::ValidationFlags;
use dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
use html5ever::{LocalName, Prefix};
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::ipc::channel;
use mime_guess;
use net_traits::{CoreResourceMsg, IpcSend};
use net_traits::blob_url_store::get_blob_origin;
use net_traits::filemanager_thread::{FileManagerThreadMsg, FilterPattern};
use script_layout_interface::rpc::TextIndexResponse;
use script_traits::ScriptMsg as ConstellationMsg;
use script_traits::ScriptToConstellationChan;
use servo_atoms::Atom;
use std::borrow::ToOwned;
use std::cell::Cell;
@ -94,7 +94,7 @@ pub struct HTMLInputElement {
maxlength: Cell<i32>,
minlength: Cell<i32>,
#[ignore_heap_size_of = "#7193"]
textinput: DOMRefCell<TextInput<IpcSender<ConstellationMsg>>>,
textinput: DOMRefCell<TextInput<ScriptToConstellationChan>>,
activation_state: DOMRefCell<InputActivationState>,
// https://html.spec.whatwg.org/multipage/#concept-input-value-dirty-flag
value_dirty: Cell<bool>,
@ -136,7 +136,7 @@ static DEFAULT_MIN_LENGTH: i32 = -1;
impl HTMLInputElement {
fn new_inherited(local_name: LocalName, prefix: Option<Prefix>, document: &Document) -> HTMLInputElement {
let chan = document.window().upcast::<GlobalScope>().constellation_chan().clone();
let chan = document.window().upcast::<GlobalScope>().script_to_constellation_chan().clone();
HTMLInputElement {
htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE,
@ -814,7 +814,7 @@ impl HTMLInputElement {
if self.Multiple() {
let opt_test_paths = opt_test_paths.map(|paths| paths.iter().map(|p| p.to_string()).collect());
let (chan, recv) = ipc::channel().expect("Error initializing channel");
let (chan, recv) = channel().expect("Error initializing channel");
let msg = FileManagerThreadMsg::SelectFiles(filter, chan, origin, opt_test_paths);
let _ = resource_threads.send(CoreResourceMsg::ToFileManager(msg)).unwrap();
@ -838,7 +838,7 @@ impl HTMLInputElement {
None => None,
};
let (chan, recv) = ipc::channel().expect("Error initializing channel");
let (chan, recv) = channel().expect("Error initializing channel");
let msg = FileManagerThreadMsg::SelectFile(filter, chan, origin, opt_test_path);
let _ = resource_threads.send(CoreResourceMsg::ToFileManager(msg)).unwrap();