diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-09-19 13:34:51 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-09-19 13:34:51 -0600 |
commit | a0d3c9223f09757124b1520c4f17e94fa8bbe249 (patch) | |
tree | 1dd3e40e5a554466dfb4575758ad15967927d44d /components/script/dom | |
parent | 7f2d81933a6158926ff6d03acbc05f191cd5adb3 (diff) | |
parent | de3547e401a0ace8b6bfb4b488ed0be9d5b3d79c (diff) | |
download | servo-a0d3c9223f09757124b1520c4f17e94fa8bbe249.tar.gz servo-a0d3c9223f09757124b1520c4f17e94fa8bbe249.zip |
Auto merge of #7662 - nerith:import, r=frewsxcv
Check for multiple import blocks separated by whitespace
Fixes #7381.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7662)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
94 files changed, 230 insertions, 404 deletions
diff --git a/components/script/dom/activation.rs b/components/script/dom/activation.rs index d14861ed686..10c2020dd31 100644 --- a/components/script/dom/activation.rs +++ b/components/script/dom/activation.rs @@ -9,7 +9,6 @@ use dom::event::{Event, EventBubbles, EventCancelable}; use dom::eventtarget::EventTarget; use dom::mouseevent::MouseEvent; use dom::node::window_from_node; - use std::borrow::ToOwned; /// Trait for elements with defined activation behavior diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index 32178148ccf..a96f3a72e09 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use devtools_traits::AttrInfo; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::AttrBinding::{self, AttrMethods}; use dom::bindings::codegen::InheritTypes::NodeCast; @@ -12,16 +13,12 @@ use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::element::{AttributeMutation, Element}; use dom::virtualmethods::vtable_for; use dom::window::Window; - -use devtools_traits::AttrInfo; -use util::str::{DOMString, parse_unsigned_integer, split_html_space_chars, str_join}; - -use string_cache::{Atom, Namespace}; - use std::borrow::ToOwned; use std::cell::Ref; use std::mem; use std::ops::Deref; +use string_cache::{Atom, Namespace}; +use util::str::{DOMString, parse_unsigned_integer, split_html_space_chars, str_join}; #[derive(JSTraceable, PartialEq, Clone, HeapSizeOf)] pub enum AttrValue { diff --git a/components/script/dom/bindings/callback.rs b/components/script/dom/bindings/callback.rs index e5a887a88b0..4a54db01875 100644 --- a/components/script/dom/bindings/callback.rs +++ b/components/script/dom/bindings/callback.rs @@ -16,7 +16,6 @@ use js::jsapi::{JS_GetProperty, JS_IsExceptionPending, JS_ReportPendingException use js::jsapi::{JS_SaveFrameChain, JS_RestoreFrameChain}; use js::jsapi::{RootedObject, RootedValue, MutableHandleObject, Heap}; use js::jsval::{JSVal, UndefinedValue}; - use std::default::Default; use std::ffi::CString; use std::intrinsics::return_address; diff --git a/components/script/dom/bindings/cell.rs b/components/script/dom/bindings/cell.rs index e2cbe4bfef5..18fffa56b33 100644 --- a/components/script/dom/bindings/cell.rs +++ b/components/script/dom/bindings/cell.rs @@ -6,12 +6,10 @@ use dom::bindings::trace::JSTraceable; use js::jsapi::{JSTracer}; - +use std::cell::{BorrowState, RefCell, Ref, RefMut}; use util::task_state; use util::task_state::SCRIPT; -use std::cell::{BorrowState, RefCell, Ref, RefMut}; - /// A mutable field in the DOM. /// /// This extends the API of `core::cell::RefCell` to allow unsafe access in diff --git a/components/script/dom/bindings/conversions.rs b/components/script/dom/bindings/conversions.rs index 7118bef0e68..2922e2250ae 100644 --- a/components/script/dom/bindings/conversions.rs +++ b/components/script/dom/bindings/conversions.rs @@ -32,14 +32,13 @@ //! | sequences | `Vec<T>` | //! | union types | `T` | +use core::nonzero::NonZero; use dom::bindings::codegen::PrototypeList; use dom::bindings::error::throw_type_error; use dom::bindings::js::Root; use dom::bindings::num::Finite; use dom::bindings::str::{ByteString, USVString}; use dom::bindings::utils::{Reflectable, Reflector, DOMClass}; -use util::str::DOMString; - use js; use js::glue::{GetProxyPrivate, IsWrapper, RUST_JS_NumberValue}; use js::glue::{RUST_JSID_IS_STRING, RUST_JSID_TO_STRING, UnwrapObject}; @@ -54,8 +53,6 @@ use js::jsval::{UndefinedValue, NullValue, BooleanValue, Int32Value, UInt32Value use js::rust::{ToUint16, ToNumber, ToBoolean, ToString}; use js::rust::{ToUint32, ToInt32}; use js::rust::{ToUint64, ToInt64}; - -use core::nonzero::NonZero; use libc; use num::Float; use num::traits::{Bounded, Zero}; @@ -64,6 +61,7 @@ use std::char; use std::ptr; use std::rc::Rc; use std::slice; +use util::str::DOMString; trait As<O>: Copy { fn cast(self) -> O; diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index a5fb6d90e51..6fb338fd31d 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -8,21 +8,18 @@ use dom::bindings::codegen::PrototypeList::proto_id_to_name; use dom::bindings::conversions::ToJSValConvertible; use dom::bindings::global::GlobalRef; use dom::domexception::{DOMException, DOMErrorName}; - -use util::mem::HeapSizeOf; -use util::str::DOMString; - use js::jsapi::JSAutoCompartment; use js::jsapi::{JSContext, JSObject, RootedValue}; use js::jsapi::{JS_IsExceptionPending, JS_SetPendingException, JS_ReportPendingException}; use js::jsapi::{JS_ReportErrorNumber1, JSErrorFormatString, JSExnType}; use js::jsapi::{JS_SaveFrameChain, JS_RestoreFrameChain}; use js::jsval::UndefinedValue; - use libc; use std::ffi::CString; use std::mem; use std::ptr; +use util::mem::HeapSizeOf; +use util::str::DOMString; /// DOM exceptions that can be thrown by a native DOM method. #[derive(Debug, Clone, HeapSizeOf)] diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs index 3ff081521cc..a2602a2ed2e 100644 --- a/components/script/dom/bindings/global.rs +++ b/components/script/dom/bindings/global.rs @@ -14,18 +14,15 @@ use dom::bindings::js::{JS, Root}; use dom::bindings::utils::{Reflectable, Reflector}; use dom::window::{self, ScriptHelpers}; use dom::workerglobalscope::WorkerGlobalScope; -use script_task::{ScriptChan, ScriptPort, CommonScriptMsg, ScriptTask}; - -use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId}; -use net_traits::ResourceTask; -use profile_traits::mem; - use ipc_channel::ipc::IpcSender; use js::jsapi::{GetGlobalForObjectCrossCompartment}; use js::jsapi::{JSContext, JSObject, JS_GetClass, MutableHandleValue}; use js::{JSCLASS_IS_GLOBAL, JSCLASS_IS_DOMJSCLASS}; +use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId}; +use net_traits::ResourceTask; +use profile_traits::mem; +use script_task::{ScriptChan, ScriptPort, CommonScriptMsg, ScriptTask}; use url::Url; - use util::mem::HeapSizeOf; /// A freely-copyable reference to a rooted global object. diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index e50bf68e478..065604d6976 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -23,6 +23,7 @@ //! originating `Root<T>`. //! +use core::nonzero::NonZero; use dom::bindings::trace::JSTraceable; use dom::bindings::trace::trace_reflector; use dom::bindings::utils::{Reflector, Reflectable}; @@ -31,12 +32,10 @@ use js::jsapi::{JSObject, Heap, JSTracer}; use js::jsval::JSVal; use layout_interface::TrustedNodeAddress; use script_task::STACK_ROOTS; -use util::mem::HeapSizeOf; - -use core::nonzero::NonZero; use std::cell::{Cell, UnsafeCell}; use std::default::Default; use std::ops::Deref; +use util::mem::HeapSizeOf; /// A traced reference to a DOM object. Must only be used as a field in other /// DOM objects. diff --git a/components/script/dom/bindings/proxyhandler.rs b/components/script/dom/bindings/proxyhandler.rs index 66240df0d2c..8ad7a819206 100644 --- a/components/script/dom/bindings/proxyhandler.rs +++ b/components/script/dom/bindings/proxyhandler.rs @@ -20,7 +20,6 @@ use js::jsapi::{JS_StrictPropertyStub, JSErrNum}; use js::jsval::ObjectValue; use js::{JSPROP_GETTER, JSPROP_ENUMERATE, JSPROP_READONLY}; use js::{JSTrue, JSFalse}; - use libc; use std::mem; use std::ptr; diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs index a1adf059dba..755f8ec6076 100644 --- a/components/script/dom/bindings/refcounted.rs +++ b/components/script/dom/bindings/refcounted.rs @@ -22,15 +22,13 @@ //! is rooted when a hashmap entry is first created, and unrooted when the hashmap entry //! is removed. +use core::nonzero::NonZero; use dom::bindings::js::Root; use dom::bindings::trace::trace_reflector; use dom::bindings::utils::{Reflector, Reflectable}; -use script_task::{ScriptChan, CommonScriptMsg}; - use js::jsapi::{JSContext, JSTracer}; - -use core::nonzero::NonZero; use libc; +use script_task::{ScriptChan, CommonScriptMsg}; use std::cell::RefCell; use std::collections::hash_map::Entry::{Vacant, Occupied}; use std::collections::hash_map::HashMap; diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs index ee6514bffbd..dd4295f2c0b 100644 --- a/components/script/dom/bindings/str.rs +++ b/components/script/dom/bindings/str.rs @@ -10,7 +10,6 @@ use std::hash::{Hash, Hasher}; use std::ops; use std::str; use std::str::FromStr; - use util::mem::HeapSizeOf; /// Encapsulates the IDL `ByteString` type. diff --git a/components/script/dom/bindings/structuredclone.rs b/components/script/dom/bindings/structuredclone.rs index 60dc10d0ced..90a0ca25df6 100644 --- a/components/script/dom/bindings/structuredclone.rs +++ b/components/script/dom/bindings/structuredclone.rs @@ -8,13 +8,11 @@ use dom::bindings::error::Error::DataClone; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; - use js::glue::JS_STRUCTURED_CLONE_VERSION; use js::jsapi::JSContext; use js::jsapi::JS_ReadStructuredClone; use js::jsapi::{HandleValue, MutableHandleValue}; use js::jsapi::{JS_WriteStructuredClone, JS_ClearPendingException}; - use libc::size_t; use std::ptr; diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 5a9aa5b2abb..de9d788c849 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -29,15 +29,13 @@ //! The `no_jsmanaged_fields!()` macro adds an empty implementation of `JSTraceable` to //! a datatype. -use dom::bindings::js::{JS, Root}; -use dom::bindings::refcounted::Trusted; -use dom::bindings::utils::{Reflectable, Reflector, WindowProxyHandler}; -use script_task::ScriptChan; - use canvas_traits::WebGLError; use canvas_traits::{CanvasGradientStop, LinearGradientStyle, RadialGradientStyle}; use canvas_traits::{LineCapStyle, LineJoinStyle, CompositionOrBlending, RepetitionStyle}; use cssparser::RGBA; +use dom::bindings::js::{JS, Root}; +use dom::bindings::refcounted::Trusted; +use dom::bindings::utils::{Reflectable, Reflector, WindowProxyHandler}; use encoding::types::EncodingRef; use euclid::matrix2d::Matrix2D; use euclid::rect::Rect; @@ -59,6 +57,7 @@ use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask}; use net_traits::storage_task::StorageType; use profile_traits::mem::ProfilerChan as MemProfilerChan; use profile_traits::time::ProfilerChan as TimeProfilerChan; +use script_task::ScriptChan; use script_traits::UntrustedNodeAddress; use selectors::parser::PseudoElement; use serde::{Serialize, Deserialize}; diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs index be600d807d3..6d61b6013b1 100644 --- a/components/script/dom/bindings/utils.rs +++ b/components/script/dom/bindings/utils.rs @@ -17,9 +17,6 @@ use dom::bindings::trace::trace_object; use dom::browsercontext; use dom::eventtarget::EventTargetTypeId; use dom::window; -use util::mem::HeapSizeOf; -use util::str::DOMString; - use js; use js::glue::{CallJitMethodOp, CallJitGetterOp, CallJitSetterOp, IsWrapper}; use js::glue::{RUST_FUNCTION_VALUE_TO_JITINFO, RUST_JSID_IS_INT}; @@ -61,6 +58,8 @@ use std::default::Default; use std::ffi::CString; use std::ptr; use string_cache::{Atom, Namespace}; +use util::mem::HeapSizeOf; +use util::str::DOMString; /// Proxy handler for a WindowProxy. #[allow(raw_pointer_derive)] diff --git a/components/script/dom/browsercontext.rs b/components/script/dom/browsercontext.rs index a0249d37202..668dd8cd961 100644 --- a/components/script/dom/browsercontext.rs +++ b/components/script/dom/browsercontext.rs @@ -11,7 +11,6 @@ use dom::bindings::utils::{Reflectable, WindowProxyHandler}; use dom::document::Document; use dom::element::Element; use dom::window::Window; - use js::glue::{GetProxyPrivate}; use js::glue::{WrapperNew, CreateWrapperProxyHandler, ProxyTraps}; use js::jsapi::{HandleObject, HandleId, MutableHandle, MutableHandleValue}; @@ -22,7 +21,6 @@ use js::jsapi::{JS_ForwardSetPropertyTo, ObjectOpResult, RootedObject, RootedVal use js::jsapi::{JS_GetPropertyDescriptorById, JS_DefinePropertyById6}; use js::jsval::{ObjectValue, UndefinedValue}; use js::{JSTrue, JSFalse}; - use std::default::Default; use std::ptr; diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index 57feaf5e9d7..337dd3a619e 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -2,6 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use canvas::canvas_paint_task::RectToi32; +use canvas_traits::{CanvasMsg, Canvas2dMsg, CanvasCommonMsg}; +use canvas_traits::{FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle, RepetitionStyle}; +use canvas_traits::{LineCapStyle, LineJoinStyle, CompositionOrBlending}; +use cssparser::Color as CSSColor; +use cssparser::{Parser, RGBA}; use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding; use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasRenderingContext2DMethods; use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasWindingRule; @@ -22,24 +28,14 @@ use dom::htmlcanvaselement::utils as canvas_utils; use dom::htmlimageelement::HTMLImageElement; use dom::imagedata::ImageData; use dom::node::{window_from_node, NodeDamage}; - -use msg::constellation_msg::Msg as ConstellationMsg; -use net_traits::image::base::PixelFormat; -use net_traits::image_cache_task::ImageResponse; - -use cssparser::Color as CSSColor; -use cssparser::{Parser, RGBA}; use euclid::matrix2d::Matrix2D; use euclid::point::Point2D; use euclid::rect::Rect; use euclid::size::Size2D; - -use canvas::canvas_paint_task::RectToi32; -use canvas_traits::{CanvasMsg, Canvas2dMsg, CanvasCommonMsg}; -use canvas_traits::{FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle, RepetitionStyle}; -use canvas_traits::{LineCapStyle, LineJoinStyle, CompositionOrBlending}; - use ipc_channel::ipc::{self, IpcSender}; +use msg::constellation_msg::Msg as ConstellationMsg; +use net_traits::image::base::PixelFormat; +use net_traits::image_cache_task::ImageResponse; use num::{Float, ToPrimitive}; use std::borrow::ToOwned; use std::cell::RefCell; @@ -47,7 +43,6 @@ use std::cmp; use std::fmt; use std::str::FromStr; use std::sync::mpsc::channel; - use url::Url; use util::str::DOMString; use util::vec::byte_swap; diff --git a/components/script/dom/characterdata.rs b/components/script/dom/characterdata.rs index 36503f8c041..db2d576dcd9 100644 --- a/components/script/dom/characterdata.rs +++ b/components/script/dom/characterdata.rs @@ -16,11 +16,9 @@ use dom::document::Document; use dom::element::Element; use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::node::{Node, NodeTypeId}; - -use util::str::DOMString; - use std::borrow::ToOwned; use std::cell::Ref; +use util::str::DOMString; // https://dom.spec.whatwg.org/#characterdata #[dom_struct] diff --git a/components/script/dom/closeevent.rs b/components/script/dom/closeevent.rs index 5dfbaf5aecd..b4e077b0494 100644 --- a/components/script/dom/closeevent.rs +++ b/components/script/dom/closeevent.rs @@ -12,7 +12,6 @@ use dom::bindings::js::Root; use dom::bindings::utils::reflect_dom_object; use dom::event::{Event, EventTypeId, EventBubbles, EventCancelable}; use script_task::ScriptChan; - use util::str::DOMString; #[dom_struct] diff --git a/components/script/dom/create.rs b/components/script/dom/create.rs index 55bef524640..e7fb121f758 100644 --- a/components/script/dom/create.rs +++ b/components/script/dom/create.rs @@ -75,10 +75,8 @@ use dom::htmltrackelement::HTMLTrackElement; use dom::htmlulistelement::HTMLUListElement; use dom::htmlunknownelement::HTMLUnknownElement; use dom::htmlvideoelement::HTMLVideoElement; - -use string_cache::{Atom, QualName}; - use std::borrow::ToOwned; +use string_cache::{Atom, QualName}; pub fn create_element(name: QualName, prefix: Option<Atom>, document: &Document, creator: ElementCreator) diff --git a/components/script/dom/crypto.rs b/components/script/dom/crypto.rs index 49ca25ff376..52d2141b3be 100644 --- a/components/script/dom/crypto.rs +++ b/components/script/dom/crypto.rs @@ -9,15 +9,12 @@ use dom::bindings::error::{Error, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::utils::{Reflector, reflect_dom_object}; - use js::jsapi::{JSContext, JSObject}; use js::jsapi::{JS_GetObjectAsArrayBufferView, JS_GetArrayBufferViewType, Type}; - +use rand::{Rng, OsRng}; use std::ptr; use std::slice; -use rand::{Rng, OsRng}; - no_jsmanaged_fields!(OsRng); // https://developer.mozilla.org/en-US/docs/Web/API/Crypto diff --git a/components/script/dom/css.rs b/components/script/dom/css.rs index 5f4bce94d28..527b08315e9 100644 --- a/components/script/dom/css.rs +++ b/components/script/dom/css.rs @@ -2,13 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use cssparser::serialize_identifier; use dom::bindings::error::{Error, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::utils::Reflector; use util::str::DOMString; -use cssparser::serialize_identifier; - #[dom_struct] pub struct CSS { reflector_: Reflector, diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index e882330b18b..ef44d298269 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -12,15 +12,14 @@ use dom::element::{StylePriority, Element}; use dom::node::{window_from_node, document_from_node, NodeDamage}; use dom::window::Window; use selectors::parser::PseudoElement; -use string_cache::Atom; -use style::properties::PropertyDeclaration; -use style::properties::{is_supported_property, longhands_from_shorthand, parse_one_declaration}; -use util::str::DOMString; - use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::cell::Ref; use std::slice::SliceConcatExt; +use string_cache::Atom; +use style::properties::PropertyDeclaration; +use style::properties::{is_supported_property, longhands_from_shorthand, parse_one_declaration}; +use util::str::DOMString; // http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface #[dom_struct] diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs index 9ced7221078..ba0bb767408 100644 --- a/components/script/dom/dedicatedworkerglobalscope.rs +++ b/components/script/dom/dedicatedworkerglobalscope.rs @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use devtools; +use devtools_traits::DevtoolScriptControlMsg; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::DedicatedWorkerGlobalScopeBinding; use dom::bindings::codegen::Bindings::DedicatedWorkerGlobalScopeBinding::DedicatedWorkerGlobalScopeMethods; @@ -20,28 +21,24 @@ use dom::messageevent::MessageEvent; use dom::worker::{TrustedWorkerAddress, WorkerMessageHandler, SimpleWorkerErrorHandler}; use dom::workerglobalscope::WorkerGlobalScope; use dom::workerglobalscope::{WorkerGlobalScopeTypeId, WorkerGlobalScopeInit}; -use script_task::ScriptTaskEventCategory::WorkerEvent; -use script_task::{ScriptTask, ScriptChan, TimerSource, ScriptPort, StackRootTLS, CommonScriptMsg}; - -use devtools_traits::DevtoolScriptControlMsg; -use msg::constellation_msg::PipelineId; -use net_traits::load_whole_resource; -use util::task::spawn_named; -use util::task_state; -use util::task_state::{SCRIPT, IN_WORKER}; - use ipc_channel::ipc::IpcReceiver; use ipc_channel::router::ROUTER; use js::jsapi::{JSAutoRequest, JSAutoCompartment}; use js::jsapi::{JSContext, RootedValue, HandleValue}; use js::jsval::UndefinedValue; use js::rust::Runtime; -use url::Url; - +use msg::constellation_msg::PipelineId; +use net_traits::load_whole_resource; use rand::random; +use script_task::ScriptTaskEventCategory::WorkerEvent; +use script_task::{ScriptTask, ScriptChan, TimerSource, ScriptPort, StackRootTLS, CommonScriptMsg}; use std::mem::replace; use std::rc::Rc; use std::sync::mpsc::{Sender, Receiver, channel, Select, RecvError}; +use url::Url; +use util::task::spawn_named; +use util::task_state; +use util::task_state::{SCRIPT, IN_WORKER}; /// Messages used to control the worker event loops pub enum WorkerScriptMsg { diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index de4f6a8423e..fb67d8f84fd 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -66,8 +66,12 @@ use dom::text::Text; use dom::treewalker::TreeWalker; use dom::uievent::UIEvent; use dom::window::{Window, ReflowReason}; - +use euclid::point::Point2D; +use html5ever::tree_builder::{QuirksMode, NoQuirks, LimitedQuirks, Quirks}; +use ipc_channel::ipc::{self, IpcSender}; +use js::jsapi::{JSContext, JSObject, JSRuntime}; use layout_interface::{HitTestResponse, MouseOverResponse}; +use layout_interface::{LayoutChan, Msg}; use layout_interface::{ReflowGoal, ReflowQueryType}; use msg::compositor_msg::ScriptToCompositorMsg; use msg::constellation_msg::AnimationState; @@ -77,19 +81,9 @@ use msg::constellation_msg::{SUPER, ALT, SHIFT, CONTROL}; use net_traits::ControlMsg::{SetCookiesForUrl, GetCookiesForUrl}; use net_traits::CookieSource::NonHTTP; use net_traits::{Metadata, PendingAsyncLoad, AsyncResponseTarget}; +use num::ToPrimitive; use script_task::Runnable; use script_traits::{MouseButton, UntrustedNodeAddress}; -use util::str::{DOMString, split_html_space_chars}; - -use euclid::point::Point2D; -use html5ever::tree_builder::{QuirksMode, NoQuirks, LimitedQuirks, Quirks}; -use ipc_channel::ipc::{self, IpcSender}; -use js::jsapi::{JSContext, JSObject, JSRuntime}; -use layout_interface::{LayoutChan, Msg}; -use string_cache::{Atom, QualName}; -use url::Url; - -use num::ToPrimitive; use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::boxed::FnBox; @@ -101,7 +95,10 @@ use std::iter::FromIterator; use std::ptr; use std::rc::Rc; use std::sync::mpsc::channel; +use string_cache::{Atom, QualName}; use time; +use url::Url; +use util::str::{DOMString, split_html_space_chars}; #[derive(JSTraceable, PartialEq, HeapSizeOf)] pub enum IsHTMLDocument { diff --git a/components/script/dom/documenttype.rs b/components/script/dom/documenttype.rs index 0d91cdedb1a..a9f540592e9 100644 --- a/components/script/dom/documenttype.rs +++ b/components/script/dom/documenttype.rs @@ -11,9 +11,8 @@ use dom::bindings::js::Root; use dom::document::Document; use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::node::{Node, NodeTypeId}; -use util::str::DOMString; - use std::borrow::ToOwned; +use util::str::DOMString; // https://dom.spec.whatwg.org/#documenttype /// The `DOCTYPE` tag. diff --git a/components/script/dom/domexception.rs b/components/script/dom/domexception.rs index fdc4257a40d..19751284bcf 100644 --- a/components/script/dom/domexception.rs +++ b/components/script/dom/domexception.rs @@ -8,9 +8,8 @@ use dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods; use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::utils::{Reflector, reflect_dom_object}; -use util::str::DOMString; - use std::borrow::ToOwned; +use util::str::DOMString; #[repr(u16)] #[derive(JSTraceable, Copy, Clone, Debug, HeapSizeOf)] diff --git a/components/script/dom/domimplementation.rs b/components/script/dom/domimplementation.rs index 91b97487b4f..d66cba67bc0 100644 --- a/components/script/dom/domimplementation.rs +++ b/components/script/dom/domimplementation.rs @@ -21,9 +21,8 @@ use dom::htmlheadelement::HTMLHeadElement; use dom::htmlhtmlelement::HTMLHtmlElement; use dom::htmltitleelement::HTMLTitleElement; use dom::text::Text; -use util::str::DOMString; - use std::borrow::ToOwned; +use util::str::DOMString; // https://dom.spec.whatwg.org/#domimplementation #[dom_struct] diff --git a/components/script/dom/domparser.rs b/components/script/dom/domparser.rs index 00172fc398d..679e5b53a07 100644 --- a/components/script/dom/domparser.rs +++ b/components/script/dom/domparser.rs @@ -16,9 +16,8 @@ use dom::document::DocumentSource; use dom::document::{Document, IsHTMLDocument}; use dom::window::Window; use parse::html::{ParseContext, parse_html}; -use util::str::DOMString; - use std::borrow::ToOwned; +use util::str::DOMString; #[dom_struct] pub struct DOMParser { diff --git a/components/script/dom/domtokenlist.rs b/components/script/dom/domtokenlist.rs index 5c8af75f298..95c743664f9 100644 --- a/components/script/dom/domtokenlist.rs +++ b/components/script/dom/domtokenlist.rs @@ -12,12 +12,10 @@ use dom::bindings::js::{JS, Root}; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::element::Element; use dom::node::window_from_node; - +use std::borrow::ToOwned; use string_cache::Atom; use util::str::{DOMString, HTML_SPACE_CHARACTERS, str_join}; -use std::borrow::ToOwned; - #[dom_struct] pub struct DOMTokenList { reflector_: Reflector, diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 2cd65557bee..8132011a0fe 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -4,6 +4,8 @@ //! Element nodes. +use cssparser::Color; +use devtools_traits::AttrInfo; use dom::activation::Activatable; use dom::attr::AttrValue; use dom::attr::{Attr, AttrHelpersForLayout}; @@ -57,19 +59,6 @@ use dom::node::{document_from_node, NodeDamage}; use dom::node::{window_from_node}; use dom::nodelist::NodeList; use dom::virtualmethods::{VirtualMethods, vtable_for}; - -use devtools_traits::AttrInfo; -use smallvec::VecLike; -use style::legacy::{UnsignedIntegerAttribute, from_declaration}; -use style::properties::DeclaredValue; -use style::properties::longhands::{self, background_image, border_spacing, font_family}; -use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, parse_style_attribute}; -use style::values::CSSFloat; -use style::values::specified::{self, CSSColor, CSSRGBA}; -use util::geometry::Au; -use util::str::{DOMString, LengthOrPercentageOrAuto}; - -use cssparser::Color; use html5ever::serialize; use html5ever::serialize::SerializeOpts; use html5ever::serialize::TraversalScope; @@ -78,15 +67,23 @@ use html5ever::tree_builder::{NoQuirks, LimitedQuirks, Quirks}; use selectors::matching::{matches, DeclarationBlock}; use selectors::parser::parse_author_origin_selector_list_from_str; use selectors::parser::{AttrSelector, NamespaceConstraint}; -use string_cache::{Atom, Namespace, QualName}; -use url::UrlParser; - +use smallvec::VecLike; use std::ascii::AsciiExt; use std::borrow::{Cow, ToOwned}; use std::cell::{Ref, RefMut}; use std::default::Default; use std::mem; use std::sync::Arc; +use string_cache::{Atom, Namespace, QualName}; +use style::legacy::{UnsignedIntegerAttribute, from_declaration}; +use style::properties::DeclaredValue; +use style::properties::longhands::{self, background_image, border_spacing, font_family}; +use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, parse_style_attribute}; +use style::values::CSSFloat; +use style::values::specified::{self, CSSColor, CSSRGBA}; +use url::UrlParser; +use util::geometry::Au; +use util::str::{DOMString, LengthOrPercentageOrAuto}; #[dom_struct] pub struct Element { diff --git a/components/script/dom/errorevent.rs b/components/script/dom/errorevent.rs index af28a44d0dc..4ba68e3e334 100644 --- a/components/script/dom/errorevent.rs +++ b/components/script/dom/errorevent.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::ErrorEventBinding; use dom::bindings::codegen::Bindings::ErrorEventBinding::ErrorEventMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; @@ -10,16 +11,13 @@ use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; use dom::bindings::js::{Root, MutHeapJSVal}; use dom::bindings::trace::JSTraceable; -use js::jsapi::{JSContext, HandleValue}; - use dom::bindings::utils::reflect_dom_object; use dom::event::{Event, EventTypeId, EventBubbles, EventCancelable}; -use util::str::DOMString; - -use dom::bindings::cell::DOMRefCell; +use js::jsapi::{JSContext, HandleValue}; use js::jsval::JSVal; use std::borrow::ToOwned; use std::cell::Cell; +use util::str::DOMString; #[dom_struct] pub struct ErrorEvent { diff --git a/components/script/dom/event.rs b/components/script/dom/event.rs index 2cec78b48cc..c03324adb07 100644 --- a/components/script/dom/event.rs +++ b/components/script/dom/event.rs @@ -11,13 +11,11 @@ use dom::bindings::js::{JS, MutNullableHeap, Root}; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::eventtarget::EventTarget; use dom::uievent::{UIEventTypeId}; -use util::str::DOMString; - use std::borrow::ToOwned; use std::cell::Cell; use std::default::Default; - use time; +use util::str::DOMString; #[derive(JSTraceable, Copy, Clone, Debug, PartialEq, Eq)] #[repr(u16)] diff --git a/components/script/dom/eventdispatcher.rs b/components/script/dom/eventdispatcher.rs index f8cb7652529..254b4edb9de 100644 --- a/components/script/dom/eventdispatcher.rs +++ b/components/script/dom/eventdispatcher.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use devtools_traits::{StartedTimelineMarker, TimelineMarker, TimelineMarkerType}; use dom::bindings::callback::ExceptionHandling::Report; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast}; @@ -14,8 +15,6 @@ use dom::node::Node; use dom::virtualmethods::vtable_for; use dom::window::Window; -use devtools_traits::{StartedTimelineMarker, TimelineMarker, TimelineMarkerType}; - struct AutoDOMEventMarker { window: Root<Window>, marker: Option<StartedTimelineMarker>, diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs index c6f3db73d8c..145ff83abbf 100644 --- a/components/script/dom/eventtarget.rs +++ b/components/script/dom/eventtarget.rs @@ -17,16 +17,14 @@ use dom::node::NodeTypeId; use dom::virtualmethods::VirtualMethods; use dom::workerglobalscope::WorkerGlobalScopeTypeId; use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTargetTypeId; +use fnv::FnvHasher; use js::jsapi::{CompileFunction, JS_GetFunctionObject}; use js::jsapi::{JSAutoCompartment, JSAutoRequest}; use js::jsapi::{JSContext, RootedFunction, HandleObject}; use js::rust::{AutoObjectVectorWrapper, CompileOptionsWrapper}; -use util::mem::HeapSizeOf; -use util::str::DOMString; - -use fnv::FnvHasher; use libc::{c_char, size_t}; use std::borrow::ToOwned; +use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::hash_state::DefaultState; use std::default::Default; @@ -35,8 +33,8 @@ use std::intrinsics; use std::ptr; use std::rc::Rc; use url::Url; - -use std::collections::HashMap; +use util::mem::HeapSizeOf; +use util::str::DOMString; pub type EventHandler = EventHandlerNonNull; diff --git a/components/script/dom/formdata.rs b/components/script/dom/formdata.rs index 8631cefbd4a..d5dca833e17 100644 --- a/components/script/dom/formdata.rs +++ b/components/script/dom/formdata.rs @@ -15,11 +15,10 @@ use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::blob::Blob; use dom::file::File; use dom::htmlformelement::HTMLFormElement; -use util::str::DOMString; - use std::borrow::ToOwned; use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; +use util::str::DOMString; #[derive(JSTraceable, Clone)] #[must_root] diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index ebfd1c4deb0..20e40be62b9 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -22,14 +22,11 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId, document_from_node, window_from_node}; use dom::virtualmethods::VirtualMethods; - -use util::str::DOMString; - use num::ToPrimitive; +use std::default::Default; use string_cache::Atom; use url::UrlParser; - -use std::default::Default; +use util::str::DOMString; #[dom_struct] pub struct HTMLAnchorElement { diff --git a/components/script/dom/htmlappletelement.rs b/components/script/dom/htmlappletelement.rs index 988aa36e9ee..e865300fcc6 100644 --- a/components/script/dom/htmlappletelement.rs +++ b/components/script/dom/htmlappletelement.rs @@ -2,10 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use dom::attr::AttrValue; use dom::bindings::codegen::Bindings::HTMLAppletElementBinding; use dom::bindings::codegen::Bindings::HTMLAppletElementBinding::HTMLAppletElementMethods; - -use dom::attr::AttrValue; use dom::bindings::codegen::InheritTypes::HTMLAppletElementDerived; use dom::bindings::codegen::InheritTypes::HTMLElementCast; use dom::bindings::js::Root; @@ -15,7 +14,6 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use dom::virtualmethods::VirtualMethods; - use string_cache::Atom; use util::str::DOMString; diff --git a/components/script/dom/htmlareaelement.rs b/components/script/dom/htmlareaelement.rs index 02bd899c86c..caea7badf52 100644 --- a/components/script/dom/htmlareaelement.rs +++ b/components/script/dom/htmlareaelement.rs @@ -16,7 +16,6 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use dom::virtualmethods::VirtualMethods; - use std::default::Default; use string_cache::Atom; use util::str::DOMString; diff --git a/components/script/dom/htmlbaseelement.rs b/components/script/dom/htmlbaseelement.rs index 62db191aa05..b67ec9a9381 100644 --- a/components/script/dom/htmlbaseelement.rs +++ b/components/script/dom/htmlbaseelement.rs @@ -14,9 +14,8 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId, document_from_node}; use dom::virtualmethods::VirtualMethods; -use util::str::DOMString; - use url::{Url, UrlParser}; +use util::str::DOMString; #[dom_struct] pub struct HTMLBaseElement { diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs index a09825574a4..7b069f93f5a 100644 --- a/components/script/dom/htmlbodyelement.rs +++ b/components/script/dom/htmlbodyelement.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use cssparser::RGBA; use dom::attr::Attr; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; @@ -19,15 +20,12 @@ use dom::node::{Node, NodeTypeId, window_from_node, document_from_node}; use dom::virtualmethods::VirtualMethods; use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::Msg as ConstellationMsg; - -use cssparser::RGBA; -use url::{Url, UrlParser}; -use util::str::{self, DOMString}; - use std::borrow::ToOwned; use std::cell::Cell; use std::rc::Rc; use time; +use url::{Url, UrlParser}; +use util::str::{self, DOMString}; /// How long we should wait before performing the initial reflow after `<body>` is parsed, in /// nanoseconds. diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index 58d65c13ab5..ccbc409666b 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -19,7 +19,6 @@ use dom::htmlformelement::{SubmittedFrom}; use dom::node::{Node, NodeTypeId, document_from_node, window_from_node}; use dom::validitystate::ValidityState; use dom::virtualmethods::VirtualMethods; - use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::cell::Cell; diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index 123cf6b5e32..908baa2e5aa 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use canvas_traits::CanvasMsg; use dom::attr::Attr; use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding; use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding::HTMLCanvasElementMethods; @@ -20,17 +21,13 @@ use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom::webglrenderingcontext::{WebGLRenderingContext, LayoutCanvasWebGLRenderingContextHelpers}; - -use canvas_traits::CanvasMsg; +use euclid::size::Size2D; use ipc_channel::ipc::IpcSender; use js::jsapi::{JSContext, HandleValue}; use offscreen_gl_context::GLContextAttributes; -use util::str::{DOMString, parse_unsigned_integer}; - -use euclid::size::Size2D; - use std::cell::Cell; use std::default::Default; +use util::str::{DOMString, parse_unsigned_integer}; const DEFAULT_WIDTH: u32 = 300; const DEFAULT_HEIGHT: u32 = 150; diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs index b217151331a..40bc1f5c97a 100644 --- a/components/script/dom/htmlcollection.rs +++ b/components/script/dom/htmlcollection.rs @@ -12,10 +12,9 @@ use dom::bindings::utils::{namespace_from_domstring, Reflector, reflect_dom_obje use dom::element::Element; use dom::node::{Node, TreeIterator}; use dom::window::Window; -use util::str::{DOMString, split_html_space_chars}; - use std::ascii::AsciiExt; use string_cache::{Atom, Namespace}; +use util::str::{DOMString, split_html_space_chars}; pub trait CollectionFilter : JSTraceable { fn filter<'a>(&self, elem: &'a Element, root: &'a Node) -> bool; diff --git a/components/script/dom/htmldialogelement.rs b/components/script/dom/htmldialogelement.rs index 5754f5af114..9b47a51e359 100644 --- a/components/script/dom/htmldialogelement.rs +++ b/components/script/dom/htmldialogelement.rs @@ -12,10 +12,8 @@ use dom::element::ElementTypeId; use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; - -use util::str::DOMString; - use std::borrow::ToOwned; +use util::str::DOMString; #[dom_struct] pub struct HTMLDialogElement { diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index 9a02a47dd0f..7256c201af5 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -26,16 +26,13 @@ use dom::htmlmediaelement::HTMLMediaElementTypeId; use dom::htmltablecellelement::HTMLTableCellElementTypeId; use dom::node::{Node, NodeTypeId, document_from_node, window_from_node, SEQUENTIALLY_FOCUSABLE}; use dom::virtualmethods::VirtualMethods; - use msg::constellation_msg::FocusType; -use util::str::DOMString; - -use string_cache::Atom; - use std::borrow::ToOwned; use std::default::Default; use std::intrinsics; use std::rc::Rc; +use string_cache::Atom; +use util::str::DOMString; #[dom_struct] pub struct HTMLElement { diff --git a/components/script/dom/htmlfieldsetelement.rs b/components/script/dom/htmlfieldsetelement.rs index d3f438b5862..f4a54f253d7 100644 --- a/components/script/dom/htmlfieldsetelement.rs +++ b/components/script/dom/htmlfieldsetelement.rs @@ -16,7 +16,6 @@ use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId, window_from_node}; use dom::validitystate::ValidityState; use dom::virtualmethods::VirtualMethods; - use util::str::{DOMString, StaticStringVec}; #[dom_struct] diff --git a/components/script/dom/htmlfontelement.rs b/components/script/dom/htmlfontelement.rs index bee1711916e..030d1638c7e 100644 --- a/components/script/dom/htmlfontelement.rs +++ b/components/script/dom/htmlfontelement.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use cssparser::RGBA; use dom::attr::{Attr, AttrValue}; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::HTMLFontElementBinding; @@ -14,12 +15,10 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use dom::virtualmethods::VirtualMethods; +use std::cell::Cell; use string_cache::Atom; use util::str::{self, DOMString}; -use cssparser::RGBA; -use std::cell::Cell; - #[dom_struct] pub struct HTMLFontElement { htmlelement: HTMLElement, diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 22c2cad779c..5cdc1ce1be7 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -32,14 +32,13 @@ use hyper::method::Method; use hyper::mime; use msg::constellation_msg::LoadData; use script_task::{ScriptChan, MainThreadScriptMsg}; +use std::borrow::ToOwned; +use std::cell::Cell; use string_cache::Atom; use url::UrlParser; use url::form_urlencoded::serialize; use util::str::DOMString; -use std::borrow::ToOwned; -use std::cell::Cell; - #[dom_struct] pub struct HTMLFormElement { htmlelement: HTMLElement, diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index b925e1ffee4..546fb79b47f 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -24,21 +24,19 @@ use dom::node::{Node, NodeTypeId, window_from_node}; use dom::urlhelper::UrlHelper; use dom::virtualmethods::VirtualMethods; use dom::window::Window; -use page::IterablePage; - +use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment}; +use js::jsval::UndefinedValue; use msg::constellation_msg::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed}; use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::{PipelineId, SubpageId, ConstellationChan, MozBrowserEvent, NavigationDirection}; -use string_cache::Atom; -use util::prefs; -use util::str::DOMString; - -use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment}; -use js::jsval::UndefinedValue; +use page::IterablePage; use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::cell::Cell; +use string_cache::Atom; use url::{Url, UrlParser}; +use util::prefs; +use util::str::DOMString; use util::str::{self, LengthOrPercentageOrAuto}; pub fn mozbrowser_enabled() -> bool { diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index 146043d211f..a305b9ee91a 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -21,19 +21,17 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{document_from_node, Node, NodeTypeId, NodeDamage, window_from_node}; use dom::virtualmethods::VirtualMethods; -use script_task::ScriptTaskEventCategory::UpdateReplacedElement; -use script_task::{Runnable, ScriptChan, CommonScriptMsg}; -use string_cache::Atom; -use util::str::DOMString; - use ipc_channel::ipc; use ipc_channel::router::ROUTER; use net_traits::image::base::Image; use net_traits::image_cache_task::{ImageResponder, ImageResponse}; -use url::{Url, UrlParser}; - +use script_task::ScriptTaskEventCategory::UpdateReplacedElement; +use script_task::{Runnable, ScriptChan, CommonScriptMsg}; use std::borrow::ToOwned; use std::sync::Arc; +use string_cache::Atom; +use url::{Url, UrlParser}; +use util::str::DOMString; #[dom_struct] pub struct HTMLImageElement { diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 51b9a3c54f0..766e3e7e0d5 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -27,16 +27,14 @@ use dom::node::{Node, NodeDamage, NodeTypeId}; use dom::node::{document_from_node, window_from_node}; use dom::virtualmethods::VirtualMethods; use msg::constellation_msg::ConstellationChan; +use std::borrow::ToOwned; +use std::cell::Cell; +use string_cache::Atom; use textinput::KeyReaction::{TriggerDefaultAction, DispatchInput, Nothing, RedrawSelection}; use textinput::Lines::Single; use textinput::{TextInput, TextPoint}; - -use string_cache::Atom; use util::str::DOMString; -use std::borrow::ToOwned; -use std::cell::Cell; - const DEFAULT_SUBMIT_VALUE: &'static str = "Submit"; const DEFAULT_RESET_VALUE: &'static str = "Reset"; diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index 87303ae8131..907b70af3e3 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -26,14 +26,13 @@ use layout_interface::{LayoutChan, Msg}; use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::Msg as ConstellationMsg; use script_traits::StylesheetLoadResponder; -use style::media_queries::parse_media_query_list; -use util::str::{DOMString, HTML_SPACE_CHARACTERS}; - use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::default::Default; use string_cache::Atom; +use style::media_queries::parse_media_query_list; use url::UrlParser; +use util::str::{DOMString, HTML_SPACE_CHARACTERS}; #[dom_struct] pub struct HTMLLinkElement { diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs index 04c5228072b..ac063d12f00 100644 --- a/components/script/dom/htmlobjectelement.rs +++ b/components/script/dom/htmlobjectelement.rs @@ -16,7 +16,6 @@ use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId, window_from_node}; use dom::validitystate::ValidityState; use dom::virtualmethods::VirtualMethods; - use net_traits::image::base::Image; use std::sync::Arc; use util::str::DOMString; diff --git a/components/script/dom/htmloptgroupelement.rs b/components/script/dom/htmloptgroupelement.rs index 3765c8fcb43..6a139a03c34 100644 --- a/components/script/dom/htmloptgroupelement.rs +++ b/components/script/dom/htmloptgroupelement.rs @@ -14,7 +14,6 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use dom::virtualmethods::VirtualMethods; - use util::str::DOMString; #[dom_struct] diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs index b9855f84eb7..132de2335b2 100644 --- a/components/script/dom/htmloptionelement.rs +++ b/components/script/dom/htmloptionelement.rs @@ -17,7 +17,6 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use dom::virtualmethods::VirtualMethods; - use util::str::{DOMString, split_html_space_chars}; #[dom_struct] diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index 815ef46ea64..5dae52c2b47 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -2,8 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use std::ascii::AsciiExt; - use document_loader::LoadType; use dom::attr::Attr; use dom::bindings::cell::DOMRefCell; @@ -29,19 +27,19 @@ use dom::node::{ChildrenMutation, CloneChildrenFlag, Node}; use dom::node::{NodeTypeId, document_from_node, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom::window::ScriptHelpers; -use js::jsapi::RootedValue; -use js::jsval::UndefinedValue; -use network_listener::{NetworkListener, PreInvoke}; -use script_task::ScriptTaskEventCategory::ScriptEvent; -use script_task::{ScriptChan, Runnable, CommonScriptMsg}; - use encoding::all::UTF_8; use encoding::label::encoding_from_whatwg_label; use encoding::types::{Encoding, EncodingRef, DecoderTrap}; use html5ever::tree_builder::NextParserState; use ipc_channel::ipc; use ipc_channel::router::ROUTER; +use js::jsapi::RootedValue; +use js::jsval::UndefinedValue; use net_traits::{Metadata, AsyncResponseListener, AsyncResponseTarget}; +use network_listener::{NetworkListener, PreInvoke}; +use script_task::ScriptTaskEventCategory::ScriptEvent; +use script_task::{ScriptChan, Runnable, CommonScriptMsg}; +use std::ascii::AsciiExt; use std::cell::{RefCell, Cell}; use std::mem; use std::sync::{Arc, Mutex}; diff --git a/components/script/dom/htmlselectelement.rs b/components/script/dom/htmlselectelement.rs index b71760fdc09..c4a503cc404 100644 --- a/components/script/dom/htmlselectelement.rs +++ b/components/script/dom/htmlselectelement.rs @@ -17,12 +17,10 @@ use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId, window_from_node}; use dom::validitystate::ValidityState; use dom::virtualmethods::VirtualMethods; - +use std::borrow::ToOwned; use string_cache::Atom; use util::str::DOMString; -use std::borrow::ToOwned; - #[dom_struct] pub struct HTMLSelectElement { htmlelement: HTMLElement diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs index 15c1acf3737..2705240edbb 100644 --- a/components/script/dom/htmltablecellelement.rs +++ b/components/script/dom/htmltablecellelement.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use cssparser::RGBA; use dom::attr::{Attr, AttrValue}; use dom::bindings::codegen::Bindings::HTMLTableCellElementBinding::HTMLTableCellElementMethods; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLTableCellElementDerived}; @@ -11,14 +12,10 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::NodeTypeId; use dom::virtualmethods::VirtualMethods; - -use util::str::{self, DOMString, LengthOrPercentageOrAuto}; - -use cssparser::RGBA; -use string_cache::Atom; - use std::cell::Cell; use std::cmp::max; +use string_cache::Atom; +use util::str::{self, DOMString, LengthOrPercentageOrAuto}; const DEFAULT_COLSPAN: u32 = 1; diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs index e5788bd0e56..6a63223d09d 100644 --- a/components/script/dom/htmltableelement.rs +++ b/components/script/dom/htmltableelement.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use cssparser::RGBA; use dom::attr::{Attr, AttrValue}; use dom::bindings::codegen::Bindings::HTMLTableElementBinding; use dom::bindings::codegen::Bindings::HTMLTableElementBinding::HTMLTableElementMethods; @@ -18,13 +19,9 @@ use dom::htmltablecaptionelement::HTMLTableCaptionElement; use dom::htmltablesectionelement::HTMLTableSectionElement; use dom::node::{Node, NodeTypeId, document_from_node}; use dom::virtualmethods::VirtualMethods; - -use util::str::{self, DOMString, LengthOrPercentageOrAuto}; - -use cssparser::RGBA; -use string_cache::Atom; - use std::cell::Cell; +use string_cache::Atom; +use util::str::{self, DOMString, LengthOrPercentageOrAuto}; #[dom_struct] pub struct HTMLTableElement { diff --git a/components/script/dom/htmltablerowelement.rs b/components/script/dom/htmltablerowelement.rs index 93a4fddc094..5c03a8e045b 100644 --- a/components/script/dom/htmltablerowelement.rs +++ b/components/script/dom/htmltablerowelement.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use cssparser::RGBA; use dom::attr::Attr; use dom::bindings::codegen::Bindings::HTMLTableRowElementBinding; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLTableRowElementDerived}; @@ -12,8 +13,6 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use dom::virtualmethods::VirtualMethods; - -use cssparser::RGBA; use std::cell::Cell; use util::str::{self, DOMString}; diff --git a/components/script/dom/htmltablesectionelement.rs b/components/script/dom/htmltablesectionelement.rs index 137d25541fa..8c1eddaa389 100644 --- a/components/script/dom/htmltablesectionelement.rs +++ b/components/script/dom/htmltablesectionelement.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use cssparser::RGBA; use dom::attr::Attr; use dom::bindings::codegen::Bindings::HTMLTableSectionElementBinding; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLTableSectionElementDerived}; @@ -12,8 +13,6 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use dom::virtualmethods::VirtualMethods; - -use cssparser::RGBA; use std::cell::Cell; use util::str::{self, DOMString}; diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index fd1713057ee..4234d71b86f 100644 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -27,13 +27,11 @@ use dom::virtualmethods::VirtualMethods; use msg::constellation_msg::ConstellationChan; use script_task::ScriptTaskEventCategory::InputEvent; use script_task::{Runnable, CommonScriptMsg}; -use textinput::{TextInput, Lines, KeyReaction}; - -use string_cache::Atom; -use util::str::DOMString; - use std::borrow::ToOwned; use std::cell::Cell; +use string_cache::Atom; +use textinput::{TextInput, Lines, KeyReaction}; +use util::str::DOMString; #[dom_struct] pub struct HTMLTextAreaElement { diff --git a/components/script/dom/keyboardevent.rs b/components/script/dom/keyboardevent.rs index 1c8b6255aaa..8aca9b33ae8 100644 --- a/components/script/dom/keyboardevent.rs +++ b/components/script/dom/keyboardevent.rs @@ -16,10 +16,9 @@ use dom::window::Window; use msg::constellation_msg; use msg::constellation_msg::{Key, KeyModifiers}; use msg::constellation_msg::{SHIFT, CONTROL, ALT, SUPER}; -use util::str::DOMString; - use std::borrow::ToOwned; use std::cell::{RefCell, Cell}; +use util::str::DOMString; no_jsmanaged_fields!(Key); diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs index 8b5cf37965e..488fbc973a3 100644 --- a/components/script/dom/location.rs +++ b/components/script/dom/location.rs @@ -11,7 +11,6 @@ use dom::bindings::str::USVString; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::urlhelper::UrlHelper; use dom::window::Window; - use url::{Url, UrlParser}; use util::str::DOMString; diff --git a/components/script/dom/messageevent.rs b/components/script/dom/messageevent.rs index 57b185464bb..895ebfcf1a9 100644 --- a/components/script/dom/messageevent.rs +++ b/components/script/dom/messageevent.rs @@ -12,14 +12,11 @@ use dom::bindings::js::Root; use dom::bindings::utils::reflect_dom_object; use dom::event::{Event, EventTypeId}; use dom::eventtarget::EventTarget; - -use util::str::DOMString; - use js::jsapi::{JSContext, Heap, HandleValue}; use js::jsval::JSVal; - use std::borrow::ToOwned; use std::default::Default; +use util::str::DOMString; #[dom_struct] pub struct MessageEvent { diff --git a/components/script/dom/namednodemap.rs b/components/script/dom/namednodemap.rs index 6989706f64f..485cccf6ab5 100644 --- a/components/script/dom/namednodemap.rs +++ b/components/script/dom/namednodemap.rs @@ -11,9 +11,8 @@ use dom::bindings::js::{JS, Root}; use dom::bindings::utils::{namespace_from_domstring, Reflector, reflect_dom_object}; use dom::element::Element; use dom::window::Window; -use util::str::DOMString; - use string_cache::Atom; +use util::str::DOMString; #[dom_struct] pub struct NamedNodeMap { diff --git a/components/script/dom/navigatorinfo.rs b/components/script/dom/navigatorinfo.rs index d47b02f21dd..a3857f29844 100644 --- a/components/script/dom/navigatorinfo.rs +++ b/components/script/dom/navigatorinfo.rs @@ -2,11 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use std::borrow::ToOwned; use util::opts; use util::str::DOMString; -use std::borrow::ToOwned; - pub fn Product() -> DOMString { "Gecko".to_owned() } diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index ae725d3d856..c93c5bbe65b 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -4,6 +4,7 @@ //! The core DOM types. Defines the basic DOM hierarchy as well as all the HTML elements. +use core::nonzero::NonZero; use devtools_traits::NodeInfo; use document_loader::DocumentLoader; use dom::attr::Attr; @@ -46,21 +47,15 @@ use dom::text::Text; use dom::virtualmethods::{VirtualMethods, vtable_for}; use dom::window::Window; use euclid::rect::Rect; +use js::jsapi::{JSContext, JSObject, JSRuntime}; use layout_interface::{LayoutChan, Msg}; +use libc; +use libc::{uintptr_t, c_void}; use parse::html::parse_html_fragment; use script_traits::UntrustedNodeAddress; use selectors::matching::matches; use selectors::parser::Selector; use selectors::parser::parse_author_origin_selector_list_from_str; -use style::properties::ComputedValues; -use util::geometry::Au; -use util::str::DOMString; -use util::task_state; - -use core::nonzero::NonZero; -use js::jsapi::{JSContext, JSObject, JSRuntime}; -use libc; -use libc::{uintptr_t, c_void}; use std::borrow::ToOwned; use std::cell::{Cell, RefCell, Ref, RefMut}; use std::default::Default; @@ -69,6 +64,10 @@ use std::mem; use std::slice::ref_slice; use std::sync::Arc; use string_cache::{Atom, Namespace, QualName}; +use style::properties::ComputedValues; +use util::geometry::Au; +use util::str::DOMString; +use util::task_state; use uuid; // diff --git a/components/script/dom/nodeiterator.rs b/components/script/dom/nodeiterator.rs index e81262de32f..34ec3f6c658 100644 --- a/components/script/dom/nodeiterator.rs +++ b/components/script/dom/nodeiterator.rs @@ -14,7 +14,6 @@ use dom::bindings::js::{JS, MutHeap, Root}; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::document::Document; use dom::node::Node; - use std::cell::Cell; use std::rc::Rc; diff --git a/components/script/dom/nodelist.rs b/components/script/dom/nodelist.rs index 3e2bc5145c6..d997cad2558 100644 --- a/components/script/dom/nodelist.rs +++ b/components/script/dom/nodelist.rs @@ -10,7 +10,6 @@ use dom::bindings::js::{JS, MutNullableHeap, Root}; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::node::{ChildrenMutation, Node}; use dom::window::Window; - use std::cell::Cell; #[derive(JSTraceable, HeapSizeOf)] diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs index 1b29c7333da..3373d129169 100644 --- a/components/script/dom/range.rs +++ b/components/script/dom/range.rs @@ -20,7 +20,6 @@ use dom::characterdata::CharacterDataTypeId; use dom::document::Document; use dom::documentfragment::DocumentFragment; use dom::node::{Node, NodeTypeId}; - use std::cell::RefCell; use std::cmp::{Ord, Ordering, PartialEq, PartialOrd}; use std::rc::Rc; diff --git a/components/script/dom/servohtmlparser.rs b/components/script/dom/servohtmlparser.rs index 75d060ddf29..b5eaa321473 100644 --- a/components/script/dom/servohtmlparser.rs +++ b/components/script/dom/servohtmlparser.rs @@ -18,13 +18,6 @@ use dom::document::Document; use dom::node::{window_from_node, Node}; use dom::text::Text; use dom::window::Window; -use network_listener::PreInvoke; -use parse::Parser; -use script_task::{ScriptTask, ScriptChan}; - -use msg::constellation_msg::{PipelineId, SubpageId}; -use net_traits::{Metadata, AsyncResponseListener}; - use encoding::all::UTF_8; use encoding::types::{Encoding, DecoderTrap}; use html5ever::tokenizer; @@ -33,6 +26,11 @@ use html5ever::tree_builder::{NodeOrText, TreeBuilder, TreeBuilderOpts}; use hyper::header::ContentType; use hyper::mime::{Mime, TopLevel, SubLevel}; use js::jsapi::JSTracer; +use msg::constellation_msg::{PipelineId, SubpageId}; +use net_traits::{Metadata, AsyncResponseListener}; +use network_listener::PreInvoke; +use parse::Parser; +use script_task::{ScriptTask, ScriptChan}; use std::cell::{Cell, RefCell}; use std::default::Default; use url::Url; diff --git a/components/script/dom/storageevent.rs b/components/script/dom/storageevent.rs index 3b623390e46..db5b8a0f608 100644 --- a/components/script/dom/storageevent.rs +++ b/components/script/dom/storageevent.rs @@ -5,7 +5,6 @@ use dom::bindings::codegen::Bindings::EventBinding::{EventMethods}; use dom::bindings::codegen::Bindings::StorageEventBinding; use dom::bindings::codegen::Bindings::StorageEventBinding::{StorageEventMethods}; - use dom::bindings::codegen::InheritTypes::{EventCast}; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index e050f799c8f..93285b1ea35 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -20,14 +20,12 @@ use dom::bindings::num::Finite; use dom::bindings::str::{ByteString, USVString}; use dom::bindings::utils::Reflector; use dom::blob::Blob; -use util::str::DOMString; - use js::jsapi::{JSContext, JSObject, HandleValue}; use js::jsval::{JSVal, NullValue}; - use std::borrow::ToOwned; use std::ptr; use std::rc::Rc; +use util::str::DOMString; #[dom_struct] pub struct TestBinding { diff --git a/components/script/dom/textdecoder.rs b/components/script/dom/textdecoder.rs index e058562bebb..cecb84a73ac 100644 --- a/components/script/dom/textdecoder.rs +++ b/components/script/dom/textdecoder.rs @@ -10,18 +10,15 @@ use dom::bindings::js::Root; use dom::bindings::str::USVString; use dom::bindings::trace::JSTraceable; use dom::bindings::utils::{Reflector, reflect_dom_object}; - -use util::str::DOMString; - use encoding::Encoding; use encoding::label::encoding_from_whatwg_label; use encoding::types::{EncodingRef, DecoderTrap}; use js::jsapi::JS_GetObjectAsArrayBufferView; use js::jsapi::{JSContext, JSObject}; - use std::borrow::ToOwned; use std::ptr; use std::slice; +use util::str::DOMString; #[dom_struct] pub struct TextDecoder { diff --git a/components/script/dom/textencoder.rs b/components/script/dom/textencoder.rs index 7144ad77330..8e0e5daa55e 100644 --- a/components/script/dom/textencoder.rs +++ b/components/script/dom/textencoder.rs @@ -10,19 +10,15 @@ use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::str::USVString; use dom::bindings::utils::{Reflector, reflect_dom_object}; - -use util::str::DOMString; - -use std::borrow::ToOwned; -use std::ptr; - use encoding::label::encoding_from_whatwg_label; use encoding::types::EncodingRef; use encoding::{Encoding, EncoderTrap}; - use js::jsapi::{JSContext, JSObject}; use js::jsapi::{JS_NewUint8Array, JS_GetUint8ArrayData}; use libc::uint8_t; +use std::borrow::ToOwned; +use std::ptr; +use util::str::DOMString; #[dom_struct] pub struct TextEncoder { diff --git a/components/script/dom/uievent.rs b/components/script/dom/uievent.rs index ff9c2beab6b..28434e0a9f8 100644 --- a/components/script/dom/uievent.rs +++ b/components/script/dom/uievent.rs @@ -10,14 +10,12 @@ use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::js::{JS, MutNullableHeap, RootedReference}; - use dom::bindings::utils::reflect_dom_object; use dom::event::{Event, EventTypeId, EventBubbles, EventCancelable}; use dom::window::Window; -use util::str::DOMString; - use std::cell::Cell; use std::default::Default; +use util::str::DOMString; #[derive(JSTraceable, PartialEq, HeapSizeOf)] pub enum UIEventTypeId { diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs index f34428d4bbb..4a3bb19a776 100644 --- a/components/script/dom/url.rs +++ b/components/script/dom/url.rs @@ -9,12 +9,10 @@ use dom::bindings::js::Root; use dom::bindings::str::USVString; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::urlhelper::UrlHelper; - -use url::{Host, ParseResult, Url, UrlParser}; -use util::str::DOMString; - use std::borrow::ToOwned; use std::cell::RefCell; +use url::{Host, ParseResult, Url, UrlParser}; +use util::str::DOMString; // https://url.spec.whatwg.org/#url #[dom_struct] diff --git a/components/script/dom/urlhelper.rs b/components/script/dom/urlhelper.rs index 684d6666e0c..61d81890fdf 100644 --- a/components/script/dom/urlhelper.rs +++ b/components/script/dom/urlhelper.rs @@ -3,13 +3,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::str::USVString; - -use url::{Url, UrlParser, SchemeData}; - -use url::urlutils::{UrlUtils, UrlUtilsWrapper}; - use std::borrow::ToOwned; use std::fmt::Write; +use url::urlutils::{UrlUtils, UrlUtilsWrapper}; +use url::{Url, UrlParser, SchemeData}; #[derive(HeapSizeOf)] pub struct UrlHelper; diff --git a/components/script/dom/urlsearchparams.rs b/components/script/dom/urlsearchparams.rs index 3c5b7800434..37fa56da04b 100644 --- a/components/script/dom/urlsearchparams.rs +++ b/components/script/dom/urlsearchparams.rs @@ -11,7 +11,6 @@ use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::utils::{Reflector, reflect_dom_object}; - use encoding::types::EncodingRef; use url::form_urlencoded::{parse, serialize_with_encoding}; use util::str::DOMString; diff --git a/components/script/dom/virtualmethods.rs b/components/script/dom/virtualmethods.rs index 135670cbbc3..137843fb5ff 100644 --- a/components/script/dom/virtualmethods.rs +++ b/components/script/dom/virtualmethods.rs @@ -39,10 +39,9 @@ use dom::event::Event; use dom::htmlelement::HTMLElementTypeId; use dom::node::NodeTypeId; use dom::node::{ChildrenMutation, CloneChildrenFlag, Node}; - +use string_cache::Atom; use util::str::DOMString; -use string_cache::Atom; /// Trait to allow DOM nodes to opt-in to overriding (or adding to) common /// behaviours. Replicates the effect of C++ virtual methods. diff --git a/components/script/dom/webglbuffer.rs b/components/script/dom/webglbuffer.rs index e5fc0295a90..05f8d7263bb 100644 --- a/components/script/dom/webglbuffer.rs +++ b/components/script/dom/webglbuffer.rs @@ -3,13 +3,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl +use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLError, WebGLResult}; use dom::bindings::codegen::Bindings::WebGLBufferBinding; use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::utils::reflect_dom_object; use dom::webglobject::WebGLObject; - -use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLError, WebGLResult}; use ipc_channel::ipc::{self, IpcSender}; use std::cell::Cell; diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs index c387fc2d711..a3a9781fbfb 100644 --- a/components/script/dom/webglframebuffer.rs +++ b/components/script/dom/webglframebuffer.rs @@ -3,13 +3,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl +use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLFramebufferBindingRequest}; use dom::bindings::codegen::Bindings::WebGLFramebufferBinding; use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::utils::reflect_dom_object; use dom::webglobject::WebGLObject; - -use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLFramebufferBindingRequest}; use ipc_channel::ipc::{self, IpcSender}; use std::cell::Cell; diff --git a/components/script/dom/webglprogram.rs b/components/script/dom/webglprogram.rs index 2a1a0cfc6a5..231a16017c0 100644 --- a/components/script/dom/webglprogram.rs +++ b/components/script/dom/webglprogram.rs @@ -3,17 +3,15 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl +use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLResult, WebGLError}; use dom::bindings::codegen::Bindings::WebGLProgramBinding; +use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, MutNullableHeap, Root}; use dom::bindings::utils::reflect_dom_object; use dom::webglobject::WebGLObject; use dom::webglrenderingcontext::MAX_UNIFORM_AND_ATTRIBUTE_LEN; use dom::webglshader::WebGLShader; - -use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; - -use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLResult, WebGLError}; use ipc_channel::ipc::{self, IpcSender}; use std::cell::Cell; diff --git a/components/script/dom/webglrenderbuffer.rs b/components/script/dom/webglrenderbuffer.rs index a8d963894b6..b01bcce896a 100644 --- a/components/script/dom/webglrenderbuffer.rs +++ b/components/script/dom/webglrenderbuffer.rs @@ -3,13 +3,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl +use canvas_traits::{CanvasMsg, CanvasWebGLMsg}; use dom::bindings::codegen::Bindings::WebGLRenderbufferBinding; use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::utils::reflect_dom_object; use dom::webglobject::WebGLObject; - -use canvas_traits::{CanvasMsg, CanvasWebGLMsg}; use ipc_channel::ipc::{self, IpcSender}; use std::cell::Cell; diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 64e59cd4ee7..da77c58a565 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -10,7 +10,6 @@ use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{WebGLRender use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes}; use dom::bindings::codegen::InheritTypes::NodeCast; use dom::bindings::codegen::UnionTypes::ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement; - use dom::bindings::conversions::ToJSValConvertible; use dom::bindings::global::{GlobalRef, GlobalField}; use dom::bindings::js::{JS, LayoutJS, Root}; @@ -30,11 +29,10 @@ use ipc_channel::ipc::{self, IpcSender}; use js::jsapi::{JSContext, JSObject, RootedValue}; use js::jsapi::{JS_GetFloat32ArrayData, JS_GetObjectAsArrayBufferView}; use js::jsval::{JSVal, UndefinedValue, NullValue, Int32Value, BooleanValue}; - use msg::constellation_msg::Msg as ConstellationMsg; use net_traits::image::base::PixelFormat; use net_traits::image_cache_task::ImageResponse; - +use offscreen_gl_context::GLContextAttributes; use std::cell::Cell; use std::mem; use std::ptr; @@ -43,8 +41,6 @@ use std::sync::mpsc::channel; use util::str::DOMString; use util::vec::byte_swap; -use offscreen_gl_context::GLContextAttributes; - pub const MAX_UNIFORM_AND_ATTRIBUTE_LEN: usize = 256; macro_rules! handle_potential_webgl_error { diff --git a/components/script/dom/webglshader.rs b/components/script/dom/webglshader.rs index bcad061853f..fcaf3578b02 100644 --- a/components/script/dom/webglshader.rs +++ b/components/script/dom/webglshader.rs @@ -3,16 +3,14 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl +use angle::hl::{BuiltInResources, Output, ShaderValidator}; +use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLResult, WebGLError, WebGLShaderParameter}; +use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::codegen::Bindings::WebGLShaderBinding; use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::utils::reflect_dom_object; use dom::webglobject::WebGLObject; - -use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; - -use angle::hl::{BuiltInResources, Output, ShaderValidator}; -use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLResult, WebGLError, WebGLShaderParameter}; use ipc_channel::ipc::{self, IpcSender}; use std::cell::Cell; use std::cell::RefCell; diff --git a/components/script/dom/webgltexture.rs b/components/script/dom/webgltexture.rs index 6bb91217bbd..fb8ee4033fd 100644 --- a/components/script/dom/webgltexture.rs +++ b/components/script/dom/webgltexture.rs @@ -3,14 +3,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl +use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLError, WebGLResult}; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::codegen::Bindings::WebGLTextureBinding; use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::utils::reflect_dom_object; use dom::webglobject::WebGLObject; - -use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLError, WebGLResult}; use ipc_channel::ipc::{self, IpcSender}; use std::cell::Cell; diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs index 2bf84d609e7..4dc3d84c536 100644 --- a/components/script/dom/websocket.rs +++ b/components/script/dom/websocket.rs @@ -22,18 +22,20 @@ use dom::closeevent::CloseEvent; use dom::event::{Event, EventBubbles, EventCancelable}; use dom::eventtarget::EventTarget; use dom::messageevent::MessageEvent; -use script_task::ScriptTaskEventCategory::WebSocketEvent; -use script_task::{Runnable, CommonScriptMsg}; - -use net_traits::hosts::replace_hosts; -use util::str::DOMString; -use util::task::spawn_named; - use hyper::header::Host; use js::jsapi::{JS_NewArrayBuffer, JS_GetArrayBufferData}; use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment}; use js::jsval::UndefinedValue; use libc::{uint8_t, uint32_t}; +use net_traits::hosts::replace_hosts; +use script_task::ScriptTaskEventCategory::WebSocketEvent; +use script_task::{Runnable, CommonScriptMsg}; +use std::borrow::ToOwned; +use std::cell::{Cell, RefCell}; +use std::ptr; +use std::sync::{Arc, Mutex}; +use util::str::DOMString; +use util::task::spawn_named; use websocket::Client; use websocket::Message; use websocket::client::receiver::Receiver; @@ -46,11 +48,6 @@ use websocket::ws::receiver::Receiver as WSReceiver; use websocket::ws::sender::Sender as Sender_Object; use websocket::ws::util::url::parse_url; -use std::borrow::ToOwned; -use std::cell::{Cell, RefCell}; -use std::ptr; -use std::sync::{Arc, Mutex}; - #[derive(JSTraceable, PartialEq, Copy, Clone, Debug, HeapSizeOf)] enum WebSocketRequestState { Connecting = 0, diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 16c146f91fe..583f3b68780 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType}; use dom::bindings::callback::ExceptionHandling; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; @@ -31,28 +32,6 @@ use dom::node::{window_from_node, TrustedNodeAddress, from_untrusted_node_addres use dom::performance::Performance; use dom::screen::Screen; use dom::storage::Storage; -use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow}; -use layout_interface::{ReflowGoal, ReflowQueryType, LayoutRPC, LayoutChan, Reflow, Msg}; -use page::Page; -use script_task::{SendableMainThreadScriptChan, MainThreadScriptChan}; -use script_task::{TimerSource, ScriptChan, ScriptPort, MainThreadScriptMsg}; -use script_traits::ConstellationControlMsg; -use timers::{IsInterval, TimerId, TimerManager, TimerCallback}; -use webdriver_handlers::jsval_to_webdriver; - -use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType}; -use msg::compositor_msg::{ScriptToCompositorMsg, LayerId}; -use msg::constellation_msg::{LoadData, PipelineId, SubpageId, ConstellationChan, WindowSizeData, WorkerId}; -use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult}; -use net_traits::ResourceTask; -use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask}; -use net_traits::storage_task::{StorageTask, StorageType}; -use profile_traits::mem; -use string_cache::Atom; -use util::geometry::{self, Au, MAX_RECT}; -use util::str::{DOMString, HTML_SPACE_CHARACTERS}; -use util::{breakpoint, opts}; - use euclid::{Point2D, Rect, Size2D}; use ipc_channel::ipc::{self, IpcSender}; use js::jsapi::{Evaluate2, MutableHandleValue}; @@ -60,12 +39,23 @@ use js::jsapi::{JSContext, HandleValue}; use js::jsapi::{JS_GC, JS_GetRuntime, JSAutoCompartment, JSAutoRequest}; use js::rust::CompileOptionsWrapper; use js::rust::Runtime; -use selectors::parser::PseudoElement; -use url::Url; - +use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow}; +use layout_interface::{ReflowGoal, ReflowQueryType, LayoutRPC, LayoutChan, Reflow, Msg}; use libc; +use msg::compositor_msg::{ScriptToCompositorMsg, LayerId}; +use msg::constellation_msg::{LoadData, PipelineId, SubpageId, ConstellationChan, WindowSizeData, WorkerId}; +use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult}; +use net_traits::ResourceTask; +use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask}; +use net_traits::storage_task::{StorageTask, StorageType}; use num::traits::ToPrimitive; +use page::Page; +use profile_traits::mem; use rustc_serialize::base64::{FromBase64, ToBase64, STANDARD}; +use script_task::{SendableMainThreadScriptChan, MainThreadScriptChan}; +use script_task::{TimerSource, ScriptChan, ScriptPort, MainThreadScriptMsg}; +use script_traits::ConstellationControlMsg; +use selectors::parser::PseudoElement; use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::cell::{Cell, Ref, RefCell}; @@ -78,7 +68,14 @@ use std::rc::Rc; use std::sync::Arc; use std::sync::mpsc::TryRecvError::{Empty, Disconnected}; use std::sync::mpsc::{channel, Receiver, Sender}; +use string_cache::Atom; use time; +use timers::{IsInterval, TimerId, TimerManager, TimerCallback}; +use url::Url; +use util::geometry::{self, Au, MAX_RECT}; +use util::str::{DOMString, HTML_SPACE_CHARACTERS}; +use util::{breakpoint, opts}; +use webdriver_handlers::jsval_to_webdriver; /// Current state of the window object #[derive(JSTraceable, Copy, Clone, Debug, PartialEq, HeapSizeOf)] diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs index 92053392db7..efbde8eee1a 100644 --- a/components/script/dom/worker.rs +++ b/components/script/dom/worker.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use devtools_traits::{DevtoolsPageInfo, ScriptToDevtoolsControlMsg}; use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; use dom::bindings::codegen::Bindings::WorkerBinding; use dom::bindings::codegen::Bindings::WorkerBinding::WorkerMethods; @@ -20,19 +21,15 @@ use dom::event::{Event, EventBubbles, EventCancelable}; use dom::eventtarget::EventTarget; use dom::messageevent::MessageEvent; use dom::workerglobalscope::WorkerGlobalScopeInit; - -use devtools_traits::{DevtoolsPageInfo, ScriptToDevtoolsControlMsg}; -use script_task::{ScriptChan, Runnable}; - use ipc_channel::ipc; use js::jsapi::{JSAutoRequest, JSAutoCompartment}; use js::jsapi::{JSContext, HandleValue, RootedValue}; use js::jsval::UndefinedValue; -use url::UrlParser; -use util::str::DOMString; - +use script_task::{ScriptChan, Runnable}; use std::borrow::ToOwned; use std::sync::mpsc::{channel, Sender}; +use url::UrlParser; +use util::str::DOMString; pub type TrustedWorkerAddress = Trusted<Worker>; diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index 4fbd17a7413..3d5d459d4e2 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use devtools_traits::{ScriptToDevtoolsControlMsg, DevtoolScriptControlMsg}; use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods; use dom::bindings::codegen::InheritTypes::DedicatedWorkerGlobalScopeCast; @@ -16,25 +17,20 @@ use dom::eventtarget::EventTarget; use dom::window::{base64_atob, base64_btoa}; use dom::workerlocation::WorkerLocation; use dom::workernavigator::WorkerNavigator; -use script_task::{CommonScriptMsg, ScriptChan, TimerSource, ScriptPort}; -use timers::{IsInterval, TimerId, TimerManager, TimerCallback}; - -use devtools_traits::{ScriptToDevtoolsControlMsg, DevtoolScriptControlMsg}; - -use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId}; -use net_traits::{load_whole_resource, ResourceTask}; -use profile_traits::mem; -use util::str::DOMString; - use ipc_channel::ipc::IpcSender; use js::jsapi::{JSContext, HandleValue, JSAutoRequest}; use js::rust::Runtime; -use url::{Url, UrlParser}; - +use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId}; +use net_traits::{load_whole_resource, ResourceTask}; +use profile_traits::mem; +use script_task::{CommonScriptMsg, ScriptChan, TimerSource, ScriptPort}; use std::cell::Cell; use std::default::Default; use std::rc::Rc; use std::sync::mpsc::Receiver; +use timers::{IsInterval, TimerId, TimerManager, TimerCallback}; +use url::{Url, UrlParser}; +use util::str::DOMString; #[derive(Copy, Clone, PartialEq)] pub enum WorkerGlobalScopeTypeId { diff --git a/components/script/dom/workerlocation.rs b/components/script/dom/workerlocation.rs index bd62cc57043..467d2fef7ee 100644 --- a/components/script/dom/workerlocation.rs +++ b/components/script/dom/workerlocation.rs @@ -10,7 +10,6 @@ use dom::bindings::str::USVString; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::urlhelper::UrlHelper; use dom::workerglobalscope::WorkerGlobalScope; - use url::Url; use util::str::DOMString; diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 743c0e2f6dd..7fa69f701a5 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use cors::CORSResponse; +use cors::{allow_cross_origin_request, CORSRequest, RequestMode, AsyncCORSResponseListener}; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; use dom::bindings::codegen::Bindings::XMLHttpRequestBinding; @@ -9,6 +11,8 @@ use dom::bindings::codegen::Bindings::XMLHttpRequestBinding::XMLHttpRequestMetho use dom::bindings::codegen::Bindings::XMLHttpRequestBinding::XMLHttpRequestResponseType; use dom::bindings::codegen::Bindings::XMLHttpRequestBinding::XMLHttpRequestResponseType::{_empty, Json, Text}; use dom::bindings::codegen::InheritTypes::{EventCast, EventTargetCast, XMLHttpRequestDerived}; +use dom::bindings::codegen::UnionTypes::StringOrURLSearchParams; +use dom::bindings::codegen::UnionTypes::StringOrURLSearchParams::{eString, eURLSearchParams}; use dom::bindings::conversions::ToJSValConvertible; use dom::bindings::error::Error::{InvalidState, InvalidAccess}; use dom::bindings::error::Error::{Network, Syntax, Security, Abort, Timeout}; @@ -26,35 +30,25 @@ use dom::progressevent::ProgressEvent; use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTarget; use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTargetTypeId; use dom::xmlhttprequestupload::XMLHttpRequestUpload; -use network_listener::{NetworkListener, PreInvoke}; -use script_task::ScriptTaskEventCategory::XhrEvent; -use script_task::{ScriptChan, Runnable, ScriptPort, CommonScriptMsg}; - use encoding::all::UTF_8; use encoding::label::encoding_from_whatwg_label; use encoding::types::{DecoderTrap, Encoding, EncodingRef, EncoderTrap}; - use hyper::header::Headers; use hyper::header::{Accept, ContentLength, ContentType, qitem}; use hyper::http::RawStatus; use hyper::method::Method; use hyper::mime::{self, Mime}; - +use ipc_channel::ipc; +use ipc_channel::router::ROUTER; use js::jsapi::JS_ClearPendingException; use js::jsapi::{JS_ParseJSON, JSContext, RootedValue}; use js::jsval::{JSVal, NullValue, UndefinedValue}; - -use cors::CORSResponse; -use cors::{allow_cross_origin_request, CORSRequest, RequestMode, AsyncCORSResponseListener}; use net_traits::ControlMsg::Load; use net_traits::{AsyncResponseListener, AsyncResponseTarget, Metadata}; use net_traits::{ResourceTask, ResourceCORSData, LoadData, LoadConsumer}; -use util::mem::HeapSizeOf; -use util::str::DOMString; -use util::task::spawn_named; - -use ipc_channel::ipc; -use ipc_channel::router::ROUTER; +use network_listener::{NetworkListener, PreInvoke}; +use script_task::ScriptTaskEventCategory::XhrEvent; +use script_task::{ScriptChan, Runnable, ScriptPort, CommonScriptMsg}; use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::cell::{RefCell, Cell}; @@ -64,9 +58,9 @@ use std::sync::{Mutex, Arc}; use std::thread::sleep_ms; use time; use url::{Url, UrlParser}; - -use dom::bindings::codegen::UnionTypes::StringOrURLSearchParams; -use dom::bindings::codegen::UnionTypes::StringOrURLSearchParams::{eString, eURLSearchParams}; +use util::mem::HeapSizeOf; +use util::str::DOMString; +use util::task::spawn_named; pub type SendParam = StringOrURLSearchParams; |