diff options
author | Johann Tuffe <tafia973@gmail.com> | 2015-08-20 20:47:12 +0800 |
---|---|---|
committer | Johann Tuffe <tafia973@gmail.com> | 2015-08-20 20:47:12 +0800 |
commit | ec07178b6fc5a0ab559eb191952101cf92b5d666 (patch) | |
tree | f7550ec6d7623b57b29d3030686f4fdb609f0b36 | |
parent | d3c7e31722fb194f1a266eec9ae57d2f2557e7a6 (diff) | |
download | servo-ec07178b6fc5a0ab559eb191952101cf92b5d666.tar.gz servo-ec07178b6fc5a0ab559eb191952101cf92b5d666.zip |
sort all uses
269 files changed, 866 insertions, 894 deletions
diff --git a/components/canvas/canvas_paint_task.rs b/components/canvas/canvas_paint_task.rs index 766a7f96915..aa5d73a38af 100644 --- a/components/canvas/canvas_paint_task.rs +++ b/components/canvas/canvas_paint_task.rs @@ -3,19 +3,19 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use azure::azure::{AzFloat, AzColor}; -use azure::azure_hl::{DrawTarget, SurfaceFormat, BackendType, StrokeOptions, DrawOptions, Pattern}; use azure::azure_hl::{ColorPattern, PathBuilder, DrawSurfaceOptions, Filter}; +use azure::azure_hl::{DrawTarget, SurfaceFormat, BackendType, StrokeOptions, DrawOptions, Pattern}; use azure::azure_hl::{JoinStyle, CapStyle, CompositionOp, AntialiasMode}; use canvas_traits::*; use euclid::matrix2d::Matrix2D; use euclid::point::Point2D; use euclid::rect::Rect; use euclid::size::Size2D; +use gfx_traits::color; +use ipc_channel::ipc::IpcSharedMemory; use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::router::ROUTER; use layers::platform::surface::NativeSurface; -use gfx_traits::color; -use ipc_channel::ipc::IpcSharedMemory; use num::ToPrimitive; use util::opts; use util::task::spawn_named; diff --git a/components/canvas/webgl_paint_task.rs b/components/canvas/webgl_paint_task.rs index fdf75e05cb5..ac367a83047 100644 --- a/components/canvas/webgl_paint_task.rs +++ b/components/canvas/webgl_paint_task.rs @@ -4,21 +4,21 @@ use canvas_traits::{CanvasMsg, CanvasWebGLMsg, CanvasCommonMsg, FromLayoutMsg, FromPaintMsg}; use canvas_traits::{WebGLShaderParameter, WebGLFramebufferBindingRequest}; -use euclid::size::Size2D; use core::nonzero::NonZero; +use euclid::size::Size2D; use gleam::gl; use gleam::gl::types::{GLsizei}; use util::task::spawn_named; +use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory}; +use ipc_channel::router::ROUTER; +use layers::platform::surface::NativeSurface; +use offscreen_gl_context::{GLContext, GLContextAttributes, ColorAttachmentType}; use std::borrow::ToOwned; use std::slice::bytes::copy_memory; use std::sync::mpsc::{channel, Sender}; use util::vec::byte_swap; -use layers::platform::surface::NativeSurface; -use offscreen_gl_context::{GLContext, GLContextAttributes, ColorAttachmentType}; -use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory}; -use ipc_channel::router::ROUTER; pub struct WebGLPaintTask { size: Size2D<i32>, diff --git a/components/canvas_traits/lib.rs b/components/canvas_traits/lib.rs index 41115b39db1..2ce53dfbb76 100644 --- a/components/canvas_traits/lib.rs +++ b/components/canvas_traits/lib.rs @@ -26,6 +26,7 @@ use azure::azure_hl::{DrawTarget, Pattern, ColorPattern}; use azure::azure_hl::{GradientStop, LinearGradientPattern, RadialGradientPattern, ExtendMode}; use azure::azure_hl::{JoinStyle, CapStyle, CompositionOp}; use azure::azure_hl::{SurfacePattern, SurfaceFormat}; +use core::nonzero::NonZero; use cssparser::RGBA; use euclid::matrix2d::Matrix2D; use euclid::point::Point2D; @@ -33,11 +34,10 @@ use euclid::rect::Rect; use euclid::size::Size2D; use gfx_traits::color; use ipc_channel::ipc::{IpcSender, IpcSharedMemory}; -use std::sync::mpsc::Sender; use layers::platform::surface::NativeSurface; use offscreen_gl_context::GLContextAttributes; use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use core::nonzero::NonZero; +use std::sync::mpsc::Sender; use util::mem::HeapSizeOf; #[derive(Clone, Deserialize, Serialize)] diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 9a561b6b7fa..8e4801573a8 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -2,12 +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 surface_map::SurfaceMap; use compositor_layer::{CompositorData, CompositorLayer, WantsScrollEventsFlag}; use compositor_task::{CompositorEventListener, CompositorProxy, CompositorReceiver, Msg}; use constellation::SendableFrameTree; use pipeline::CompositionPipeline; use scrolling::ScrollingTimerProxy; +use surface_map::SurfaceMap; use windowing; use windowing::{MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg}; @@ -16,17 +16,17 @@ use euclid::point::{Point2D, TypedPoint2D}; use euclid::rect::{Rect, TypedRect}; use euclid::scale_factor::ScaleFactor; use euclid::size::{Size2D, TypedSize2D}; -use gfx_traits::color; use gfx::paint_task::{ChromeToPaintMsg, PaintRequest}; -use gleam::gl::types::{GLint, GLsizei}; +use gfx_traits::color; use gleam::gl; +use gleam::gl::types::{GLint, GLsizei}; use ipc_channel::ipc; use ipc_channel::router::ROUTER; use layers::geometry::{DevicePixel, LayerPixel}; use layers::layers::{BufferRequest, Layer, LayerBuffer, LayerBufferSet}; use layers::platform::surface::NativeDisplay; -use layers::rendergl::RenderContext; use layers::rendergl; +use layers::rendergl::RenderContext; use layers::scene::Scene; use layout_traits::LayoutControlChan; use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerKind}; diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs index 82297f6f8fd..6f9a6dd4b2f 100644 --- a/components/compositing/compositor_layer.rs +++ b/components/compositing/compositor_layer.rs @@ -8,15 +8,15 @@ use windowing::{MouseWindowEvent, WindowMethods}; use azure::azure_hl; use euclid::length::Length; use euclid::point::{Point2D, TypedPoint2D}; -use euclid::size::TypedSize2D; use euclid::rect::Rect; +use euclid::size::TypedSize2D; use layers::color::Color; use layers::geometry::LayerPixel; use layers::layers::{Layer, LayerBufferSet}; -use script_traits::CompositorEvent::{ClickEvent, MouseDownEvent, MouseMoveEvent, MouseUpEvent}; -use script_traits::ConstellationControlMsg; use msg::compositor_msg::{Epoch, LayerId, LayerProperties, ScrollPolicy}; use msg::constellation_msg::PipelineId; +use script_traits::CompositorEvent::{ClickEvent, MouseDownEvent, MouseMoveEvent, MouseUpEvent}; +use script_traits::ConstellationControlMsg; use std::rc::Rc; #[derive(Debug)] diff --git a/components/compositing/compositor_task.rs b/components/compositing/compositor_task.rs index fcf745a9bc2..86d87f92336 100644 --- a/components/compositing/compositor_task.rs +++ b/components/compositing/compositor_task.rs @@ -14,18 +14,18 @@ use windowing::{WindowEvent, WindowMethods}; use euclid::point::Point2D; use euclid::rect::Rect; use ipc_channel::ipc::{IpcReceiver, IpcSender}; -use layers::platform::surface::{NativeDisplay, NativeSurface}; use layers::layers::{BufferRequest, LayerBufferSet}; +use layers::platform::surface::{NativeDisplay, NativeSurface}; use msg::compositor_msg::{Epoch, LayerId, LayerProperties, FrameTreeId}; use msg::compositor_msg::{PaintListener, ScriptToCompositorMsg}; use msg::constellation_msg::{AnimationState, ConstellationChan, PipelineId}; use msg::constellation_msg::{Key, KeyState, KeyModifiers}; +use png; use profile_traits::mem; use profile_traits::time; -use png; -use std::sync::mpsc::{channel, Sender, Receiver}; use std::fmt::{Error, Formatter, Debug}; use std::rc::Rc; +use std::sync::mpsc::{channel, Sender, Receiver}; use style::viewport::ViewportConstraints; use url::Url; use util::cursor::Cursor; diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 5d214f397f6..497dbcbe81f 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -14,29 +14,30 @@ use pipeline::{Pipeline, CompositionPipeline}; use canvas::canvas_paint_task::CanvasPaintTask; use canvas::webgl_paint_task::WebGLPaintTask; use canvas_traits::CanvasMsg; +use clipboard::ClipboardContext; use compositor_task::CompositorProxy; use compositor_task::Msg as CompositorMsg; use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg}; use euclid::point::Point2D; use euclid::rect::{Rect, TypedRect}; -use euclid::size::Size2D; use euclid::scale_factor::ScaleFactor; +use euclid::size::Size2D; use gfx::font_cache_task::FontCacheTask; use ipc_channel::ipc::{self, IpcSender}; use layout_traits::{LayoutControlChan, LayoutTaskFactory}; use msg::compositor_msg::{Epoch, LayerId}; use msg::constellation_msg::AnimationState; use msg::constellation_msg::Msg as ConstellationMsg; +use msg::constellation_msg::WebDriverCommandMsg; use msg::constellation_msg::{FrameId, PipelineExitType, PipelineId}; use msg::constellation_msg::{IFrameSandboxState, MozBrowserEvent, NavigationDirection}; use msg::constellation_msg::{Key, KeyState, KeyModifiers, LoadData}; use msg::constellation_msg::{SubpageId, WindowSizeData}; use msg::constellation_msg::{self, ConstellationChan, Failure}; -use msg::constellation_msg::WebDriverCommandMsg; use msg::webdriver_msg; -use net_traits::{self, ResourceTask}; use net_traits::image_cache_task::ImageCacheTask; use net_traits::storage_task::{StorageTask, StorageTaskMsg}; +use net_traits::{self, ResourceTask}; use offscreen_gl_context::GLContextAttributes; use profile_traits::mem; use profile_traits::time; @@ -55,7 +56,6 @@ use util::cursor::Cursor; use util::geometry::PagePx; use util::opts; use util::task::spawn_named; -use clipboard::ClipboardContext; /// Maintains the pipelines and navigation context and grants permission to composite. /// diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index 9eedfff8f5a..fe707d5ad3d 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -11,18 +11,18 @@ use compositor_task; use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg}; use euclid::rect::{TypedRect}; use euclid::scale_factor::ScaleFactor; -use gfx::paint_task::{ChromeToPaintMsg, LayoutToPaintMsg, PaintTask}; use gfx::font_cache_task::FontCacheTask; +use gfx::paint_task::{ChromeToPaintMsg, LayoutToPaintMsg, PaintTask}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use layers::geometry::DevicePixel; use msg::constellation_msg::{ConstellationChan, Failure, FrameId, PipelineId, SubpageId}; use msg::constellation_msg::{LoadData, WindowSizeData, PipelineExitType, MozBrowserEvent}; -use profile_traits::mem as profile_mem; -use profile_traits::time; use net_traits::ResourceTask; use net_traits::image_cache_task::ImageCacheTask; use net_traits::storage_task::StorageTask; +use profile_traits::mem as profile_mem; +use profile_traits::time; use std::any::Any; use std::mem; use std::sync::mpsc::{Receiver, Sender, channel}; diff --git a/components/compositing/surface_map.rs b/components/compositing/surface_map.rs index 190ae536684..b773cd86e97 100644 --- a/components/compositing/surface_map.rs +++ b/components/compositing/surface_map.rs @@ -2,10 +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::collections::HashMap; -use std::collections::hash_map::Entry::{Occupied, Vacant}; use euclid::size::Size2D; use layers::platform::surface::{NativeDisplay, NativeSurface}; +use std::collections::HashMap; +use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::hash::{Hash, Hasher}; /// This is a struct used to store surfaces when they are not in use. diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index 71ef9b15e11..3efa8ba34b5 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -14,11 +14,11 @@ use layers::platform::surface::NativeDisplay; use msg::constellation_msg::{Key, KeyState, KeyModifiers}; use net_traits::net_error_list::NetError; use script_traits::MouseButton; +use std::fmt::{Error, Formatter, Debug}; +use std::rc::Rc; use url::Url; use util::cursor::Cursor; use util::geometry::ScreenPx; -use std::fmt::{Error, Formatter, Debug}; -use std::rc::Rc; #[derive(Clone)] pub enum MouseWindowEvent { diff --git a/components/devtools/actor.rs b/components/devtools/actor.rs index cf2dab9050d..c640822d732 100644 --- a/components/devtools/actor.rs +++ b/components/devtools/actor.rs @@ -7,8 +7,8 @@ use devtools_traits::PreciseTime; use rustc_serialize::json; use std::any::{Any, TypeId}; -use std::collections::HashMap; use std::cell::{Cell, RefCell}; +use std::collections::HashMap; use std::marker::Reflect; use std::mem::{replace, transmute}; use std::net::TcpStream; diff --git a/components/devtools/actors/console.rs b/components/devtools/actors/console.rs index b7313230290..7c859369274 100644 --- a/components/devtools/actors/console.rs +++ b/components/devtools/actors/console.rs @@ -11,16 +11,16 @@ use actor::{Actor, ActorRegistry, ActorMessageStatus}; use actors::object::ObjectActor; use protocol::JsonPacketStream; +use devtools_traits::CachedConsoleMessage; use devtools_traits::EvaluateJSReply::{NullValue, VoidValue, NumberValue}; use devtools_traits::EvaluateJSReply::{StringValue, BooleanValue, ActorValue}; use devtools_traits::{CachedConsoleMessageTypes, DevtoolScriptControlMsg, PAGE_ERROR, CONSOLE_API}; -use devtools_traits::CachedConsoleMessage; use msg::constellation_msg::PipelineId; -use std::collections::BTreeMap; use core::cell::RefCell; use ipc_channel::ipc::{self, IpcSender}; use rustc_serialize::json::{self, Json, ToJson}; +use std::collections::BTreeMap; use std::net::TcpStream; use std::sync::mpsc::channel; diff --git a/components/devtools/actors/framerate.rs b/components/devtools/actors/framerate.rs index 97a366c9fc5..bc3937e9ce8 100644 --- a/components/devtools/actors/framerate.rs +++ b/components/devtools/actors/framerate.rs @@ -8,10 +8,10 @@ use std::mem; use std::net::TcpStream; use time::precise_time_ns; -use msg::constellation_msg::PipelineId; use actor::{Actor, ActorRegistry, ActorMessageStatus}; use actors::timeline::HighResolutionStamp; use devtools_traits::DevtoolScriptControlMsg; +use msg::constellation_msg::PipelineId; pub struct FramerateActor { name: String, diff --git a/components/devtools/actors/inspector.rs b/components/devtools/actors/inspector.rs index 1c17b71439e..3b520b467e7 100644 --- a/components/devtools/actors/inspector.rs +++ b/components/devtools/actors/inspector.rs @@ -5,18 +5,18 @@ //! Liberally derived from the [Firefox JS implementation] //! (http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/inspector.js). -use devtools_traits::{DevtoolScriptControlMsg, NodeInfo, ComputedNodeLayout}; -use devtools_traits::DevtoolScriptControlMsg::{GetRootNode, GetDocumentElement, GetChildren}; use devtools_traits::DevtoolScriptControlMsg::{GetLayout, ModifyAttribute}; +use devtools_traits::DevtoolScriptControlMsg::{GetRootNode, GetDocumentElement, GetChildren}; +use devtools_traits::{DevtoolScriptControlMsg, NodeInfo, ComputedNodeLayout}; use actor::{Actor, ActorRegistry, ActorMessageStatus}; use protocol::JsonPacketStream; use ipc_channel::ipc::{self, IpcSender}; -use std::collections::BTreeMap; use msg::constellation_msg::PipelineId; use rustc_serialize::json::{self, Json, ToJson}; use std::cell::RefCell; +use std::collections::BTreeMap; use std::net::TcpStream; use std::sync::mpsc::channel; diff --git a/components/devtools/actors/network_event.rs b/components/devtools/actors/network_event.rs index d73dd300e2c..331138a26f5 100644 --- a/components/devtools/actors/network_event.rs +++ b/components/devtools/actors/network_event.rs @@ -9,13 +9,13 @@ extern crate hyper; use actor::{Actor, ActorRegistry, ActorMessageStatus}; +use hyper::header::Headers; +use hyper::http::RawStatus; +use hyper::method::Method; use protocol::JsonPacketStream; use rustc_serialize::json; use std::net::TcpStream; use url::Url; -use hyper::header::Headers; -use hyper::http::RawStatus; -use hyper::method::Method; struct HttpRequest { url: String, diff --git a/components/devtools/actors/timeline.rs b/components/devtools/actors/timeline.rs index b6e0193d7fb..a608ff1380e 100644 --- a/components/devtools/actors/timeline.rs +++ b/components/devtools/actors/timeline.rs @@ -9,13 +9,13 @@ use std::cell::RefCell; use std::collections::{HashMap, VecDeque}; use std::mem; use std::net::TcpStream; -use std::thread::sleep_ms; -use std::sync::{Arc, Mutex}; use std::sync::mpsc::channel; +use std::sync::{Arc, Mutex}; +use std::thread::sleep_ms; use actor::{Actor, ActorRegistry, ActorMessageStatus}; -use actors::memory::{MemoryActor, TimelineMemoryReply}; use actors::framerate::FramerateActor; +use actors::memory::{MemoryActor, TimelineMemoryReply}; use devtools_traits::DevtoolScriptControlMsg; use devtools_traits::DevtoolScriptControlMsg::{SetTimelineMarkers, DropTimelineMarkers}; use devtools_traits::{PreciseTime, TimelineMarker, TracingMetadata, TimelineMarkerType}; diff --git a/components/devtools/lib.rs b/components/devtools/lib.rs index e6d10abc313..07a3889d699 100644 --- a/components/devtools/lib.rs +++ b/components/devtools/lib.rs @@ -38,9 +38,9 @@ extern crate url; use actor::{Actor, ActorRegistry}; use actors::console::ConsoleActor; -use actors::network_event::{NetworkEventActor, EventActor, ResponseStartMsg}; use actors::framerate::FramerateActor; use actors::inspector::InspectorActor; +use actors::network_event::{NetworkEventActor, EventActor, ResponseStartMsg}; use actors::performance::PerformanceActor; use actors::profiler::ProfilerActor; use actors::root::RootActor; @@ -61,8 +61,8 @@ use std::cell::RefCell; use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::error::Error; -use std::sync::mpsc::{channel, Receiver, Sender, RecvError}; use std::net::{TcpListener, TcpStream, Shutdown}; +use std::sync::mpsc::{channel, Receiver, Sender, RecvError}; use std::sync::{Arc, Mutex}; use time::precise_time_ns; diff --git a/components/devtools/protocol.rs b/components/devtools/protocol.rs index 1b54b92d01a..b6ddb62c5e0 100644 --- a/components/devtools/protocol.rs +++ b/components/devtools/protocol.rs @@ -6,9 +6,9 @@ //! [JSON packets] //! (https://wiki.mozilla.org/Remote_Debugging_Protocol_Stream_Transport#JSON_Packets). -use rustc_serialize::{json, Encodable}; use rustc_serialize::json::Json; use rustc_serialize::json::ParserError::{IoError, SyntaxError}; +use rustc_serialize::{json, Encodable}; use std::error::Error; use std::io::{Read, Write}; use std::net::TcpStream; diff --git a/components/devtools_traits/lib.rs b/components/devtools_traits/lib.rs index b7ef2ebf5c4..8df97634fad 100644 --- a/components/devtools_traits/lib.rs +++ b/components/devtools_traits/lib.rs @@ -27,10 +27,10 @@ extern crate hyper; extern crate util; extern crate time; -use rustc_serialize::{Decodable, Decoder}; use msg::constellation_msg::{PipelineId, WorkerId}; -use util::str::DOMString; +use rustc_serialize::{Decodable, Decoder}; use url::Url; +use util::str::DOMString; use hyper::header::Headers; use hyper::http::RawStatus; diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index f7478f91cc8..5713a91d71e 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -20,8 +20,8 @@ use display_list::optimizer::DisplayListOptimizer; use paint_context::PaintContext; use self::DisplayItem::*; use self::DisplayItemIterator::*; -use text::glyph::CharIndex; use text::TextRun; +use text::glyph::CharIndex; use azure::azure::AzFloat; use azure::azure_hl::Color; diff --git a/components/gfx/display_list/optimizer.rs b/components/gfx/display_list/optimizer.rs index 71f275a1bb6..2e1f3c69bde 100644 --- a/components/gfx/display_list/optimizer.rs +++ b/components/gfx/display_list/optimizer.rs @@ -6,11 +6,11 @@ use display_list::{DisplayItem, DisplayList, StackingContext}; -use std::collections::linked_list::LinkedList; use euclid::rect::Rect; use euclid::{Matrix2D, Matrix4}; -use util::geometry::{self, Au}; +use std::collections::linked_list::LinkedList; use std::sync::Arc; +use util::geometry::{self, Au}; /// Transforms a display list to produce a visually-equivalent, but cheaper-to-paint, one. pub struct DisplayListOptimizer { diff --git a/components/gfx/filters.rs b/components/gfx/filters.rs index 7da418b3c1a..832cc437c74 100644 --- a/components/gfx/filters.rs +++ b/components/gfx/filters.rs @@ -7,8 +7,8 @@ use azure::AzFloat; use azure::azure_hl::{ColorMatrixAttribute, ColorMatrixInput, CompositeInput, DrawTarget}; use azure::azure_hl::{FilterNode, FilterType, LinearTransferAttribute, LinearTransferInput}; -use azure::azure_hl::{Matrix5x4, TableTransferAttribute, TableTransferInput}; use azure::azure_hl::{GaussianBlurAttribute, GaussianBlurInput}; +use azure::azure_hl::{Matrix5x4, TableTransferAttribute, TableTransferInput}; use style::computed_values::filter; use util::geometry::Au; diff --git a/components/gfx/font.rs b/components/gfx/font.rs index a2022ead6f2..fd17fa4e467 100644 --- a/components/gfx/font.rs +++ b/components/gfx/font.rs @@ -5,23 +5,23 @@ use euclid::{Point2D, Rect, Size2D}; use smallvec::SmallVec; use std::borrow::ToOwned; +use std::cell::RefCell; use std::mem; -use std::slice; use std::rc::Rc; -use std::cell::RefCell; -use util::cache::HashCache; +use std::slice; +use std::sync::Arc; use style::computed_values::{font_stretch, font_variant, font_weight}; use style::properties::style_structs::Font as FontStyle; -use std::sync::Arc; +use util::cache::HashCache; -use platform::font_context::FontContextHandle; +use font_template::FontTemplateDescriptor; use platform::font::{FontHandle, FontTable}; -use util::geometry::Au; +use platform::font_context::FontContextHandle; +use platform::font_template::FontTemplateData; +use text::Shaper; use text::glyph::{GlyphStore, GlyphId}; use text::shaping::ShaperMethods; -use text::Shaper; -use font_template::FontTemplateDescriptor; -use platform::font_template::FontTemplateData; +use util::geometry::Au; // FontHandle encapsulates access to the platform's font API, // e.g. quartz, FreeType. It provides access to metrics and tables diff --git a/components/gfx/font_cache_task.rs b/components/gfx/font_cache_task.rs index 69440197edb..100fde2050f 100644 --- a/components/gfx/font_cache_task.rs +++ b/components/gfx/font_cache_task.rs @@ -2,11 +2,11 @@ * 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 platform::font_context::FontContextHandle; use platform::font_list::get_available_families; +use platform::font_list::get_last_resort_font_families; use platform::font_list::get_system_default_family; use platform::font_list::get_variations_for_family; -use platform::font_list::get_last_resort_font_families; -use platform::font_context::FontContextHandle; use font_template::{FontTemplate, FontTemplateDescriptor}; use net_traits::{ResourceTask, load_whole_resource}; diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index 089bc72a789..18ee5e9ff42 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -2,15 +2,15 @@ * 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 font::{Font, FontGroup}; use font::SpecifiedFontStyle; +use font::{Font, FontGroup}; use platform::font_context::FontContextHandle; use style::computed_values::{font_style, font_variant}; +use fnv::FnvHasher; use font::FontHandleMethods; use font_cache_task::FontCacheTask; use font_template::FontTemplateDescriptor; -use fnv::FnvHasher; use platform::font::FontHandle; use platform::font_template::FontTemplateData; use smallvec::SmallVec; diff --git a/components/gfx/font_template.rs b/components/gfx/font_template.rs index e3a26859830..0cda03a78b9 100644 --- a/components/gfx/font_template.rs +++ b/components/gfx/font_template.rs @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use font::FontHandleMethods; -use platform::font_context::FontContextHandle; use platform::font::FontHandle; +use platform::font_context::FontContextHandle; use platform::font_template::FontTemplateData; use string_cache::Atom; diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index c0e09245056..a96d413cafc 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -4,12 +4,12 @@ //! Painting of display lists using Moz2D/Azure. -use gfx_traits::color; use display_list::TextOrientation::{SidewaysLeft, SidewaysRight, Upright}; use display_list::{BLUR_INFLATION_FACTOR, BorderRadii, BoxShadowClipMode, ClippingRegion}; use display_list::{TextDisplayItem}; use filters; use font_context::FontContext; +use gfx_traits::color; use text::TextRun; use text::glyph::CharIndex; diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 26c5308ae3e..43ca598c38a 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -9,37 +9,37 @@ use font_cache_task::FontCacheTask; use font_context::FontContext; use paint_context::PaintContext; -use azure::azure_hl::{SurfaceFormat, Color, DrawTarget, BackendType}; use azure::AzFloat; +use azure::azure_hl::{SurfaceFormat, Color, DrawTarget, BackendType}; use canvas_traits::CanvasMsg; use euclid::Matrix4; use euclid::point::Point2D; use euclid::rect::Rect; use euclid::size::Size2D; use ipc_channel::ipc::IpcSender; -use layers::platform::surface::{NativeDisplay, NativeSurface}; use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet}; +use layers::platform::surface::{NativeDisplay, NativeSurface}; use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerKind}; use msg::compositor_msg::{LayerProperties, PaintListener, ScrollPolicy}; use msg::constellation_msg::Msg as ConstellationMsg; -use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use msg::constellation_msg::PipelineExitType; +use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use profile_traits::mem::{self, ReportsChan}; use profile_traits::time::{self, profile}; use rand::{self, Rng}; -use smallvec::SmallVec; use skia::gl_context::GLContext; +use smallvec::SmallVec; use std::borrow::ToOwned; +use std::collections::HashMap; use std::mem as std_mem; use std::sync::Arc; use std::sync::mpsc::{Receiver, Select, Sender, channel}; -use std::collections::HashMap; use url::Url; use util::geometry::{Au, ZERO_POINT}; use util::opts; +use util::task::spawn_named; use util::task::spawn_named_with_send_on_failure; use util::task_state; -use util::task::spawn_named; /// Information about a hardware graphics layer that layout sends to the painting task. #[derive(Clone, Deserialize, Serialize)] diff --git a/components/gfx/platform/freetype/font.rs b/components/gfx/platform/freetype/font.rs index a4b48c06991..e8b1c26363c 100644 --- a/components/gfx/platform/freetype/font.rs +++ b/components/gfx/platform/freetype/font.rs @@ -6,21 +6,21 @@ extern crate freetype; use font::{FontHandleMethods, FontMetrics, FontTableMethods}; use font::{FontTableTag, FractionalPixel}; -use util::geometry::Au; -use util::str::c_str_to_string; use platform::font_context::FontContextHandle; +use platform::font_template::FontTemplateData; +use style::computed_values::{font_stretch, font_weight}; use text::glyph::GlyphId; use text::util::{float_to_fixed, fixed_to_float}; -use style::computed_values::{font_stretch, font_weight}; -use platform::font_template::FontTemplateData; +use util::geometry::Au; +use util::str::c_str_to_string; +use freetype::freetype::{FTErrorMethods, FT_F26Dot6, FT_Face, FT_FaceRec}; use freetype::freetype::{FT_Get_Char_Index, FT_Get_Postscript_Name}; -use freetype::freetype::{FT_Load_Glyph, FT_Set_Char_Size}; use freetype::freetype::{FT_Get_Kerning, FT_Get_Sfnt_Table}; -use freetype::freetype::{FT_New_Memory_Face, FT_Done_Face}; -use freetype::freetype::{FTErrorMethods, FT_F26Dot6, FT_Face, FT_FaceRec}; use freetype::freetype::{FT_GlyphSlot, FT_Library, FT_Long, FT_ULong}; use freetype::freetype::{FT_KERNING_DEFAULT, FT_STYLE_FLAG_ITALIC, FT_STYLE_FLAG_BOLD}; +use freetype::freetype::{FT_Load_Glyph, FT_Set_Char_Size}; +use freetype::freetype::{FT_New_Memory_Face, FT_Done_Face}; use freetype::freetype::{FT_SizeRec, FT_UInt, FT_Size_Metrics, struct_FT_Vector_}; use freetype::freetype::{ft_sfnt_os2}; use freetype::tt_os2::TT_OS2; diff --git a/components/gfx/platform/freetype/font_list.rs b/components/gfx/platform/freetype/font_list.rs index 48534016cac..f3557d7dd2f 100644 --- a/components/gfx/platform/freetype/font_list.rs +++ b/components/gfx/platform/freetype/font_list.rs @@ -10,9 +10,9 @@ extern crate fontconfig; use fontconfig::fontconfig::{FcChar8, FcResultMatch, FcSetSystem}; use fontconfig::fontconfig::{FcConfigGetCurrent, FcConfigGetFonts, FcConfigSubstitute}; use fontconfig::fontconfig::{FcDefaultSubstitute, FcFontMatch, FcNameParse, FcPatternGetString}; -use fontconfig::fontconfig::{FcPatternDestroy, FcFontSetDestroy, FcMatchPattern, FcPatternCreate}; -use fontconfig::fontconfig::{FcPatternAddString, FcFontSetList, FcObjectSetCreate, FcObjectSetDestroy}; use fontconfig::fontconfig::{FcObjectSetAdd, FcPatternGetInteger}; +use fontconfig::fontconfig::{FcPatternAddString, FcFontSetList, FcObjectSetCreate, FcObjectSetDestroy}; +use fontconfig::fontconfig::{FcPatternDestroy, FcFontSetDestroy, FcMatchPattern, FcPatternCreate}; use util::str::c_str_to_string; diff --git a/components/gfx/platform/macos/font.rs b/components/gfx/platform/macos/font.rs index dac669d2215..b96f217e0c9 100644 --- a/components/gfx/platform/macos/font.rs +++ b/components/gfx/platform/macos/font.rs @@ -8,14 +8,14 @@ extern crate core_foundation; extern crate core_graphics; extern crate core_text; -use font::{FontHandleMethods, FontMetrics, FontTableMethods}; use font::FontTableTag; use font::FractionalPixel; -use util::geometry::{Au, px_to_pt}; +use font::{FontHandleMethods, FontMetrics, FontTableMethods}; +use platform::font_template::FontTemplateData; use platform::macos::font_context::FontContextHandle; -use text::glyph::GlyphId; use style::computed_values::{font_stretch, font_weight}; -use platform::font_template::FontTemplateData; +use text::glyph::GlyphId; +use util::geometry::{Au, px_to_pt}; use core_foundation::base::CFIndex; use core_foundation::data::CFData; diff --git a/components/gfx/platform/macos/font_list.rs b/components/gfx/platform/macos/font_list.rs index 6c5ed6f91ea..8bfc694acfe 100644 --- a/components/gfx/platform/macos/font_list.rs +++ b/components/gfx/platform/macos/font_list.rs @@ -4,8 +4,8 @@ use core_foundation::base::TCFType; use core_foundation::string::{CFString, CFStringRef}; -use core_text::font_descriptor::{CTFontDescriptor, CTFontDescriptorRef}; use core_text; +use core_text::font_descriptor::{CTFontDescriptor, CTFontDescriptorRef}; use std::borrow::ToOwned; use std::mem; diff --git a/components/gfx/platform/macos/font_template.rs b/components/gfx/platform/macos/font_template.rs index 96be6a22f5f..bff979519aa 100644 --- a/components/gfx/platform/macos/font_template.rs +++ b/components/gfx/platform/macos/font_template.rs @@ -4,8 +4,8 @@ use core_graphics::data_provider::CGDataProvider; use core_graphics::font::CGFont; -use core_text::font::CTFont; use core_text; +use core_text::font::CTFont; use serde::de::{Error, Visitor}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs index f87906325e0..462d5bf485c 100644 --- a/components/gfx/text/shaping/harfbuzz.rs +++ b/components/gfx/text/shaping/harfbuzz.rs @@ -14,37 +14,37 @@ use text::util::{float_to_fixed, fixed_to_float, is_bidi_control}; use euclid::Point2D; use harfbuzz::{HB_MEMORY_MODE_READONLY, HB_DIRECTION_LTR, HB_DIRECTION_RTL}; use harfbuzz::{RUST_hb_blob_create, RUST_hb_face_create_for_tables}; -use harfbuzz::{hb_blob_t}; -use harfbuzz::{hb_bool_t}; use harfbuzz::{RUST_hb_buffer_add_utf8}; use harfbuzz::{RUST_hb_buffer_destroy}; use harfbuzz::{RUST_hb_buffer_get_glyph_positions}; use harfbuzz::{RUST_hb_buffer_get_length}; use harfbuzz::{RUST_hb_buffer_set_direction}; use harfbuzz::{RUST_hb_face_destroy}; -use harfbuzz::{hb_face_t, hb_font_t}; -use harfbuzz::{hb_feature_t}; use harfbuzz::{RUST_hb_font_create}; use harfbuzz::{RUST_hb_font_destroy, RUST_hb_buffer_create}; use harfbuzz::{RUST_hb_font_funcs_create}; use harfbuzz::{RUST_hb_font_funcs_set_glyph_func}; use harfbuzz::{RUST_hb_font_funcs_set_glyph_h_advance_func}; use harfbuzz::{RUST_hb_font_funcs_set_glyph_h_kerning_func}; -use harfbuzz::{hb_font_funcs_t, hb_buffer_t, hb_codepoint_t}; use harfbuzz::{RUST_hb_font_set_funcs}; use harfbuzz::{RUST_hb_font_set_ppem}; use harfbuzz::{RUST_hb_font_set_scale}; +use harfbuzz::{RUST_hb_shape, RUST_hb_buffer_get_glyph_infos}; +use harfbuzz::{hb_blob_t}; +use harfbuzz::{hb_bool_t}; +use harfbuzz::{hb_face_t, hb_font_t}; +use harfbuzz::{hb_feature_t}; +use harfbuzz::{hb_font_funcs_t, hb_buffer_t, hb_codepoint_t}; use harfbuzz::{hb_glyph_info_t}; use harfbuzz::{hb_glyph_position_t}; use harfbuzz::{hb_position_t, hb_tag_t}; -use harfbuzz::{RUST_hb_shape, RUST_hb_buffer_get_glyph_infos}; use libc::{c_uint, c_int, c_void, c_char}; -use util::geometry::Au; -use util::range::Range; use std::char; -use std::mem; use std::cmp; +use std::mem; use std::ptr; +use util::geometry::Au; +use util::range::Range; macro_rules! hb_tag { ($t1:expr, $t2:expr, $t3:expr, $t4:expr) => ( diff --git a/components/layout/block.rs b/components/layout/block.rs index 9580f1cd6a5..abc169ef1e8 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -31,14 +31,14 @@ use context::LayoutContext; use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode}; use display_list_builder::{FragmentDisplayListBuilding}; use floats::{ClearType, FloatKind, Floats, PlacementInfo}; -use flow::{self, AbsolutePositionInfo, BaseFlow, ForceNonfloatedFlag, FlowClass, Flow}; -use flow::{ImmutableFlowUtils, MutableFlowUtils, OpaqueFlow, PreorderFlowTraversal}; -use flow::{PostorderFlowTraversal, mut_base}; use flow::{BLOCK_POSITION_IS_STATIC, HAS_LEFT_FLOATED_DESCENDANTS, HAS_RIGHT_FLOATED_DESCENDANTS}; +use flow::{CLEARS_LEFT, CLEARS_RIGHT}; use flow::{IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS, INLINE_POSITION_IS_STATIC}; -use flow::{LAYERS_NEEDED_FOR_DESCENDANTS, NEEDS_LAYER}; use flow::{IS_ABSOLUTELY_POSITIONED}; -use flow::{CLEARS_LEFT, CLEARS_RIGHT}; +use flow::{ImmutableFlowUtils, MutableFlowUtils, OpaqueFlow, PreorderFlowTraversal}; +use flow::{LAYERS_NEEDED_FOR_DESCENDANTS, NEEDS_LAYER}; +use flow::{PostorderFlowTraversal, mut_base}; +use flow::{self, AbsolutePositionInfo, BaseFlow, ForceNonfloatedFlag, FlowClass, Flow}; use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo}; use incremental::{REFLOW, REFLOW_OUT_OF_FLOW}; use layout_debug; @@ -56,8 +56,8 @@ use std::sync::Arc; use style::computed_values::{border_collapse, box_sizing, display, float, overflow_x, overflow_y}; use style::computed_values::{transform, transform_style, position, text_align}; use style::properties::ComputedValues; -use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto}; use style::values::computed::{LengthOrNone, LengthOrPercentageOrNone}; +use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto}; use util::geometry::{Au, MAX_AU, MAX_RECT}; use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode}; use util::opts; diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 60a547094b0..a53f0d0b209 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -17,11 +17,11 @@ use block::BlockFlow; use context::LayoutContext; use data::{HAS_NEWLY_CONSTRUCTED_FLOW, LayoutDataWrapper}; use floats::FloatKind; -use flow::{self, AbsoluteDescendants, Flow, ImmutableFlowUtils, IS_ABSOLUTELY_POSITIONED}; use flow::{MutableFlowUtils, MutableOwnedFlowUtils}; +use flow::{self, AbsoluteDescendants, Flow, ImmutableFlowUtils, IS_ABSOLUTELY_POSITIONED}; use flow_ref::FlowRef; -use fragment::{Fragment, GeneratedContentInfo, IframeFragmentInfo}; use fragment::{CanvasFragmentInfo, ImageFragmentInfo, InlineAbsoluteFragmentInfo}; +use fragment::{Fragment, GeneratedContentInfo, IframeFragmentInfo}; use fragment::{InlineAbsoluteHypotheticalFragmentInfo, TableColumnFragmentInfo}; use fragment::{InlineBlockFragmentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo}; use fragment::{WhitespaceStrippingResult}; @@ -1729,8 +1729,8 @@ pub fn strip_ignorable_whitespace_from_end(this: &mut LinkedList<Fragment>) { /// If the 'unicode-bidi' property has a value other than 'normal', return the bidi control codes /// to inject before and after the text content of the element. fn bidi_control_chars(style: &Arc<ComputedValues>) -> Option<(&'static str, &'static str)> { - use style::computed_values::unicode_bidi::T::*; use style::computed_values::direction::T::*; + use style::computed_values::unicode_bidi::T::*; let unicode_bidi = style.get_text().unicode_bidi; let direction = style.get_inheritedbox().direction; diff --git a/components/layout/context.rs b/components/layout/context.rs index cfb58ccb3d4..3562fd1dd98 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -9,13 +9,13 @@ use css::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache}; use canvas_traits::CanvasMsg; -use msg::compositor_msg::LayerId; -use fnv::FnvHasher; use euclid::{Rect, Size2D}; +use fnv::FnvHasher; use gfx::display_list::OpaqueNode; use gfx::font_cache_task::FontCacheTask; use gfx::font_context::FontContext; use ipc_channel::ipc::{self, IpcSender}; +use msg::compositor_msg::LayerId; use msg::constellation_msg::ConstellationChan; use net_traits::image::base::Image; use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageResponse, ImageState}; diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs index c5a2d86b249..db14af662ec 100644 --- a/components/layout/css/matching.rs +++ b/components/layout/css/matching.rs @@ -16,11 +16,11 @@ use wrapper::{LayoutElement, LayoutNode}; use script::dom::characterdata::CharacterDataTypeId; use script::dom::node::NodeTypeId; use script::layout_interface::Animation; -use selectors::{Element}; use selectors::bloom::BloomFilter; use selectors::matching::{CommonStyleAffectingAttributeMode, CommonStyleAffectingAttributes}; use selectors::matching::{common_style_affecting_attributes, rare_style_affecting_attributes}; use selectors::parser::PseudoElement; +use selectors::{Element}; use std::borrow::ToOwned; use std::hash::{Hash, Hasher}; use std::mem; diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 59264e24a8f..2e2ff543650 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -22,9 +22,8 @@ use model::{self, MaybeAuto, ToGfxMatrix}; use table_cell::CollapsedBordersForCell; use canvas_traits::{CanvasMsg, FromLayoutMsg}; -use euclid::{Point2D, Point3D, Rect, Size2D, SideOffsets2D}; use euclid::Matrix4; -use gfx_traits::color; +use euclid::{Point2D, Point3D, Rect, Size2D, SideOffsets2D}; use gfx::display_list::{BLUR_INFLATION_FACTOR, BaseDisplayItem, BorderDisplayItem}; use gfx::display_list::{BorderRadii, BoxShadowClipMode, BoxShadowDisplayItem, ClippingRegion}; use gfx::display_list::{DisplayItem, DisplayList, DisplayItemMetadata}; @@ -33,17 +32,18 @@ use gfx::display_list::{GradientStop, ImageDisplayItem, LineDisplayItem}; use gfx::display_list::{OpaqueNode, SolidColorDisplayItem}; use gfx::display_list::{StackingContext, TextDisplayItem, TextOrientation}; use gfx::paint_task::{PaintLayer, THREAD_TINT_COLORS}; +use gfx_traits::color; use ipc_channel::ipc::{self, IpcSharedMemory}; use msg::compositor_msg::{ScrollPolicy, LayerId}; use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::Msg as ConstellationMsg; -use net_traits::image_cache_task::UsePlaceholder; use net_traits::image::base::{Image, PixelFormat}; +use net_traits::image_cache_task::UsePlaceholder; use std::cmp; use std::default::Default; +use std::f32; use std::sync::Arc; use std::sync::mpsc::channel; -use std::f32; use style::computed_values::filter::Filter; use style::computed_values::{background_attachment, background_clip, background_origin}; use style::computed_values::{background_repeat, background_size}; diff --git a/components/layout/floats.rs b/components/layout/floats.rs index e3028a90f8c..be1947958c3 100644 --- a/components/layout/floats.rs +++ b/components/layout/floats.rs @@ -2,14 +2,14 @@ * 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::cmp::{max, min}; +use std::fmt; +use std::i32; +use style::computed_values::float; use util::geometry::Au; use util::logical_geometry::WritingMode; use util::logical_geometry::{LogicalRect, LogicalSize}; use util::persistent_list::PersistentList; -use std::cmp::{max, min}; -use std::i32; -use std::fmt; -use style::computed_values::float; /// The kind of float: left or right. #[derive(Clone, RustcEncodable, Debug, Copy)] diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 95866d04b5f..e41b19c9bb0 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -35,6 +35,7 @@ use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo}; use incremental::{self, RECONSTRUCT_FLOW, REFLOW, REFLOW_OUT_OF_FLOW, RestyleDamage}; use inline::InlineFlow; use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo}; +use multicol::MulticolFlow; use parallel::FlowParallelInfo; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, TableFlow}; use table_caption::TableCaptionFlow; @@ -43,7 +44,6 @@ use table_colgroup::TableColGroupFlow; use table_row::TableRowFlow; use table_rowgroup::TableRowGroupFlow; use table_wrapper::TableWrapperFlow; -use multicol::MulticolFlow; use wrapper::{PseudoElementType, ThreadSafeLayoutNode}; use euclid::{Point2D, Rect, Size2D}; diff --git a/components/layout/flow_ref.rs b/components/layout/flow_ref.rs index f120841d2e4..65c07f81f19 100644 --- a/components/layout/flow_ref.rs +++ b/components/layout/flow_ref.rs @@ -10,8 +10,8 @@ #![allow(unsafe_code)] -use flow::{Flow, BaseFlow}; use flow; +use flow::{Flow, BaseFlow}; use std::mem; use std::ops::{Deref, DerefMut}; diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index bb9a0b82006..542fd5dd416 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -20,10 +20,10 @@ use text; use wrapper::{PseudoElementType, ThreadSafeLayoutNode}; use euclid::{Point2D, Rect, Size2D}; +use gfx; use gfx::display_list::{BLUR_INFLATION_FACTOR, OpaqueNode}; use gfx::text::glyph::CharIndex; use gfx::text::text_run::{TextRun, TextRunSlice}; -use gfx; use ipc_channel::ipc::IpcSender; use msg::constellation_msg::{ConstellationChan, Msg, PipelineId, SubpageId}; use net_traits::image::base::Image; @@ -44,11 +44,11 @@ use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto}; use style::values::computed::{LengthOrPercentageOrNone}; use text::TextRunScanner; use url::Url; +use util; use util::geometry::{Au, ZERO_POINT}; use util::logical_geometry::{LogicalRect, LogicalSize, LogicalMargin, WritingMode}; use util::range::*; use util::str::{is_whitespace, slice_chars}; -use util; /// Fragments (`struct Fragment`) are the leaves of the layout tree. They cannot position /// themselves. In general, fragments do not have a simple correspondence with CSS fragments in the diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs index 3b65afdbfdd..f512616761b 100644 --- a/components/layout/generated_content.rs +++ b/components/layout/generated_content.rs @@ -9,8 +9,8 @@ //! as possible. use context::LayoutContext; -use flow::{self, AFFECTS_COUNTERS, Flow, HAS_COUNTER_AFFECTING_CHILDREN, ImmutableFlowUtils}; use flow::{InorderFlowTraversal}; +use flow::{self, AFFECTS_COUNTERS, Flow, HAS_COUNTER_AFFECTING_CHILDREN, ImmutableFlowUtils}; use fragment::{Fragment, GeneratedContentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo}; use incremental::{self, RESOLVE_GENERATED_CONTENT}; use smallvec::SmallVec; diff --git a/components/layout/inline.rs b/components/layout/inline.rs index d06489ea3bd..3a23634aa40 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -8,8 +8,8 @@ use block::{AbsoluteAssignBSizesTraversal, AbsoluteStoreOverflowTraversal}; use context::LayoutContext; use display_list_builder::{FragmentDisplayListBuilding, InlineFlowDisplayListBuilding}; use floats::{FloatKind, Floats, PlacementInfo}; -use flow::{self, BaseFlow, FlowClass, Flow, ForceNonfloatedFlag, IS_ABSOLUTELY_POSITIONED}; use flow::{MutableFlowUtils, OpaqueFlow}; +use flow::{self, BaseFlow, FlowClass, Flow, ForceNonfloatedFlag, IS_ABSOLUTELY_POSITIONED}; use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo}; use incremental::{REFLOW, REFLOW_OUT_OF_FLOW, RESOLVE_GENERATED_CONTENT}; use layout_debug; @@ -24,17 +24,17 @@ use gfx::font_context::FontContext; use std::cmp::max; use std::collections::VecDeque; use std::fmt; +use std::isize; use std::mem; use std::sync::Arc; -use std::isize; use style::computed_values::{display, overflow_x, position, text_align, text_justify}; use style::computed_values::{text_overflow, vertical_align, white_space}; use style::properties::ComputedValues; use unicode_bidi; +use util; use util::geometry::{Au, MAX_AU, ZERO_RECT}; use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode}; use util::range::{Range, RangeIndex}; -use util; // From gfxFontConstants.h in Firefox static FONT_SUBSCRIPT_OFFSET_RATIO: f32 = 0.20; diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs index 26e62780f92..3bc7ef8bf6b 100644 --- a/components/layout/layout_debug.rs +++ b/components/layout/layout_debug.rs @@ -7,14 +7,14 @@ #![macro_use] -use flow_ref::FlowRef; use flow; +use flow_ref::FlowRef; use rustc_serialize::json; use std::borrow::ToOwned; use std::cell::RefCell; -use std::io::Write; use std::fs::File; +use std::io::Write; use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None)); diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 010bbdd578f..6da26ab59a9 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -29,17 +29,17 @@ use azure::azure::AzColor; use canvas_traits::CanvasMsg; use encoding::EncodingRef; use encoding::all::UTF_8; -use fnv::FnvHasher; use euclid::Matrix4; use euclid::point::Point2D; use euclid::rect::Rect; use euclid::scale_factor::ScaleFactor; use euclid::size::Size2D; -use gfx_traits::color; -use gfx::display_list::{ClippingRegion, DisplayList, OpaqueNode}; +use fnv::FnvHasher; use gfx::display_list::StackingContext; +use gfx::display_list::{ClippingRegion, DisplayList, OpaqueNode}; use gfx::font_cache_task::FontCacheTask; use gfx::paint_task::{LayoutToPaintMsg, PaintLayer}; +use gfx_traits::color; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use layout_traits::LayoutTaskFactory; @@ -47,19 +47,19 @@ use log; use msg::compositor_msg::{Epoch, ScrollPolicy, LayerId}; use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, PipelineId}; +use net_traits::image_cache_task::{ImageCacheTask, ImageCacheResult, ImageCacheChan}; +use net_traits::{load_bytes_iter, PendingAsyncLoad}; use profile_traits::mem::{self, Report, ReportKind, ReportsChan}; -use profile_traits::time::{self, ProfilerMetadata, profile}; use profile_traits::time::{TimerMetadataFrameType, TimerMetadataReflowType}; -use net_traits::{load_bytes_iter, PendingAsyncLoad}; -use net_traits::image_cache_task::{ImageCacheTask, ImageCacheResult, ImageCacheChan}; +use profile_traits::time::{self, ProfilerMetadata, profile}; use script::dom::bindings::js::LayoutJS; use script::dom::node::{LayoutData, Node}; use script::layout_interface::Animation; use script::layout_interface::{LayoutChan, LayoutRPC, OffsetParentResponse}; use script::layout_interface::{NewLayoutTaskInfo, Msg, Reflow, ReflowGoal, ReflowQueryType}; use script::layout_interface::{ScriptLayoutChan, ScriptReflow, TrustedNodeAddress}; -use script_traits::{ConstellationControlMsg, LayoutControlMsg, OpaqueScriptLayoutChannel}; use script_traits::StylesheetLoadResponder; +use script_traits::{ConstellationControlMsg, LayoutControlMsg, OpaqueScriptLayoutChannel}; use selectors::parser::PseudoElement; use serde_json; use std::borrow::ToOwned; @@ -73,8 +73,8 @@ use std::sync::{Arc, Mutex, MutexGuard}; use string_cache::Atom; use style::computed_values::{self, filter, mix_blend_mode}; use style::media_queries::{MediaType, MediaQueryList, Device}; -use style::properties::style_structs; use style::properties::longhands::{display, position}; +use style::properties::style_structs; use style::selector_matching::Stylist; use style::stylesheets::{Origin, Stylesheet, CSSRuleIteratorExt}; use url::Url; diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs index a81f1f2e623..b0c3702f2c2 100644 --- a/components/layout/list_item.rs +++ b/components/layout/list_item.rs @@ -20,12 +20,12 @@ use text; use euclid::{Point2D, Rect}; use gfx::display_list::DisplayList; +use std::sync::Arc; +use style::computed_values::{list_style_type, position}; +use style::properties::ComputedValues; use util::geometry::Au; use util::logical_geometry::LogicalSize; use util::opts; -use style::properties::ComputedValues; -use style::computed_values::{list_style_type, position}; -use std::sync::Arc; /// A block with the CSS `display` property equal to `list-item`. #[derive(Debug)] diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs index 784df3d0ba7..8a9738a6038 100644 --- a/components/layout/multicol.rs +++ b/components/layout/multicol.rs @@ -13,11 +13,11 @@ use flow::{FlowClass, Flow, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator}; use euclid::{Point2D, Rect}; -use util::geometry::Au; -use util::logical_geometry::LogicalSize; use std::fmt; -use style::properties::ComputedValues; use std::sync::Arc; +use style::properties::ComputedValues; +use util::geometry::Au; +use util::logical_geometry::LogicalSize; pub struct MulticolFlow { pub block_flow: BlockFlow, diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs index c936dd00a16..7895127e4be 100644 --- a/components/layout/parallel.rs +++ b/components/layout/parallel.rs @@ -9,16 +9,16 @@ #![allow(unsafe_code)] use context::{LayoutContext, SharedLayoutContext}; -use flow::{Flow, MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal}; use flow; +use flow::{Flow, MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal}; use flow_ref::FlowRef; -use traversal::{PreorderDomTraversal, PostorderDomTraversal}; use traversal::PostorderNodeMutTraversal; use traversal::{BubbleISizes, AssignISizes, AssignBSizesAndStoreOverflow}; use traversal::{ComputeAbsolutePositions, BuildDisplayList}; +use traversal::{PreorderDomTraversal, PostorderDomTraversal}; use traversal::{RecalcStyleForNode, ConstructFlows}; -use wrapper::{layout_node_to_unsafe_layout_node, layout_node_from_unsafe_layout_node, LayoutNode}; use wrapper::UnsafeLayoutNode; +use wrapper::{layout_node_to_unsafe_layout_node, layout_node_from_unsafe_layout_node, LayoutNode}; use profile_traits::time::{self, ProfilerMetadata, profile}; use std::mem; diff --git a/components/layout/query.rs b/components/layout/query.rs index 01f1c6065b5..80ea4c534ca 100644 --- a/components/layout/query.rs +++ b/components/layout/query.rs @@ -11,8 +11,8 @@ use euclid::rect::Rect; use flow_ref::FlowRef; use fragment::{Fragment, FragmentBorderBoxIterator}; use gfx::display_list::{DisplayItemMetadata, OpaqueNode}; -use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::ConstellationChan; +use msg::constellation_msg::Msg as ConstellationMsg; use opaque_node::OpaqueNodeMethods; use script::layout_interface::{ContentBoxResponse, ContentBoxesResponse, NodeGeometryResponse}; use script::layout_interface::{HitTestResponse, LayoutRPC, MouseOverResponse, OffsetParentResponse}; @@ -20,8 +20,8 @@ use script::layout_interface::{ResolvedStyleResponse, ScriptLayoutChan, TrustedN use sequential; use std::sync::{Arc, Mutex}; -use util::geometry::Au; use util::cursor::Cursor; +use util::geometry::Au; use util::logical_geometry::WritingMode; pub struct LayoutRPCImpl(pub Arc<Mutex<LayoutTaskData>>); diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs index 573d35a7b67..51d8f39e59e 100644 --- a/components/layout/sequential.rs +++ b/components/layout/sequential.rs @@ -5,16 +5,16 @@ //! Implements sequential traversals over the DOM and flow trees. use context::{LayoutContext, SharedLayoutContext}; -use flow::{self, Flow, ImmutableFlowUtils, InorderFlowTraversal, MutableFlowUtils}; use flow::{PostorderFlowTraversal, PreorderFlowTraversal}; +use flow::{self, Flow, ImmutableFlowUtils, InorderFlowTraversal, MutableFlowUtils}; use flow_ref::FlowRef; use fragment::FragmentBorderBoxIterator; use generated_content::ResolveGeneratedContent; -use traversal::{PreorderDomTraversal, PostorderDomTraversal}; use traversal::PostorderNodeMutTraversal; -use traversal::{BubbleISizes, RecalcStyleForNode, ConstructFlows}; use traversal::{AssignBSizesAndStoreOverflow, AssignISizes}; +use traversal::{BubbleISizes, RecalcStyleForNode, ConstructFlows}; use traversal::{ComputeAbsolutePositions, BuildDisplayList}; +use traversal::{PreorderDomTraversal, PostorderDomTraversal}; use wrapper::LayoutNode; use euclid::point::Point2D; diff --git a/components/layout/table.rs b/components/layout/table.rs index 5d42b0772d4..f5ef95f1989 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -6,18 +6,18 @@ #![deny(unsafe_code)] -use block::{self, BlockFlow, CandidateBSizeIterator, ISizeAndMarginsComputer}; use block::{ISizeConstraintInput, ISizeConstraintSolution}; +use block::{self, BlockFlow, CandidateBSizeIterator, ISizeAndMarginsComputer}; use context::LayoutContext; use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode}; -use flow::{self, Flow, FlowClass, IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS}; use flow::{ImmutableFlowUtils, OpaqueFlow}; +use flow::{self, Flow, FlowClass, IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS}; use fragment::{Fragment, FragmentBorderBoxIterator}; use incremental::{REFLOW, REFLOW_OUT_OF_FLOW}; use layout_debug; use model::{IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto}; -use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance}; use table_row::{TableRowFlow}; +use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance}; use table_wrapper::TableLayout; use euclid::{Point2D, Rect}; diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs index 5cd35f5be99..460478790c6 100644 --- a/components/layout/table_caption.rs +++ b/components/layout/table_caption.rs @@ -12,11 +12,11 @@ use flow::{FlowClass, Flow, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator}; use euclid::{Point2D, Rect}; -use util::geometry::Au; -use util::logical_geometry::LogicalSize; use std::fmt; -use style::properties::ComputedValues; use std::sync::Arc; +use style::properties::ComputedValues; +use util::geometry::Au; +use util::logical_geometry::LogicalSize; /// A table formatting context. pub struct TableCaptionFlow { diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs index 56c66d2a967..fcb54b0d9ab 100644 --- a/components/layout/table_cell.rs +++ b/components/layout/table_cell.rs @@ -11,8 +11,8 @@ use context::LayoutContext; use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode}; use flow::{Flow, FlowClass, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator}; -use model::MaybeAuto; use layout_debug; +use model::MaybeAuto; use table::InternalTable; use table_row::{CollapsedBorder, CollapsedBorderProvenance}; use wrapper::ThreadSafeLayoutNode; diff --git a/components/layout/table_colgroup.rs b/components/layout/table_colgroup.rs index 7e8d2976823..aacff8cc011 100644 --- a/components/layout/table_colgroup.rs +++ b/components/layout/table_colgroup.rs @@ -12,12 +12,12 @@ use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo}; use layout_debug; use euclid::{Point2D, Rect}; -use util::geometry::{Au, ZERO_RECT}; use std::cmp::max; use std::fmt; -use style::values::computed::LengthOrPercentageOrAuto; -use style::properties::ComputedValues; use std::sync::Arc; +use style::properties::ComputedValues; +use style::values::computed::LengthOrPercentageOrAuto; +use util::geometry::{Au, ZERO_RECT}; use util::logical_geometry::LogicalSize; /// A table formatting context. diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index 4dc732ff922..e2b155bca78 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -13,9 +13,9 @@ use flow::{self, FlowClass, Flow, ImmutableFlowUtils, OpaqueFlow}; use flow_list::MutFlowListIterator; use fragment::{Fragment, FragmentBorderBoxIterator}; use layout_debug; +use model::MaybeAuto; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt}; use table_cell::{CollapsedBordersForCell, TableCellFlow}; -use model::MaybeAuto; use cssparser::{Color, RGBA}; use euclid::{Point2D, Rect}; diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index 4beb11e76d7..c3312bceba9 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -25,8 +25,6 @@ use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize}; use table_row; use euclid::{Point2D, Rect}; -use util::geometry::Au; -use util::logical_geometry::LogicalSize; use std::cmp::{max, min}; use std::fmt; use std::ops::Add; @@ -35,6 +33,8 @@ use style::computed_values::{border_collapse, table_layout}; use style::properties::ComputedValues; use style::values::CSSFloat; use style::values::computed::LengthOrPercentageOrAuto; +use util::geometry::Au; +use util::logical_geometry::LogicalSize; #[derive(Copy, Clone, RustcEncodable, Debug)] pub enum TableLayout { diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index 0fbf159d7c3..7c4687a1b00 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -4,15 +4,15 @@ //! Traversals over the DOM and flow trees, running the layout computations. -use css::matching::{ApplicableDeclarations, MatchMethods, StyleSharingResult}; use construct::FlowConstructor; use context::LayoutContext; -use flow::{self, Flow}; +use css::matching::{ApplicableDeclarations, MatchMethods, StyleSharingResult}; use flow::{PreorderFlowTraversal, PostorderFlowTraversal}; +use flow::{self, Flow}; use incremental::{self, BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, RestyleDamage}; use script::layout_interface::ReflowGoal; -use wrapper::{layout_node_to_unsafe_layout_node, LayoutNode}; use wrapper::{ThreadSafeLayoutNode, UnsafeLayoutNode}; +use wrapper::{layout_node_to_unsafe_layout_node, LayoutNode}; use selectors::bloom::BloomFilter; use util::opts; diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index a44db23a02d..6deb515f5f2 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -32,12 +32,13 @@ use canvas_traits::CanvasMsg; use context::SharedLayoutContext; -use incremental::RestyleDamage; use data::{LayoutDataFlags, LayoutDataWrapper, PrivateLayoutData}; +use incremental::RestyleDamage; use opaque_node::OpaqueNodeMethods; use gfx::display_list::OpaqueNode; use ipc_channel::ipc::IpcSender; +use msg::constellation_msg::{PipelineId, SubpageId}; use script::dom::attr::AttrValue; use script::dom::bindings::codegen::InheritTypes::{CharacterDataCast, ElementCast}; use script::dom::bindings::codegen::InheritTypes::{HTMLIFrameElementCast, HTMLCanvasElementCast}; @@ -47,18 +48,18 @@ use script::dom::bindings::js::LayoutJS; use script::dom::characterdata::{CharacterDataTypeId, LayoutCharacterDataHelpers}; use script::dom::element::{Element, ElementTypeId}; use script::dom::element::{LayoutElementHelpers, RawLayoutElementHelpers}; -use script::dom::htmlelement::HTMLElementTypeId; use script::dom::htmlcanvaselement::LayoutHTMLCanvasElementHelpers; +use script::dom::htmlelement::HTMLElementTypeId; use script::dom::htmlimageelement::LayoutHTMLImageElementHelpers; use script::dom::htmlinputelement::{HTMLInputElement, LayoutHTMLInputElementHelpers}; use script::dom::htmltextareaelement::LayoutHTMLTextAreaElementHelpers; -use script::dom::node::{Node, NodeTypeId}; -use script::dom::node::{LayoutNodeHelpers, SharedLayoutData}; use script::dom::node::{HAS_CHANGED, IS_DIRTY, HAS_DIRTY_SIBLINGS, HAS_DIRTY_DESCENDANTS}; +use script::dom::node::{LayoutNodeHelpers, SharedLayoutData}; +use script::dom::node::{Node, NodeTypeId}; use script::dom::text::Text; +use selectors::matching::DeclarationBlock; +use selectors::parser::{NamespaceConstraint, AttrSelector}; use smallvec::VecLike; -use msg::constellation_msg::{PipelineId, SubpageId}; -use util::str::is_whitespace; use std::borrow::ToOwned; use std::cell::{Ref, RefMut}; use std::marker::PhantomData; @@ -67,13 +68,12 @@ use std::sync::Arc; use string_cache::{Atom, Namespace}; use style::computed_values::content::ContentItem; use style::computed_values::{content, display, white_space}; -use selectors::matching::DeclarationBlock; -use selectors::parser::{NamespaceConstraint, AttrSelector}; use style::legacy::UnsignedIntegerAttribute; use style::node::TElementAttributes; -use style::properties::{PropertyDeclaration, PropertyDeclarationBlock}; use style::properties::ComputedValues; +use style::properties::{PropertyDeclaration, PropertyDeclarationBlock}; use url::Url; +use util::str::is_whitespace; /// A wrapper so that layout can access only the methods that it should have access to. Layout must /// only ever see these and must never see instances of `LayoutJS`. diff --git a/components/layout_traits/lib.rs b/components/layout_traits/lib.rs index 16b3bdcda06..e888072eda9 100644 --- a/components/layout_traits/lib.rs +++ b/components/layout_traits/lib.rs @@ -25,9 +25,9 @@ use gfx::font_cache_task::FontCacheTask; use gfx::paint_task::LayoutToPaintMsg; use ipc_channel::ipc::{IpcReceiver, IpcSender}; use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; +use net_traits::image_cache_task::ImageCacheTask; use profile_traits::mem; use profile_traits::time; -use net_traits::image_cache_task::ImageCacheTask; use script_traits::{LayoutControlMsg, ConstellationControlMsg, OpaqueScriptLayoutChannel}; use std::sync::mpsc::Sender; use url::Url; diff --git a/components/msg/compositor_msg.rs b/components/msg/compositor_msg.rs index d4a38805b1f..6dd58b8aae6 100644 --- a/components/msg/compositor_msg.rs +++ b/components/msg/compositor_msg.rs @@ -4,13 +4,13 @@ use azure::azure_hl::Color; use constellation_msg::{Key, KeyState, KeyModifiers}; +use euclid::Matrix4; use euclid::point::Point2D; use euclid::rect::Rect; -use euclid::Matrix4; -use layers::platform::surface::NativeDisplay; use layers::layers::{BufferRequest, LayerBufferSet}; -use std::fmt::{Formatter, Debug}; +use layers::platform::surface::NativeDisplay; use std::fmt; +use std::fmt::{Formatter, Debug}; use constellation_msg::PipelineId; diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index fbb1bae6bd7..18044e33ae9 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -9,21 +9,21 @@ use compositor_msg::Epoch; use canvas_traits::CanvasMsg; use euclid::rect::Rect; -use euclid::size::{Size2D, TypedSize2D}; use euclid::scale_factor::ScaleFactor; +use euclid::size::{Size2D, TypedSize2D}; use hyper::header::Headers; use hyper::method::Method; use ipc_channel::ipc::IpcSender; use layers::geometry::DevicePixel; use offscreen_gl_context::GLContextAttributes; use png::Image; -use util::cursor::Cursor; -use util::geometry::{PagePx, ViewportPx}; -use util::mem::HeapSizeOf; use std::collections::HashMap; use std::sync::mpsc::{channel, Sender, Receiver}; use style::viewport::ViewportConstraints; use url::Url; +use util::cursor::Cursor; +use util::geometry::{PagePx, ViewportPx}; +use util::mem::HeapSizeOf; use webdriver_msg::{WebDriverScriptCommand, LoadStatus}; #[derive(Clone)] diff --git a/components/net/about_loader.rs b/components/net/about_loader.rs index aab22f1a2f9..105162f29d0 100644 --- a/components/net/about_loader.rs +++ b/components/net/about_loader.rs @@ -2,16 +2,16 @@ * 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 net_traits::{LoadData, Metadata, LoadConsumer}; -use net_traits::ProgressMsg::Done; +use file_loader; use mime_classifier::MIMEClassifier; +use net_traits::ProgressMsg::Done; +use net_traits::{LoadData, Metadata, LoadConsumer}; use resource_task::start_sending; -use file_loader; -use url::Url; use hyper::header::ContentType; use hyper::http::RawStatus; use hyper::mime::{Mime, TopLevel, SubLevel}; +use url::Url; use util::resource_files::resources_dir_path; use std::fs::PathExt; diff --git a/components/net/cookie.rs b/components/net/cookie.rs index 0e6c8fdf9ae..acf2edf28d0 100644 --- a/components/net/cookie.rs +++ b/components/net/cookie.rs @@ -9,10 +9,10 @@ use net_traits::CookieSource; use pub_domains::PUB_DOMAINS; use cookie_rs; -use time::{Tm, now, at, Duration}; -use url::Url; use std::borrow::ToOwned; use std::net::{Ipv4Addr, Ipv6Addr}; +use time::{Tm, now, at, Duration}; +use url::Url; /// A stored cookie that wraps the definition in cookie-rs. This is used to implement /// various behaviours defined in the spec that rely on an associated request URL, diff --git a/components/net/cookie_storage.rs b/components/net/cookie_storage.rs index cf28e25ab27..9abd20217a3 100644 --- a/components/net/cookie_storage.rs +++ b/components/net/cookie_storage.rs @@ -5,10 +5,10 @@ //! Implementation of cookie storage as specified in //! http://tools.ietf.org/html/rfc6265 -use net_traits::CookieSource; -use url::Url; use cookie::Cookie; +use net_traits::CookieSource; use std::cmp::Ordering; +use url::Url; pub struct CookieStorage { cookies: Vec<Cookie> diff --git a/components/net/data_loader.rs b/components/net/data_loader.rs index d4bad86a412..28134d43d97 100644 --- a/components/net/data_loader.rs +++ b/components/net/data_loader.rs @@ -2,17 +2,17 @@ * 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 net_traits::{LoadData, Metadata, LoadConsumer}; -use net_traits::ProgressMsg::{Payload, Done}; use mime_classifier::MIMEClassifier; +use net_traits::ProgressMsg::{Payload, Done}; +use net_traits::{LoadData, Metadata, LoadConsumer}; use resource_task::start_sending; use rustc_serialize::base64::FromBase64; use hyper::mime::Mime; use std::sync::Arc; -use url::percent_encoding::percent_decode; use url::SchemeData; +use url::percent_encoding::percent_decode; pub fn factory(load_data: LoadData, senders: LoadConsumer, _classifier: Arc<MIMEClassifier>) { // NB: we don't spawn a new task. diff --git a/components/net/fetch/request.rs b/components/net/fetch/request.rs index 150e01eec9e..dc2c11655de 100644 --- a/components/net/fetch/request.rs +++ b/components/net/fetch/request.rs @@ -2,18 +2,18 @@ * 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 url::Url; -use hyper::method::Method; -use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value}; -use hyper::header::{Header, Headers, ContentType, IfModifiedSince, IfNoneMatch}; +use fetch::cors_cache::{CORSCache, CacheRequestDetails}; +use fetch::response::{Response, ResponseType}; use hyper::header::{Accept, IfUnmodifiedSince, IfMatch, IfRange, Location}; +use hyper::header::{Header, Headers, ContentType, IfModifiedSince, IfNoneMatch}; use hyper::header::{HeaderView, AcceptLanguage, ContentLanguage}; use hyper::header::{QualityItem, qitem, q}; +use hyper::method::Method; +use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value}; use hyper::status::StatusCode; -use fetch::cors_cache::{CORSCache, CacheRequestDetails}; -use fetch::response::{Response, ResponseType}; use std::ascii::AsciiExt; use std::str::FromStr; +use url::Url; /// A [request context](https://fetch.spec.whatwg.org/#concept-request-context) #[derive(Copy, Clone, PartialEq)] diff --git a/components/net/fetch/response.rs b/components/net/fetch/response.rs index f63ac5e98bf..8d41a1c81a4 100644 --- a/components/net/fetch/response.rs +++ b/components/net/fetch/response.rs @@ -2,11 +2,11 @@ * 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 url::Url; -use hyper::status::StatusCode; use hyper::header::Headers; +use hyper::status::StatusCode; use std::ascii::AsciiExt; use std::sync::mpsc::Receiver; +use url::Url; /// [Response type](https://fetch.spec.whatwg.org/#concept-response-type) #[derive(Clone, PartialEq, Copy)] diff --git a/components/net/file_loader.rs b/components/net/file_loader.rs index a81d0e8afdb..28b3786809f 100644 --- a/components/net/file_loader.rs +++ b/components/net/file_loader.rs @@ -2,9 +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 net_traits::{LoadData, Metadata, LoadConsumer}; -use net_traits::ProgressMsg::{Payload, Done}; use mime_classifier::MIMEClassifier; +use net_traits::ProgressMsg::{Payload, Done}; +use net_traits::{LoadData, Metadata, LoadConsumer}; use resource_task::{start_sending, start_sending_sniffed, ProgressSender}; use std::borrow::ToOwned; diff --git a/components/net/hsts.rs b/components/net/hsts.rs index dcb25740b83..1b8559243ee 100644 --- a/components/net/hsts.rs +++ b/components/net/hsts.rs @@ -2,10 +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 net_traits::{IncludeSubdomains, IPV4_REGEX, IPV6_REGEX}; use rustc_serialize::json::{decode}; use time; use url::Url; -use net_traits::{IncludeSubdomains, IPV4_REGEX, IPV6_REGEX}; use std::str::{from_utf8}; diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index 05d6ef74cea..bc47b6aa709 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -2,41 +2,41 @@ * 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 net_traits::{ControlMsg, CookieSource, LoadData, Metadata, LoadConsumer, IncludeSubdomains}; -use net_traits::ProgressMsg::{Payload, Done}; -use net_traits::hosts::replace_hosts; use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg, NetworkEvent}; +use hsts::{HSTSList, secure_url}; use mime_classifier::MIMEClassifier; +use net_traits::ProgressMsg::{Payload, Done}; +use net_traits::hosts::replace_hosts; +use net_traits::{ControlMsg, CookieSource, LoadData, Metadata, LoadConsumer, IncludeSubdomains}; use resource_task::{start_sending_opt, start_sending_sniffed_opt}; -use hsts::{HSTSList, secure_url}; -use ipc_channel::ipc::{self, IpcSender}; -use log; -use std::collections::HashSet; use file_loader; use flate2::read::{DeflateDecoder, GzDecoder}; +use hyper::Error as HttpError; use hyper::client::Request; -use hyper::header::{AcceptEncoding, Accept, ContentLength, ContentType, Host, Location, qitem, Quality, QualityItem}; use hyper::header::StrictTransportSecurity; -use hyper::Error as HttpError; +use hyper::header::{AcceptEncoding, Accept, ContentLength, ContentType, Host, Location, qitem, Quality, QualityItem}; use hyper::method::Method; use hyper::mime::{Mime, TopLevel, SubLevel}; use hyper::net::{HttpConnector, HttpsConnector, Openssl}; use hyper::status::{StatusCode, StatusClass}; -use std::error::Error; +use ipc_channel::ipc::{self, IpcSender}; +use log; use openssl::ssl::{SslContext, SslMethod, SSL_VERIFY_PEER}; +use std::collections::HashSet; +use std::error::Error; use std::io::{self, Read, Write}; use std::sync::Arc; use std::sync::Mutex; use std::sync::mpsc::{Sender, channel}; -use util::task::spawn_named; -use util::resource_files::resources_dir_path; -use util::opts; use url::{Url, UrlParser}; +use util::opts; +use util::resource_files::resources_dir_path; +use util::task::spawn_named; -use uuid; use std::borrow::ToOwned; use std::boxed::FnBox; +use uuid; pub fn factory(resource_mgr_chan: IpcSender<ControlMsg>, devtools_chan: Option<Sender<DevtoolsControlMsg>>, diff --git a/components/net/image_cache_task.rs b/components/net/image_cache_task.rs index f0d97ba827b..0e371f3e688 100644 --- a/components/net/image_cache_task.rs +++ b/components/net/image_cache_task.rs @@ -5,21 +5,21 @@ use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::router::ROUTER; use net_traits::image::base::{Image, load_from_memory}; -use net_traits::image_cache_task::{ImageState, ImageCacheTask, ImageCacheChan, ImageCacheCommand}; +use net_traits::image_cache_task::ImageResponder; use net_traits::image_cache_task::{ImageCacheResult, ImageResponse, UsePlaceholder}; +use net_traits::image_cache_task::{ImageState, ImageCacheTask, ImageCacheChan, ImageCacheCommand}; use net_traits::load_whole_resource; +use net_traits::{AsyncResponseTarget, ControlMsg, LoadData, ResponseAction, ResourceTask, LoadConsumer}; use std::borrow::ToOwned; use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::mem; use std::sync::Arc; use std::sync::mpsc::{channel, Sender, Receiver, Select}; +use url::Url; use util::resource_files::resources_dir_path; use util::task::spawn_named; use util::taskpool::TaskPool; -use url::Url; -use net_traits::{AsyncResponseTarget, ControlMsg, LoadData, ResponseAction, ResourceTask, LoadConsumer}; -use net_traits::image_cache_task::ImageResponder; /// /// TODO(gw): Remaining work on image cache: diff --git a/components/net/resource_task.rs b/components/net/resource_task.rs index 88200313cb8..62566f71c70 100644 --- a/components/net/resource_task.rs +++ b/components/net/resource_task.rs @@ -5,19 +5,19 @@ //! A task that takes a URL and streams back the binary data. use about_loader; +use cookie; +use cookie_storage::CookieStorage; use data_loader; use file_loader; use http_loader; -use cookie_storage::CookieStorage; -use cookie; use mime_classifier::MIMEClassifier; +use net_traits::ProgressMsg::Done; use net_traits::{ControlMsg, LoadData, LoadResponse, LoadConsumer, CookieSource}; use net_traits::{Metadata, ProgressMsg, ResourceTask, AsyncResponseTarget, ResponseAction}; -use net_traits::ProgressMsg::Done; +use url::Url; use util::opts; use util::task::spawn_named; -use url::Url; use hsts::{HSTSList, HSTSEntry, preload_hsts_domains}; diff --git a/components/net_traits/image_cache_task.rs b/components/net_traits/image_cache_task.rs index af675bb0f85..be6e483daf0 100644 --- a/components/net_traits/image_cache_task.rs +++ b/components/net_traits/image_cache_task.rs @@ -4,8 +4,8 @@ use image::base::Image; use ipc_channel::ipc::{self, IpcSender}; -use url::Url; use std::sync::Arc; +use url::Url; use util::mem::HeapSizeOf; /// This is optionally passed to the image cache when requesting diff --git a/components/plugins/casing.rs b/components/plugins/casing.rs index 40de2ff8d42..8a535cabf00 100644 --- a/components/plugins/casing.rs +++ b/components/plugins/casing.rs @@ -2,11 +2,11 @@ * 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 syntax::ext::base::ExtCtxt; -use syntax::ext::build::AstBuilder; -use syntax::codemap::Span; use syntax::ast; +use syntax::codemap::Span; use syntax::ext::base; +use syntax::ext::base::ExtCtxt; +use syntax::ext::build::AstBuilder; use syntax::parse::token; pub fn expand_lower<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) diff --git a/components/plugins/heap_size.rs b/components/plugins/heap_size.rs index 7e4c508a8aa..3ab1fc814a1 100644 --- a/components/plugins/heap_size.rs +++ b/components/plugins/heap_size.rs @@ -13,13 +13,13 @@ //! be ignored in this calculation. Providing a reason is compulsory. -use syntax::ext::base::{Annotatable, ExtCtxt}; -use syntax::codemap::Span; -use syntax::ptr::P; use syntax::ast::*; use syntax::attr::AttrMetaMethods; +use syntax::codemap::Span; +use syntax::ext::base::{Annotatable, ExtCtxt}; use syntax::ext::build::AstBuilder; use syntax::ext::deriving::generic::*; +use syntax::ptr::P; pub fn expand_heap_size(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item: &Annotatable, push: &mut FnMut(Annotatable)) { diff --git a/components/plugins/jstraceable.rs b/components/plugins/jstraceable.rs index dcfeda5418f..035c50d5e46 100644 --- a/components/plugins/jstraceable.rs +++ b/components/plugins/jstraceable.rs @@ -2,14 +2,14 @@ * 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 syntax::ext::base::{Annotatable, ExtCtxt}; -use syntax::codemap::Span; -use syntax::ptr::P; -use syntax::ast::{MetaItem, Expr}; use syntax::ast; +use syntax::ast::{MetaItem, Expr}; +use syntax::codemap::Span; +use syntax::ext::base::{Annotatable, ExtCtxt}; use syntax::ext::build::AstBuilder; -use syntax::ext::deriving::generic::{combine_substructure, EnumMatching, FieldInfo, MethodDef}; use syntax::ext::deriving::generic::{Struct, Substructure, TraitDef, ty}; +use syntax::ext::deriving::generic::{combine_substructure, EnumMatching, FieldInfo, MethodDef}; +use syntax::ptr::P; pub fn expand_dom_struct(cx: &mut ExtCtxt, sp: Span, _: &MetaItem, anno: Annotatable) -> Annotatable { if let Annotatable::Item(item) = anno { diff --git a/components/plugins/lib.rs b/components/plugins/lib.rs index 8b69f2049bb..5a87cd32ce1 100644 --- a/components/plugins/lib.rs +++ b/components/plugins/lib.rs @@ -28,8 +28,8 @@ use rustc::lint::LintPassObject; use rustc::plugin::Registry; use syntax::ext::base::*; -use syntax::parse::token::intern; use syntax::feature_gate::AttributeType::Whitelisted; +use syntax::parse::token::intern; // Public for documentation to show up /// Handles the auto-deriving for `#[derive(JSTraceable)]` diff --git a/components/plugins/lints/ban.rs b/components/plugins/lints/ban.rs index a4c3b7cea07..3be7f49a52b 100644 --- a/components/plugins/lints/ban.rs +++ b/components/plugins/lints/ban.rs @@ -2,8 +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 syntax::ast; use rustc::lint::{Context, LintPass, LintArray}; +use syntax::ast; use utils::match_ty_unwrap; declare_lint!(BANNED_TYPE, Deny, diff --git a/components/plugins/lints/inheritance_integrity.rs b/components/plugins/lints/inheritance_integrity.rs index 0e48a198fa2..ab6dc2d1a1b 100644 --- a/components/plugins/lints/inheritance_integrity.rs +++ b/components/plugins/lints/inheritance_integrity.rs @@ -2,9 +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 syntax::{ast, ast_util}; use rustc::lint::{Context, LintPass, LintArray, Level}; use rustc::middle::def; +use syntax::{ast, ast_util}; use utils::match_lang_ty; diff --git a/components/plugins/lints/privatize.rs b/components/plugins/lints/privatize.rs index 430edf50d30..7ef92eeaf30 100644 --- a/components/plugins/lints/privatize.rs +++ b/components/plugins/lints/privatize.rs @@ -2,10 +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 syntax::{ast, ast_util}; +use rustc::lint::{Context, LintPass, LintArray}; use syntax::ast::Public; use syntax::attr::AttrMetaMethods; -use rustc::lint::{Context, LintPass, LintArray}; +use syntax::{ast, ast_util}; declare_lint!(PRIVATIZE, Deny, "Allows to enforce private fields for struct definitions"); diff --git a/components/plugins/lints/str_to_string.rs b/components/plugins/lints/str_to_string.rs index 03a6b4f3a3e..431a161e999 100644 --- a/components/plugins/lints/str_to_string.rs +++ b/components/plugins/lints/str_to_string.rs @@ -2,9 +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 syntax::ast; use rustc::lint::{Context, LintPass, LintArray}; use rustc::middle::ty; +use syntax::ast; declare_lint!(STR_TO_STRING, Deny, "Warn when a String could use to_owned() instead of to_string()"); diff --git a/components/plugins/lints/transmute_type.rs b/components/plugins/lints/transmute_type.rs index ece4c8cf29b..94255e377a7 100644 --- a/components/plugins/lints/transmute_type.rs +++ b/components/plugins/lints/transmute_type.rs @@ -2,9 +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 rustc::lint::{Context, LintPass, LintArray}; use syntax::ast; use syntax::attr::AttrMetaMethods; -use rustc::lint::{Context, LintPass, LintArray}; declare_lint!(TRANSMUTE_TYPE_LINT, Allow, "Warn and report types being transmuted"); diff --git a/components/plugins/lints/unrooted_must_root.rs b/components/plugins/lints/unrooted_must_root.rs index 190ce92292a..9a94919556a 100644 --- a/components/plugins/lints/unrooted_must_root.rs +++ b/components/plugins/lints/unrooted_must_root.rs @@ -2,12 +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 syntax::{ast, codemap, visit}; -use syntax::attr::AttrMetaMethods; use rustc::ast_map; use rustc::lint::{Context, LintPass, LintArray}; -use rustc::middle::ty; use rustc::middle::astconv_util::ast_ty_to_prim_ty; +use rustc::middle::ty; +use syntax::attr::AttrMetaMethods; +use syntax::{ast, codemap, visit}; use utils::{match_def_path, unsafe_context}; declare_lint!(UNROOTED_MUST_ROOT, Deny, diff --git a/components/plugins/reflector.rs b/components/plugins/reflector.rs index 6bb43552a3e..4e4a0f3b442 100644 --- a/components/plugins/reflector.rs +++ b/components/plugins/reflector.rs @@ -2,10 +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 syntax::ext::base::{Annotatable, ExtCtxt}; -use syntax::codemap::Span; -use syntax::ast::MetaItem; use syntax::ast; +use syntax::ast::MetaItem; +use syntax::codemap::Span; +use syntax::ext::base::{Annotatable, ExtCtxt}; use utils::match_ty_unwrap; diff --git a/components/plugins/utils.rs b/components/plugins/utils.rs index 6327ada2f17..79025c33f70 100644 --- a/components/plugins/utils.rs +++ b/components/plugins/utils.rs @@ -6,10 +6,10 @@ use rustc::ast_map; use rustc::lint::Context; use rustc::middle::def; -use syntax::ptr::P; use syntax::ast; use syntax::ast::{TyPath, Path, AngleBracketedParameters, PathSegment, Ty}; use syntax::attr::mark_used; +use syntax::ptr::P; /// Matches a type with a provided string, and returns its type parameters if successful diff --git a/components/profile/mem.rs b/components/profile/mem.rs index 6c8e2c4b55a..dae86a535fd 100644 --- a/components/profile/mem.rs +++ b/components/profile/mem.rs @@ -6,8 +6,8 @@ use ipc_channel::ipc::{self, IpcReceiver}; use ipc_channel::router::ROUTER; -use profile_traits::mem::{ProfilerChan, ProfilerMsg, Reporter, ReporterRequest, ReportKind}; use profile_traits::mem::ReportsChan; +use profile_traits::mem::{ProfilerChan, ProfilerMsg, Reporter, ReporterRequest, ReportKind}; use std::borrow::ToOwned; use std::cmp::Ordering; use std::collections::HashMap; diff --git a/components/profile_traits/mem.rs b/components/profile_traits/mem.rs index da23a1fc73f..25b4b8d2252 100644 --- a/components/profile_traits/mem.rs +++ b/components/profile_traits/mem.rs @@ -9,8 +9,8 @@ use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::router::ROUTER; -use std::sync::mpsc::Sender; use std::marker::Send; +use std::sync::mpsc::Sender; /// A trait to abstract away the various kinds of message senders we use. pub trait OpaqueSender<T> { diff --git a/components/script/cors.rs b/components/script/cors.rs index 108f37790a3..587cdaacf87 100644 --- a/components/script/cors.rs +++ b/components/script/cors.rs @@ -9,9 +9,9 @@ //! This library will eventually become the core of the Fetch crate //! with CORSRequest being expanded into FetchRequest (etc) +use net_traits::{AsyncResponseListener, ResponseAction, Metadata}; use network_listener::{NetworkListener, PreInvoke}; use script_task::ScriptChan; -use net_traits::{AsyncResponseListener, ResponseAction, Metadata}; use std::ascii::AsciiExt; use std::borrow::ToOwned; @@ -20,14 +20,14 @@ use std::sync::{Arc, Mutex}; use time; use time::{now, Timespec}; -use hyper::header::{AccessControlRequestMethod, AccessControlAllowMethods}; +use hyper::client::Request; use hyper::header::{AccessControlMaxAge, AccessControlAllowOrigin}; use hyper::header::{AccessControlRequestHeaders, AccessControlAllowHeaders}; -use hyper::header::{Headers, HeaderView}; -use hyper::client::Request; -use hyper::mime::{Mime, TopLevel, SubLevel}; +use hyper::header::{AccessControlRequestMethod, AccessControlAllowMethods}; use hyper::header::{ContentType, Host}; +use hyper::header::{Headers, HeaderView}; use hyper::method::Method; +use hyper::mime::{Mime, TopLevel, SubLevel}; use hyper::status::StatusClass::Success; use unicase::UniCase; diff --git a/components/script/devtools.rs b/components/script/devtools.rs index 25a0da81a40..d2feb56674e 100644 --- a/components/script/devtools.rs +++ b/components/script/devtools.rs @@ -3,25 +3,25 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use devtools_traits::{CachedConsoleMessage, CachedConsoleMessageTypes, PAGE_ERROR, CONSOLE_API}; -use devtools_traits::{EvaluateJSReply, NodeInfo, Modification, TimelineMarker, TimelineMarkerType}; use devtools_traits::{ConsoleAPI, PageError, ScriptToDevtoolsControlMsg, ComputedNodeLayout}; -use dom::bindings::conversions::jsstring_to_str; -use dom::bindings::conversions::FromJSValConvertible; -use dom::bindings::js::Root; -use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast}; -use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; +use devtools_traits::{EvaluateJSReply, NodeInfo, Modification, TimelineMarker, TimelineMarkerType}; use dom::bindings::codegen::Bindings::DOMRectBinding::{DOMRectMethods}; +use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::ElementBinding::{ElementMethods}; +use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast}; +use dom::bindings::conversions::FromJSValConvertible; +use dom::bindings::conversions::jsstring_to_str; use dom::bindings::global::GlobalRef; +use dom::bindings::js::Root; +use dom::document::DocumentHelpers; use dom::node::{Node, NodeHelpers}; use dom::window::{WindowHelpers, ScriptHelpers}; -use dom::document::DocumentHelpers; -use page::{IterablePage, Page}; use ipc_channel::ipc::IpcSender; -use msg::constellation_msg::PipelineId; -use script_task::{get_page, ScriptTask}; use js::jsapi::{ObjectClassName, RootedObject, RootedValue}; use js::jsval::UndefinedValue; +use msg::constellation_msg::PipelineId; +use page::{IterablePage, Page}; +use script_task::{get_page, ScriptTask}; use std::ffi::CStr; use std::rc::Rc; use std::str; diff --git a/components/script/document_loader.rs b/components/script/document_loader.rs index 8a062548852..6ea7767bfab 100644 --- a/components/script/document_loader.rs +++ b/components/script/document_loader.rs @@ -5,10 +5,10 @@ //! Tracking of pending loads in a document. //! https://html.spec.whatwg.org/multipage/#the-end -use script_task::MainThreadScriptMsg; use msg::constellation_msg::{PipelineId}; -use net_traits::{Metadata, load_whole_resource, ResourceTask, PendingAsyncLoad}; use net_traits::AsyncResponseTarget; +use net_traits::{Metadata, load_whole_resource, ResourceTask, PendingAsyncLoad}; +use script_task::MainThreadScriptMsg; use std::sync::Arc; use std::sync::mpsc::Sender; use url::Url; diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index 06950a515b0..3df9265580e 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -10,8 +10,8 @@ use dom::bindings::js::{JS, MutNullableHeap}; use dom::bindings::js::{Root, RootedReference, LayoutJS}; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::element::{Element, AttributeHandlers}; -use dom::window::Window; 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}; diff --git a/components/script/dom/bindings/callback.rs b/components/script/dom/bindings/callback.rs index 905901e3870..e5a887a88b0 100644 --- a/components/script/dom/bindings/callback.rs +++ b/components/script/dom/bindings/callback.rs @@ -7,21 +7,21 @@ use dom::bindings::error::{Fallible, Error}; use dom::bindings::global::global_object_for_js_object; use dom::bindings::utils::Reflectable; -use js::jsapi::{JSContext, JSObject, JS_WrapObject, IsCallable}; -use js::jsapi::{JS_GetProperty, JS_IsExceptionPending, JS_ReportPendingException}; -use js::jsapi::{RootedObject, RootedValue, MutableHandleObject, Heap}; +use js::jsapi::GetGlobalForObjectCrossCompartment; use js::jsapi::{JSAutoCompartment}; +use js::jsapi::{JSContext, JSObject, JS_WrapObject, IsCallable}; use js::jsapi::{JS_BeginRequest, JS_EndRequest}; use js::jsapi::{JS_EnterCompartment, JS_LeaveCompartment, JSCompartment}; -use js::jsapi::GetGlobalForObjectCrossCompartment; +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; use std::ptr; use std::rc::Rc; -use std::intrinsics::return_address; -use std::default::Default; /// The exception handling used for a call. #[derive(Copy, Clone, PartialEq)] diff --git a/components/script/dom/bindings/conversions.rs b/components/script/dom/bindings/conversions.rs index d1508060648..ca0e40241be 100644 --- a/components/script/dom/bindings/conversions.rs +++ b/components/script/dom/bindings/conversions.rs @@ -43,26 +43,26 @@ 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}; -use js::rust::{ToUint64, ToInt64}; -use js::rust::{ToUint32, ToInt32}; -use js::rust::{ToUint16, ToNumber, ToBoolean, ToString}; use js::jsapi::{HandleId, HandleObject, HandleValue, JS_GetClass}; +use js::jsapi::{JSClass, JSContext, JSObject, JSString, MutableHandleValue}; use js::jsapi::{JS_GetLatin1StringCharsAndLength, JS_GetReservedSlot}; use js::jsapi::{JS_GetTwoByteStringCharsAndLength, JS_NewStringCopyN}; use js::jsapi::{JS_NewUCStringCopyN, JS_StringHasLatin1Chars, JS_WrapValue}; -use js::jsapi::{JSClass, JSContext, JSObject, JSString, MutableHandleValue}; use js::jsval::JSVal; -use js::jsval::{UndefinedValue, NullValue, BooleanValue, Int32Value, UInt32Value}; use js::jsval::{StringValue, ObjectValue, ObjectOrNullValue}; +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}; use std::borrow::ToOwned; -use std::slice; use std::ptr; use std::rc::Rc; -use core::nonzero::NonZero; +use std::slice; 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 023254d55a5..a5fb6d90e51 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -12,17 +12,17 @@ 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::jsapi::JSAutoCompartment; use js::jsval::UndefinedValue; use libc; use std::ffi::CString; -use std::ptr; use std::mem; +use std::ptr; /// 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 75664ae3be9..2a9ee12e3a2 100644 --- a/components/script/dom/bindings/global.rs +++ b/components/script/dom/bindings/global.rs @@ -7,14 +7,14 @@ //! This module contains smart pointers to global scopes, to simplify writing //! code that works in workers as well as window scopes. +use devtools_traits::ScriptToDevtoolsControlMsg; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::conversions::native_from_reflector_jsmanaged; use dom::bindings::js::{JS, Root}; use dom::bindings::utils::{Reflectable, Reflector}; use dom::document::DocumentHelpers; -use dom::workerglobalscope::{WorkerGlobalScope, WorkerGlobalScopeHelpers}; use dom::window::{self, WindowHelpers, ScriptHelpers}; -use devtools_traits::ScriptToDevtoolsControlMsg; +use dom::workerglobalscope::{WorkerGlobalScope, WorkerGlobalScopeHelpers}; use script_task::{ScriptChan, ScriptPort, CommonScriptMsg, ScriptTask}; use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId}; @@ -22,9 +22,9 @@ use net_traits::ResourceTask; use profile_traits::mem; use ipc_channel::ipc::IpcSender; -use js::{JSCLASS_IS_GLOBAL, JSCLASS_IS_DOMJSCLASS}; use js::jsapi::{GetGlobalForObjectCrossCompartment}; use js::jsapi::{JSContext, JSObject, JS_GetClass, MutableHandleValue}; +use js::{JSCLASS_IS_GLOBAL, JSCLASS_IS_DOMJSCLASS}; use url::Url; use util::mem::HeapSizeOf; diff --git a/components/script/dom/bindings/proxyhandler.rs b/components/script/dom/bindings/proxyhandler.rs index 5ee6361d6cc..69671a71145 100644 --- a/components/script/dom/bindings/proxyhandler.rs +++ b/components/script/dom/bindings/proxyhandler.rs @@ -8,17 +8,17 @@ use dom::bindings::conversions::is_dom_proxy; use dom::bindings::utils::delete_property_by_id; +use js::glue::GetProxyExtra; +use js::glue::InvokeGetOwnPropertyDescriptor; +use js::glue::{SetProxyExtra, GetProxyHandler}; +use js::jsapi::AutoIdVector; +use js::jsapi::GetObjectProto; +use js::jsapi::{Handle, HandleObject, HandleId, MutableHandle, RootedObject, ObjectOpResult}; use js::jsapi::{JSContext, JSPropertyDescriptor, JSObject}; -use js::jsapi::{JS_GetPropertyDescriptorById}; use js::jsapi::{JS_DefinePropertyById6, JS_NewObjectWithGivenProto}; +use js::jsapi::{JS_GetPropertyDescriptorById}; use js::jsapi::{JS_StrictPropertyStub, JSErrNum}; -use js::jsapi::{Handle, HandleObject, HandleId, MutableHandle, RootedObject, ObjectOpResult}; -use js::jsapi::AutoIdVector; -use js::jsapi::GetObjectProto; use js::jsval::ObjectValue; -use js::glue::GetProxyExtra; -use js::glue::{SetProxyExtra, GetProxyHandler}; -use js::glue::InvokeGetOwnPropertyDescriptor; use js::{JSPROP_GETTER, JSPROP_ENUMERATE, JSPROP_READONLY}; use js::{JSTrue, JSFalse}; diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs index 8d1f0876e6b..a1adf059dba 100644 --- a/components/script/dom/bindings/refcounted.rs +++ b/components/script/dom/bindings/refcounted.rs @@ -23,25 +23,25 @@ //! is removed. use dom::bindings::js::Root; -use dom::bindings::utils::{Reflector, Reflectable}; 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 std::cell::RefCell; -use std::collections::hash_map::HashMap; use std::collections::hash_map::Entry::{Vacant, Occupied}; +use std::collections::hash_map::HashMap; use std::marker::PhantomData; use std::sync::{Arc, Mutex}; -use core::nonzero::NonZero; #[allow(missing_docs)] // FIXME mod dummy { // Attributes don’t apply through the macro. - use std::rc::Rc; use std::cell::RefCell; + use std::rc::Rc; use super::LiveDOMReferences; thread_local!(pub static LIVE_REFERENCES: Rc<RefCell<Option<LiveDOMReferences>>> = Rc::new(RefCell::new(None))); diff --git a/components/script/dom/bindings/structuredclone.rs b/components/script/dom/bindings/structuredclone.rs index 5697c7eb7dc..60dc10d0ced 100644 --- a/components/script/dom/bindings/structuredclone.rs +++ b/components/script/dom/bindings/structuredclone.rs @@ -5,15 +5,15 @@ //! This module implements structured cloning, as defined by [HTML] //! (https://html.spec.whatwg.org/multipage/#safe-passing-of-structured-data). -use dom::bindings::error::Fallible; 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_WriteStructuredClone, JS_ClearPendingException}; 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 d05e099613f..b1dcbbce163 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -34,9 +34,9 @@ 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 canvas_traits::WebGLError; use cssparser::RGBA; use encoding::types::EncodingRef; use euclid::matrix2d::Matrix2D; @@ -46,27 +46,26 @@ use html5ever::tree_builder::QuirksMode; use hyper::header::Headers; use hyper::method::Method; use ipc_channel::ipc::{IpcReceiver, IpcSender}; -use js::jsapi::{JSObject, JSTracer, JSGCTraceKind, JS_CallValueTracer, JS_CallObjectTracer, GCTraceKindToAscii, Heap}; use js::jsapi::JS_CallUnbarrieredObjectTracer; +use js::jsapi::{JSObject, JSTracer, JSGCTraceKind, JS_CallValueTracer, JS_CallObjectTracer, GCTraceKindToAscii, Heap}; use js::jsval::JSVal; use js::rust::Runtime; use layout_interface::{LayoutRPC, LayoutChan}; use libc; +use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::{PipelineId, SubpageId, WindowSizeData, WorkerId}; +use net_traits::image::base::Image; use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask}; use net_traits::storage_task::StorageType; +use profile_traits::mem::ProfilerChan; use script_traits::UntrustedNodeAddress; +use selectors::parser::PseudoElement; use serde::{Serialize, Deserialize}; use smallvec::SmallVec; -use msg::constellation_msg::ConstellationChan; -use net_traits::image::base::Image; -use profile_traits::mem::ProfilerChan; -use util::str::{LengthOrPercentageOrAuto}; -use selectors::parser::PseudoElement; use std::boxed::FnBox; use std::cell::{Cell, UnsafeCell, RefCell}; -use std::collections::{HashMap, HashSet}; use std::collections::hash_state::HashState; +use std::collections::{HashMap, HashSet}; use std::ffi::CString; use std::hash::{Hash, Hasher}; use std::intrinsics::return_address; @@ -78,6 +77,7 @@ use std::sync::mpsc::{Receiver, Sender}; use string_cache::{Atom, Namespace}; use style::properties::PropertyDeclarationBlock; use url::Url; +use util::str::{LengthOrPercentageOrAuto}; /// A trait to allow tracing (only) DOM objects. @@ -375,8 +375,8 @@ pub struct RootedTraceableSet { #[allow(missing_docs)] // FIXME mod dummy { // Attributes don’t apply through the macro. - use std::rc::Rc; use std::cell::RefCell; + use std::rc::Rc; use super::RootedTraceableSet; /// TLV Holds a set of JSTraceables that need to be rooted thread_local!(pub static ROOTED_TRACEABLES: Rc<RefCell<RootedTraceableSet>> = diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs index 9f458f83c2e..d7912ae9af4 100644 --- a/components/script/dom/bindings/utils.rs +++ b/components/script/dom/bindings/utils.rs @@ -6,11 +6,11 @@ use dom::bindings::codegen::PrototypeList; use dom::bindings::codegen::PrototypeList::MAX_PROTO_CHAIN_LENGTH; -use dom::bindings::conversions::{is_dom_class, jsstring_to_str}; use dom::bindings::conversions::native_from_handleobject; use dom::bindings::conversions::private_from_proto_chain; -use dom::bindings::error::{Error, ErrorResult, Fallible, throw_invalid_this}; +use dom::bindings::conversions::{is_dom_class, jsstring_to_str}; use dom::bindings::error::throw_type_error; +use dom::bindings::error::{Error, ErrorResult, Fallible, throw_invalid_this}; use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::trace::trace_object; @@ -19,46 +19,46 @@ use dom::window; use util::mem::HeapSizeOf; use util::str::DOMString; -use libc; -use libc::c_uint; -use std::ffi::CString; -use std::ptr; -use std::cmp::PartialEq; -use std::default::Default; -use std::cell::UnsafeCell; +use js; use js::glue::{CallJitMethodOp, CallJitGetterOp, CallJitSetterOp, IsWrapper}; use js::glue::{RUST_FUNCTION_VALUE_TO_JITINFO, RUST_JSID_IS_INT}; use js::glue::{RUST_JSID_TO_INT, UnwrapObject}; -use js::jsapi::{CallArgs, GetGlobalForObjectCrossCompartment, JSJitInfo}; +use js::glue::{WrapperNew, GetCrossCompartmentWrapper}; +use js::jsapi::JSAutoCompartment; +use js::jsapi::JS_DeletePropertyById1; +use js::jsapi::JS_GetFunctionObject; use js::jsapi::JS_IsExceptionPending; +use js::jsapi::JS_NewObjectWithUniqueType; +use js::jsapi::JS_ObjectToOuterObject; +use js::jsapi::PropertyDefinitionBehavior; +use js::jsapi::{CallArgs, GetGlobalForObjectCrossCompartment, JSJitInfo}; +use js::jsapi::{DOMCallbacks, JSWrapObjectCallbacks}; +use js::jsapi::{HandleObject, HandleId, HandleValue, MutableHandleValue}; +use js::jsapi::{JSContext, JSObject, JSClass, JSTracer}; +use js::jsapi::{JSFunctionSpec, JSPropertySpec}; use js::jsapi::{JS_AlreadyHasOwnProperty, JS_NewFunction, JSTraceOp}; +use js::jsapi::{JS_DefineFunctions, JS_DefineProperty, JS_DefineProperty1}; use js::jsapi::{JS_DefineProperties, JS_ForwardGetPropertyTo}; +use js::jsapi::{JS_FireOnNewGlobalObject, JSVersion}; use js::jsapi::{JS_GetClass, JS_LinkConstructorAndPrototype}; -use js::jsapi::{HandleObject, HandleId, HandleValue, MutableHandleValue}; -use js::jsapi::JS_GetFunctionObject; -use js::jsapi::{JS_HasPropertyById, JS_GetPrototype}; use js::jsapi::{JS_GetProperty, JS_HasProperty, JS_SetProperty}; -use js::jsapi::{JS_DefineFunctions, JS_DefineProperty, JS_DefineProperty1}; use js::jsapi::{JS_GetReservedSlot, JS_SetReservedSlot}; -use js::jsapi::{JSContext, JSObject, JSClass, JSTracer}; -use js::jsapi::{JSFunctionSpec, JSPropertySpec}; +use js::jsapi::{JS_HasPropertyById, JS_GetPrototype}; use js::jsapi::{JS_NewGlobalObject, JS_InitStandardClasses}; -use js::jsapi::{OnNewGlobalHookOption, CompartmentOptions}; -use js::jsapi::{JS_FireOnNewGlobalObject, JSVersion}; -use js::jsapi::JS_DeletePropertyById1; -use js::jsapi::JS_ObjectToOuterObject; -use js::jsapi::JS_NewObjectWithUniqueType; use js::jsapi::{ObjectOpResult, RootedObject, RootedValue, Heap, MutableHandleObject}; -use js::jsapi::PropertyDefinitionBehavior; -use js::jsapi::JSAutoCompartment; -use js::jsapi::{DOMCallbacks, JSWrapObjectCallbacks}; +use js::jsapi::{OnNewGlobalHookOption, CompartmentOptions}; use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue}; use js::jsval::{PrivateValue, UInt32Value, UndefinedValue}; use js::rust::{GCMethods, ToString}; -use js::glue::{WrapperNew, GetCrossCompartmentWrapper}; -use js::{JS_CALLEE, JSFUN_CONSTRUCTOR, JSPROP_ENUMERATE}; use js::{JSPROP_PERMANENT, JSPROP_READONLY}; -use js; +use js::{JS_CALLEE, JSFUN_CONSTRUCTOR, JSPROP_ENUMERATE}; +use libc; +use libc::c_uint; +use std::cell::UnsafeCell; +use std::cmp::PartialEq; +use std::default::Default; +use std::ffi::CString; +use std::ptr; use string_cache::{Atom, Namespace}; /// Proxy handler for a WindowProxy. diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index 04f7e782d0e..717d50663ea 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -2,20 +2,20 @@ * 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::codegen::Bindings::BlobBinding; +use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods; use dom::bindings::codegen::InheritTypes::FileDerived; +use dom::bindings::error::Fallible; use dom::bindings::global::{GlobalRef, GlobalField}; use dom::bindings::js::Root; use dom::bindings::utils::{Reflector, reflect_dom_object}; -use dom::bindings::error::Fallible; -use dom::bindings::codegen::Bindings::BlobBinding; -use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods; -use std::sync::mpsc::Sender; -use util::str::DOMString; use num::ToPrimitive; use std::ascii::AsciiExt; use std::borrow::ToOwned; -use std::cmp::{min, max}; use std::cell::{Cell}; +use std::cmp::{min, max}; +use std::sync::mpsc::Sender; +use util::str::DOMString; #[derive(JSTraceable, HeapSizeOf)] pub enum BlobTypeId { diff --git a/components/script/dom/browsercontext.rs b/components/script/dom/browsercontext.rs index bab6ca7a5f2..cdd34ac7c71 100644 --- a/components/script/dom/browsercontext.rs +++ b/components/script/dom/browsercontext.rs @@ -6,26 +6,26 @@ use dom::bindings::conversions::native_from_handleobject; use dom::bindings::conversions::{ToJSValConvertible}; use dom::bindings::js::{JS, Root}; use dom::bindings::proxyhandler::{get_property_descriptor, fill_property_descriptor}; -use dom::bindings::utils::{Reflectable, WindowProxyHandler}; use dom::bindings::utils::get_array_index_from_id; +use dom::bindings::utils::{Reflectable, WindowProxyHandler}; use dom::document::{Document, DocumentHelpers}; use dom::element::Element; use dom::window::Window; use dom::window::WindowHelpers; -use js::jsapi::{JSContext, JSObject, JSPropertyDescriptor, JSErrNum}; +use js::glue::{GetProxyPrivate}; +use js::glue::{WrapperNew, CreateWrapperProxyHandler, ProxyTraps}; use js::jsapi::{HandleObject, HandleId, MutableHandle, MutableHandleValue}; +use js::jsapi::{JSAutoRequest, JSAutoCompartment}; +use js::jsapi::{JSContext, JSObject, JSPropertyDescriptor, JSErrNum}; use js::jsapi::{JS_AlreadyHasOwnPropertyById, JS_ForwardGetPropertyTo}; -use js::jsapi::{JS_GetPropertyDescriptorById, JS_DefinePropertyById6}; use js::jsapi::{JS_ForwardSetPropertyTo, ObjectOpResult, RootedObject, RootedValue, Handle, HandleValue, Heap}; -use js::jsapi::{JSAutoRequest, JSAutoCompartment}; +use js::jsapi::{JS_GetPropertyDescriptorById, JS_DefinePropertyById6}; use js::jsval::{ObjectValue, UndefinedValue}; -use js::glue::{GetProxyPrivate}; -use js::glue::{WrapperNew, CreateWrapperProxyHandler, ProxyTraps}; use js::{JSTrue, JSFalse}; -use std::ptr; use std::default::Default; +use std::ptr; #[derive(JSTraceable, HeapSizeOf)] #[privatize] diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index 14863009b95..9e2ec6d1446 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -29,25 +29,25 @@ 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 canvas::canvas_paint_task::RectToi32; use msg::constellation_msg::Msg as ConstellationMsg; -use net_traits::image_cache_task::{ImageCacheChan, ImageResponse}; use net_traits::image::base::PixelFormat; +use net_traits::image_cache_task::{ImageCacheChan, ImageResponse}; use ipc_channel::ipc::{self, IpcSender}; use num::{Float, ToPrimitive}; use std::borrow::ToOwned; use std::cell::RefCell; -use std::fmt; use std::cmp; +use std::fmt; use std::sync::mpsc::channel; -use util::str::DOMString; use url::Url; +use util::str::DOMString; use util::vec::byte_swap; #[must_root] diff --git a/components/script/dom/characterdata.rs b/components/script/dom/characterdata.rs index f15b66c68f8..b2d3dfec0cb 100644 --- a/components/script/dom/characterdata.rs +++ b/components/script/dom/characterdata.rs @@ -6,11 +6,11 @@ use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::CharacterDataBinding::CharacterDataMethods; -use dom::bindings::codegen::InheritTypes::{CharacterDataDerived, ElementCast}; use dom::bindings::codegen::InheritTypes::NodeCast; +use dom::bindings::codegen::InheritTypes::{CharacterDataDerived, ElementCast}; use dom::bindings::codegen::UnionTypes::NodeOrString; -use dom::bindings::error::{Fallible, ErrorResult}; use dom::bindings::error::Error::IndexSize; +use dom::bindings::error::{Fallible, ErrorResult}; use dom::bindings::js::{LayoutJS, Root}; use dom::document::Document; use dom::element::Element; diff --git a/components/script/dom/closeevent.rs b/components/script/dom/closeevent.rs index 07a6fb39379..a9a6c8e960e 100644 --- a/components/script/dom/closeevent.rs +++ b/components/script/dom/closeevent.rs @@ -2,9 +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::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::CloseEventBinding; use dom::bindings::codegen::Bindings::CloseEventBinding::CloseEventMethods; +use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::InheritTypes::EventCast; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; diff --git a/components/script/dom/console.rs b/components/script/dom/console.rs index 0fca952d492..fb0e2ab08f3 100644 --- a/components/script/dom/console.rs +++ b/components/script/dom/console.rs @@ -2,13 +2,13 @@ * 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::{ConsoleMessage, LogLevel, ScriptToDevtoolsControlMsg}; use dom::bindings::codegen::Bindings::ConsoleBinding; use dom::bindings::codegen::Bindings::ConsoleBinding::ConsoleMethods; use dom::bindings::global::{GlobalRef, GlobalField}; use dom::bindings::js::Root; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::window::WindowHelpers; -use devtools_traits::{ConsoleMessage, LogLevel, ScriptToDevtoolsControlMsg}; use util::str::DOMString; // https://developer.mozilla.org/en-US/docs/Web/API/Console diff --git a/components/script/dom/create.rs b/components/script/dom/create.rs index c460aa836ae..9b226c73e33 100644 --- a/components/script/dom/create.rs +++ b/components/script/dom/create.rs @@ -30,8 +30,8 @@ use dom::htmlformelement::HTMLFormElement; use dom::htmlframeelement::HTMLFrameElement; use dom::htmlframesetelement::HTMLFrameSetElement; use dom::htmlheadelement::HTMLHeadElement; -use dom::htmlheadingelement::HeadingLevel; use dom::htmlheadingelement::HTMLHeadingElement; +use dom::htmlheadingelement::HeadingLevel; use dom::htmlhrelement::HTMLHRElement; use dom::htmlhtmlelement::HTMLHtmlElement; use dom::htmliframeelement::HTMLIFrameElement; diff --git a/components/script/dom/crypto.rs b/components/script/dom/crypto.rs index 857e220aca1..8764dd900ff 100644 --- a/components/script/dom/crypto.rs +++ b/components/script/dom/crypto.rs @@ -2,13 +2,13 @@ * 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::CryptoBinding; use dom::bindings::codegen::Bindings::CryptoBinding::CryptoMethods; 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 dom::bindings::cell::DOMRefCell; use js::jsapi::{JSContext, JSObject}; use js::jsapi::{JS_GetObjectAsArrayBufferView, JS_GetArrayBufferViewType, Type}; diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index 4c5fc207674..ff43239644a 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -13,11 +13,11 @@ use dom::element::{ElementHelpers, StylePriority}; use dom::htmlelement::HTMLElement; use dom::node::{window_from_node, document_from_node, NodeDamage, NodeHelpers}; use dom::window::{Window, WindowHelpers}; -use util::str::DOMString; use selectors::parser::PseudoElement; use string_cache::Atom; -use style::properties::{is_supported_property, longhands_from_shorthand, parse_one_declaration}; 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; diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs index d72e9243b95..c1e8639d0b3 100644 --- a/components/script/dom/dedicatedworkerglobalscope.rs +++ b/components/script/dom/dedicatedworkerglobalscope.rs @@ -33,8 +33,8 @@ use util::task_state::{SCRIPT, IN_WORKER}; use ipc_channel::ipc::IpcReceiver; use ipc_channel::router::ROUTER; -use js::jsapi::{JSContext, RootedValue, HandleValue}; use js::jsapi::{JSAutoRequest, JSAutoCompartment}; +use js::jsapi::{JSContext, RootedValue, HandleValue}; use js::jsval::UndefinedValue; use js::rust::Runtime; use url::Url; diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index bc1198afac3..78399ac1c2b 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -14,28 +14,28 @@ use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeFilterBinding::NodeFilter; use dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; +use dom::bindings::codegen::InheritTypes::ElementDerived; +use dom::bindings::codegen::InheritTypes::HTMLBaseElementCast; use dom::bindings::codegen::InheritTypes::{DocumentDerived, EventCast, HTMLBodyElementCast}; -use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLHeadElementCast, ElementCast, HTMLIFrameElementCast}; use dom::bindings::codegen::InheritTypes::{DocumentTypeCast, HTMLHtmlElementCast, NodeCast}; use dom::bindings::codegen::InheritTypes::{EventTargetCast, HTMLAnchorElementCast}; use dom::bindings::codegen::InheritTypes::{HTMLAnchorElementDerived, HTMLAppletElementDerived}; use dom::bindings::codegen::InheritTypes::{HTMLAreaElementDerived, HTMLEmbedElementDerived}; +use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLHeadElementCast, ElementCast, HTMLIFrameElementCast}; use dom::bindings::codegen::InheritTypes::{HTMLFormElementDerived, HTMLImageElementDerived}; use dom::bindings::codegen::InheritTypes::{HTMLScriptElementDerived, HTMLTitleElementDerived}; -use dom::bindings::codegen::InheritTypes::ElementDerived; -use dom::bindings::codegen::InheritTypes::HTMLBaseElementCast; use dom::bindings::codegen::UnionTypes::NodeOrString; -use dom::bindings::error::{ErrorResult, Fallible}; -use dom::bindings::error::Error::{NotSupported, InvalidCharacter, Security}; use dom::bindings::error::Error::HierarchyRequest; +use dom::bindings::error::Error::{NotSupported, InvalidCharacter, Security}; +use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; -use dom::bindings::js::{JS, Root, LayoutJS, MutNullableHeap}; use dom::bindings::js::RootedReference; +use dom::bindings::js::{JS, Root, LayoutJS, MutNullableHeap}; use dom::bindings::refcounted::Trusted; use dom::bindings::trace::RootedVec; +use dom::bindings::utils::XMLName::InvalidXMLName; use dom::bindings::utils::{reflect_dom_object, Reflectable}; use dom::bindings::utils::{xml_name_type, validate_and_extract}; -use dom::bindings::utils::XMLName::InvalidXMLName; use dom::comment::Comment; use dom::customevent::CustomEvent; use dom::documentfragment::DocumentFragment; @@ -53,56 +53,56 @@ use dom::htmlheadelement::HTMLHeadElement; use dom::htmlhtmlelement::HTMLHtmlElement; use dom::htmliframeelement::HTMLIFrameElement; use dom::htmlscriptelement::HTMLScriptElement; -use dom::location::Location; -use dom::mouseevent::MouseEvent; use dom::keyboardevent::KeyboardEvent; +use dom::location::Location; use dom::messageevent::MessageEvent; +use dom::mouseevent::MouseEvent; use dom::node::{self, Node, NodeHelpers, NodeTypeId, CloneChildrenFlag, NodeDamage, window_from_node}; -use dom::nodelist::NodeList; use dom::nodeiterator::NodeIterator; -use dom::text::Text; +use dom::nodelist::NodeList; use dom::processinginstruction::ProcessingInstruction; use dom::range::Range; use dom::servohtmlparser::ServoHTMLParser; +use dom::text::Text; use dom::treewalker::TreeWalker; use dom::uievent::UIEvent; use dom::window::{Window, WindowHelpers, ReflowReason}; use layout_interface::{HitTestResponse, MouseOverResponse}; +use layout_interface::{ReflowGoal, ReflowQueryType}; use msg::compositor_msg::ScriptToCompositorMsg; use msg::constellation_msg::AnimationState; use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, FocusType, Key, KeyState, KeyModifiers, MozBrowserEvent, SubpageId}; use msg::constellation_msg::{SUPER, ALT, SHIFT, CONTROL}; -use net_traits::CookieSource::NonHTTP; use net_traits::ControlMsg::{SetCookiesForUrl, GetCookiesForUrl}; +use net_traits::CookieSource::NonHTTP; use net_traits::{Metadata, PendingAsyncLoad, AsyncResponseTarget}; use script_task::Runnable; use script_traits::{MouseButton, UntrustedNodeAddress}; use util::opts; use util::str::{DOMString, split_html_space_chars}; -use layout_interface::{ReflowGoal, ReflowQueryType}; 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 js::jsapi::{JSContext, JSObject, JSRuntime}; use num::ToPrimitive; -use std::iter::FromIterator; +use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::boxed::FnBox; +use std::cell::{Cell, Ref, RefMut, RefCell}; use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; -use std::ascii::AsciiExt; -use std::cell::{Cell, Ref, RefMut, RefCell}; use std::default::Default; +use std::iter::FromIterator; use std::ptr; -use std::sync::mpsc::channel; use std::rc::Rc; +use std::sync::mpsc::channel; use time; #[derive(JSTraceable, PartialEq, HeapSizeOf)] diff --git a/components/script/dom/documentfragment.rs b/components/script/dom/documentfragment.rs index 76dbf0e993a..6ffba9208f7 100644 --- a/components/script/dom/documentfragment.rs +++ b/components/script/dom/documentfragment.rs @@ -8,9 +8,9 @@ use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::codegen::InheritTypes::DocumentFragmentDerived; use dom::bindings::codegen::InheritTypes::{ElementCast, NodeCast}; use dom::bindings::codegen::UnionTypes::NodeOrString; -use dom::bindings::js::Root; use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; +use dom::bindings::js::Root; use dom::document::Document; use dom::element::Element; use dom::eventtarget::{EventTarget, EventTargetTypeId}; diff --git a/components/script/dom/domimplementation.rs b/components/script/dom/domimplementation.rs index 902e19efbea..50999d71c0c 100644 --- a/components/script/dom/domimplementation.rs +++ b/components/script/dom/domimplementation.rs @@ -3,18 +3,18 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use document_loader::DocumentLoader; -use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::DOMImplementationBinding; use dom::bindings::codegen::Bindings::DOMImplementationBinding::DOMImplementationMethods; +use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::InheritTypes::NodeCast; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, Root}; -use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::bindings::utils::validate_qualified_name; -use dom::document::{Document, DocumentHelpers, IsHTMLDocument}; +use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::document::DocumentSource; +use dom::document::{Document, DocumentHelpers, IsHTMLDocument}; use dom::documenttype::DocumentType; use dom::htmlbodyelement::HTMLBodyElement; use dom::htmlheadelement::HTMLHeadElement; diff --git a/components/script/dom/domparser.rs b/components/script/dom/domparser.rs index a011db403df..48834425821 100644 --- a/components/script/dom/domparser.rs +++ b/components/script/dom/domparser.rs @@ -3,17 +3,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use document_loader::DocumentLoader; -use dom::bindings::codegen::Bindings::DocumentBinding::DocumentReadyState; use dom::bindings::codegen::Bindings::DOMParserBinding; use dom::bindings::codegen::Bindings::DOMParserBinding::DOMParserMethods; use dom::bindings::codegen::Bindings::DOMParserBinding::SupportedType::{Text_html, Text_xml}; +use dom::bindings::codegen::Bindings::DocumentBinding::DocumentReadyState; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, Root}; use dom::bindings::utils::{Reflector, reflect_dom_object}; -use dom::document::{Document, DocumentHelpers, IsHTMLDocument}; use dom::document::DocumentSource; +use dom::document::{Document, DocumentHelpers, IsHTMLDocument}; use dom::window::{Window, WindowHelpers}; use parse::html::{ParseContext, parse_html}; use util::str::DOMString; diff --git a/components/script/dom/domstringmap.rs b/components/script/dom/domstringmap.rs index fe86d4d4b64..fdaf9d7f65c 100644 --- a/components/script/dom/domstringmap.rs +++ b/components/script/dom/domstringmap.rs @@ -8,8 +8,8 @@ use dom::bindings::error::ErrorResult; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, Root}; use dom::bindings::utils::{Reflector, reflect_dom_object}; -use dom::node::window_from_node; use dom::htmlelement::{HTMLElement, HTMLElementCustomAttributeHelpers}; +use dom::node::window_from_node; use util::str::DOMString; #[dom_struct] diff --git a/components/script/dom/domtokenlist.rs b/components/script/dom/domtokenlist.rs index df7dadb2b44..8571ec6b482 100644 --- a/components/script/dom/domtokenlist.rs +++ b/components/script/dom/domtokenlist.rs @@ -5,16 +5,16 @@ use dom::attr::{Attr, AttrHelpers}; use dom::bindings::codegen::Bindings::DOMTokenListBinding; use dom::bindings::codegen::Bindings::DOMTokenListBinding::DOMTokenListMethods; -use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::Error::{InvalidCharacter, Syntax}; +use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, Root}; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::element::{Element, AttributeHandlers}; use dom::node::window_from_node; -use util::str::{DOMString, HTML_SPACE_CHARACTERS, str_join}; use string_cache::Atom; +use util::str::{DOMString, HTML_SPACE_CHARACTERS, str_join}; use std::borrow::ToOwned; diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 6c8bdf028ba..2935e581a88 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -5,9 +5,8 @@ //! Element nodes. use dom::activation::Activatable; -use dom::attr::{Attr, AttrSettingType, AttrHelpers, AttrHelpersForLayout}; use dom::attr::AttrValue; -use dom::namednodemap::NamedNodeMap; +use dom::attr::{Attr, AttrSettingType, AttrHelpers, AttrHelpersForLayout}; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; use dom::bindings::codegen::Bindings::ElementBinding; @@ -17,30 +16,30 @@ use dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElementM use dom::bindings::codegen::Bindings::NamedNodeMapBinding::NamedNodeMapMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::InheritTypes::CharacterDataCast; -use dom::bindings::codegen::InheritTypes::{ElementCast, ElementDerived, EventTargetCast}; use dom::bindings::codegen::InheritTypes::DocumentDerived; +use dom::bindings::codegen::InheritTypes::HTMLAnchorElementCast; +use dom::bindings::codegen::InheritTypes::TextCast; +use dom::bindings::codegen::InheritTypes::{ElementCast, ElementDerived, EventTargetCast}; use dom::bindings::codegen::InheritTypes::{HTMLBodyElementDerived, HTMLFontElementDerived}; use dom::bindings::codegen::InheritTypes::{HTMLIFrameElementDerived, HTMLInputElementCast}; use dom::bindings::codegen::InheritTypes::{HTMLInputElementDerived, HTMLTableElementCast}; use dom::bindings::codegen::InheritTypes::{HTMLTableElementDerived, HTMLTableCellElementDerived}; use dom::bindings::codegen::InheritTypes::{HTMLTableRowElementDerived, HTMLTextAreaElementDerived}; use dom::bindings::codegen::InheritTypes::{HTMLTableSectionElementDerived, NodeCast}; -use dom::bindings::codegen::InheritTypes::HTMLAnchorElementCast; -use dom::bindings::codegen::InheritTypes::TextCast; use dom::bindings::codegen::UnionTypes::NodeOrString; -use dom::bindings::error::{ErrorResult, Fallible}; -use dom::bindings::error::Error::{InvalidCharacter, Syntax}; use dom::bindings::error::Error::NoModificationAllowed; +use dom::bindings::error::Error::{InvalidCharacter, Syntax}; +use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::js::{JS, LayoutJS, MutNullableHeap}; use dom::bindings::js::{Root, RootedReference}; use dom::bindings::trace::RootedVec; -use dom::bindings::utils::{namespace_from_domstring, xml_name_type, validate_and_extract}; use dom::bindings::utils::XMLName::InvalidXMLName; +use dom::bindings::utils::{namespace_from_domstring, xml_name_type, validate_and_extract}; use dom::characterdata::CharacterDataHelpers; use dom::create::create_element; +use dom::document::{Document, DocumentHelpers, LayoutDocumentHelpers}; use dom::domrect::DOMRect; use dom::domrectlist::DOMRectList; -use dom::document::{Document, DocumentHelpers, LayoutDocumentHelpers}; use dom::domtokenlist::DOMTokenList; use dom::event::{Event, EventHelpers}; use dom::eventtarget::{EventTarget, EventTargetTypeId}; @@ -50,11 +49,12 @@ use dom::htmlelement::HTMLElementTypeId; use dom::htmlfontelement::{HTMLFontElement, HTMLFontElementHelpers}; use dom::htmliframeelement::{HTMLIFrameElement, RawHTMLIFrameElementHelpers}; use dom::htmlinputelement::{HTMLInputElement, RawLayoutHTMLInputElementHelpers, HTMLInputElementHelpers}; -use dom::htmltableelement::{HTMLTableElement, HTMLTableElementHelpers}; use dom::htmltablecellelement::{HTMLTableCellElement, HTMLTableCellElementHelpers}; +use dom::htmltableelement::{HTMLTableElement, HTMLTableElementHelpers}; use dom::htmltablerowelement::{HTMLTableRowElement, HTMLTableRowElementHelpers}; use dom::htmltablesectionelement::{HTMLTableSectionElement, HTMLTableSectionElementHelpers}; use dom::htmltextareaelement::{HTMLTextAreaElement, RawLayoutHTMLTextAreaElementHelpers}; +use dom::namednodemap::NamedNodeMap; use dom::node::{CLICK_IN_PROGRESS, LayoutNodeHelpers, Node, NodeHelpers, NodeTypeId, SEQUENTIALLY_FOCUSABLE}; use dom::node::{document_from_node, NodeDamage}; use dom::node::{window_from_node}; @@ -64,9 +64,9 @@ use dom::virtualmethods::{VirtualMethods, vtable_for}; use devtools_traits::AttrInfo; use smallvec::VecLike; use style::legacy::{UnsignedIntegerAttribute, from_declaration}; -use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, parse_style_attribute}; use style::properties::DeclaredValue::SpecifiedValue; use style::properties::longhands::{self, background_image, border_spacing}; +use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, parse_style_attribute}; use style::values::CSSFloat; use style::values::specified::{self, CSSColor, CSSRGBA}; use util::geometry::Au; diff --git a/components/script/dom/errorevent.rs b/components/script/dom/errorevent.rs index ee9d5178d30..9fa8807972b 100644 --- a/components/script/dom/errorevent.rs +++ b/components/script/dom/errorevent.rs @@ -2,24 +2,24 @@ * 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::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::ErrorEventBinding; use dom::bindings::codegen::Bindings::ErrorEventBinding::ErrorEventMethods; +use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::InheritTypes::{EventCast, ErrorEventDerived}; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; use dom::bindings::js::{Root, MutHeapJSVal}; -use js::jsapi::{JSContext, HandleValue}; 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::jsval::JSVal; use std::borrow::ToOwned; use std::cell::Cell; -use js::jsval::JSVal; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/eventdispatcher.rs b/components/script/dom/eventdispatcher.rs index 3451b22d108..0f6f5bda40e 100644 --- a/components/script/dom/eventdispatcher.rs +++ b/components/script/dom/eventdispatcher.rs @@ -7,8 +7,8 @@ use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast}; use dom::bindings::js::JS; use dom::bindings::trace::RootedVec; -use dom::eventtarget::{EventTarget, ListenerPhase}; use dom::event::{Event, EventPhase}; +use dom::eventtarget::{EventTarget, ListenerPhase}; use dom::node::{Node, NodeHelpers}; use dom::virtualmethods::vtable_for; diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs index 31c8e366daa..8a73be8e11e 100644 --- a/components/script/dom/eventtarget.rs +++ b/components/script/dom/eventtarget.rs @@ -7,18 +7,18 @@ use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; use dom::bindings::codegen::Bindings::EventListenerBinding::EventListener; use dom::bindings::codegen::Bindings::EventTargetBinding::EventTargetMethods; -use dom::bindings::error::{Fallible, report_pending_exception}; use dom::bindings::error::Error::InvalidState; +use dom::bindings::error::{Fallible, report_pending_exception}; use dom::bindings::utils::{Reflectable, Reflector}; use dom::event::{Event, EventHelpers}; use dom::eventdispatcher::dispatch_event; use dom::node::NodeTypeId; +use dom::virtualmethods::VirtualMethods; use dom::workerglobalscope::WorkerGlobalScopeTypeId; use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTargetTypeId; -use dom::virtualmethods::VirtualMethods; use js::jsapi::{CompileFunction, JS_GetFunctionObject}; -use js::jsapi::{JSContext, RootedFunction, HandleObject}; use js::jsapi::{JSAutoCompartment, JSAutoRequest}; +use js::jsapi::{JSContext, RootedFunction, HandleObject}; use js::rust::{AutoObjectVectorWrapper, CompileOptionsWrapper}; use util::mem::HeapSizeOf; use util::str::DOMString; diff --git a/components/script/dom/filereader.rs b/components/script/dom/filereader.rs index f819a2b395c..f23578a0535 100644 --- a/components/script/dom/filereader.rs +++ b/components/script/dom/filereader.rs @@ -3,31 +3,31 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods; +use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; use dom::bindings::codegen::Bindings::FileReaderBinding::{self, FileReaderConstants, FileReaderMethods}; use dom::bindings::codegen::InheritTypes::{EventCast, EventTargetCast}; -use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; -use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::Error::InvalidState; +use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::global::{GlobalRef, GlobalField}; use dom::bindings::js::{Root, JS, MutNullableHeap}; use dom::bindings::refcounted::Trusted; use dom::bindings::utils::{reflect_dom_object, Reflectable}; -use dom::event::{EventHelpers, EventCancelable, EventBubbles}; -use dom::eventtarget::{EventTarget, EventTargetHelpers, EventTargetTypeId}; use dom::blob::{Blob, BlobHelpers}; use dom::domexception::{DOMException, DOMErrorName}; +use dom::event::{EventHelpers, EventCancelable, EventBubbles}; +use dom::eventtarget::{EventTarget, EventTargetHelpers, EventTargetTypeId}; use dom::progressevent::ProgressEvent; use encoding::all::UTF_8; -use encoding::types::{EncodingRef, DecoderTrap}; use encoding::label::encoding_from_whatwg_label; +use encoding::types::{EncodingRef, DecoderTrap}; use hyper::mime::{Mime, Attr}; -use std::sync::mpsc; +use rustc_serialize::base64::{Config, ToBase64, CharacterSet, Newline}; use script_task::{ScriptChan, Runnable, ScriptPort, CommonScriptMsg}; use std::cell::{Cell, RefCell}; +use std::sync::mpsc; use std::sync::mpsc::Receiver; use util::str::DOMString; use util::task::spawn_named; -use rustc_serialize::base64::{Config, ToBase64, CharacterSet, Newline}; #[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)] pub enum FileReaderFunction { diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index 8b539c6b4f0..c514a963bd5 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -10,8 +10,8 @@ use dom::bindings::codegen::Bindings::HTMLAnchorElementBinding; use dom::bindings::codegen::Bindings::HTMLAnchorElementBinding::HTMLAnchorElementMethods; use dom::bindings::codegen::Bindings::MouseEventBinding::MouseEventMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; -use dom::bindings::codegen::InheritTypes::{HTMLAnchorElementDerived, HTMLImageElementDerived}; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast}; +use dom::bindings::codegen::InheritTypes::{HTMLAnchorElementDerived, HTMLImageElementDerived}; use dom::bindings::codegen::InheritTypes::{MouseEventCast, NodeCast}; use dom::bindings::js::{JS, MutNullableHeap, Root}; use dom::document::{Document, DocumentHelpers}; diff --git a/components/script/dom/htmlareaelement.rs b/components/script/dom/htmlareaelement.rs index ee93a27c67f..c2241410fd9 100644 --- a/components/script/dom/htmlareaelement.rs +++ b/components/script/dom/htmlareaelement.rs @@ -5,8 +5,8 @@ use dom::attr::AttrValue; use dom::bindings::codegen::Bindings::HTMLAreaElementBinding; use dom::bindings::codegen::Bindings::HTMLAreaElementBinding::HTMLAreaElementMethods; -use dom::bindings::codegen::InheritTypes::{HTMLAreaElementDerived, HTMLElementCast}; use dom::bindings::codegen::InheritTypes::ElementCast; +use dom::bindings::codegen::InheritTypes::{HTMLAreaElementDerived, HTMLElementCast}; use dom::bindings::js::{JS, MutNullableHeap, Root}; use dom::bindings::utils::Reflectable; use dom::document::Document; diff --git a/components/script/dom/htmlbaseelement.rs b/components/script/dom/htmlbaseelement.rs index 5a7c0a6d611..202bfca992b 100644 --- a/components/script/dom/htmlbaseelement.rs +++ b/components/script/dom/htmlbaseelement.rs @@ -9,8 +9,8 @@ use dom::bindings::codegen::InheritTypes::HTMLBaseElementDerived; use dom::bindings::codegen::InheritTypes::HTMLElementCast; use dom::bindings::js::Root; use dom::document::{Document, DocumentHelpers}; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::{ElementTypeId, AttributeHandlers}; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId, document_from_node}; use dom::virtualmethods::VirtualMethods; diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs index b886c9e91ec..0b9412613e1 100644 --- a/components/script/dom/htmlbodyelement.rs +++ b/components/script/dom/htmlbodyelement.rs @@ -22,8 +22,8 @@ use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::Msg as ConstellationMsg; use cssparser::RGBA; -use util::str::{self, DOMString}; use url::{Url, UrlParser}; +use util::str::{self, DOMString}; use std::borrow::ToOwned; use std::cell::Cell; diff --git a/components/script/dom/htmlbrelement.rs b/components/script/dom/htmlbrelement.rs index 962fcc54837..6330c15ddbb 100644 --- a/components/script/dom/htmlbrelement.rs +++ b/components/script/dom/htmlbrelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLBRElementBinding; use dom::bindings::codegen::InheritTypes::HTMLBRElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index b1cc150fe52..54f6145b3b9 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -11,8 +11,8 @@ use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast, HTMLBut use dom::bindings::codegen::InheritTypes::{HTMLButtonElementDerived, HTMLFieldSetElementDerived}; use dom::bindings::js::Root; use dom::document::Document; -use dom::element::{AttributeHandlers, Element, ElementTypeId}; use dom::element::ActivationElementHelpers; +use dom::element::{AttributeHandlers, Element, ElementTypeId}; use dom::event::Event; use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; @@ -24,8 +24,8 @@ use dom::virtualmethods::VirtualMethods; use std::ascii::AsciiExt; use std::borrow::ToOwned; -use util::str::DOMString; use std::cell::Cell; +use util::str::DOMString; #[derive(JSTraceable, PartialEq, Copy, Clone)] #[allow(dead_code)] diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index 6f307542148..4823f881be7 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -6,28 +6,28 @@ use dom::attr::Attr; use dom::attr::AttrHelpers; use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding; use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding::HTMLCanvasElementMethods; +use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLContextAttributes; use dom::bindings::codegen::InheritTypes::HTMLCanvasElementDerived; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast}; use dom::bindings::codegen::UnionTypes::CanvasRenderingContext2DOrWebGLRenderingContext; -use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLContextAttributes; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, LayoutJS, MutNullableHeap, HeapGCValue, Root}; use dom::bindings::utils::{Reflectable}; use dom::canvasrenderingcontext2d::{CanvasRenderingContext2D, LayoutCanvasRenderingContext2DHelpers}; use dom::document::Document; use dom::element::AttributeHandlers; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom::webglrenderingcontext::{WebGLRenderingContext, LayoutCanvasWebGLRenderingContextHelpers}; -use util::str::{DOMString, parse_unsigned_integer}; -use js::jsapi::{JSContext, HandleValue}; -use offscreen_gl_context::GLContextAttributes; use canvas_traits::CanvasMsg; 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; diff --git a/components/script/dom/htmldataelement.rs b/components/script/dom/htmldataelement.rs index da5bc60f522..915f5d32b02 100644 --- a/components/script/dom/htmldataelement.rs +++ b/components/script/dom/htmldataelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLDataElementBinding; use dom::bindings::codegen::InheritTypes::HTMLDataElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmldatalistelement.rs b/components/script/dom/htmldatalistelement.rs index e4037c8ba47..17b1f019ee8 100644 --- a/components/script/dom/htmldatalistelement.rs +++ b/components/script/dom/htmldatalistelement.rs @@ -4,14 +4,14 @@ use dom::bindings::codegen::Bindings::HTMLDataListElementBinding; use dom::bindings::codegen::Bindings::HTMLDataListElementBinding::HTMLDataListElementMethods; -use dom::bindings::codegen::InheritTypes::{HTMLDataListElementDerived, HTMLOptionElementDerived}; use dom::bindings::codegen::InheritTypes::NodeCast; +use dom::bindings::codegen::InheritTypes::{HTMLDataListElementDerived, HTMLOptionElementDerived}; use dom::bindings::js::Root; use dom::document::Document; use dom::element::Element; +use dom::element::ElementTypeId; use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlcollection::{HTMLCollection, CollectionFilter}; -use dom::element::ElementTypeId; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId, window_from_node}; use util::str::DOMString; diff --git a/components/script/dom/htmldialogelement.rs b/components/script/dom/htmldialogelement.rs index 482c92a80e4..e3003c25d0f 100644 --- a/components/script/dom/htmldialogelement.rs +++ b/components/script/dom/htmldialogelement.rs @@ -2,10 +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 dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::HTMLDialogElementBinding; use dom::bindings::codegen::Bindings::HTMLDialogElementBinding::HTMLDialogElementMethods; use dom::bindings::codegen::InheritTypes::HTMLDialogElementDerived; -use dom::bindings::cell::DOMRefCell; use dom::bindings::js::Root; use dom::document::Document; use dom::element::ElementTypeId; diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index e5f8f35221b..8b3e1863bca 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -13,9 +13,9 @@ use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLFrameSetElementDerived}; use dom::bindings::codegen::InheritTypes::{EventTargetCast, HTMLInputElementCast, NodeCast}; use dom::bindings::codegen::InheritTypes::{HTMLElementDerived, HTMLBodyElementDerived, HTMLHtmlElementDerived}; -use dom::bindings::js::{JS, MutNullableHeap, Root}; -use dom::bindings::error::ErrorResult; use dom::bindings::error::Error::Syntax; +use dom::bindings::error::ErrorResult; +use dom::bindings::js::{JS, MutNullableHeap, Root}; use dom::bindings::utils::Reflectable; use dom::cssstyledeclaration::{CSSStyleDeclaration, CSSModificationAccess}; use dom::document::{Document, DocumentHelpers}; diff --git a/components/script/dom/htmlfieldsetelement.rs b/components/script/dom/htmlfieldsetelement.rs index 55fd44f1c7a..de94e16b192 100644 --- a/components/script/dom/htmlfieldsetelement.rs +++ b/components/script/dom/htmlfieldsetelement.rs @@ -6,14 +6,14 @@ use dom::attr::Attr; use dom::attr::AttrHelpers; use dom::bindings::codegen::Bindings::HTMLFieldSetElementBinding; use dom::bindings::codegen::Bindings::HTMLFieldSetElementBinding::HTMLFieldSetElementMethods; -use dom::bindings::codegen::InheritTypes::{HTMLFieldSetElementDerived, NodeCast}; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLLegendElementDerived}; +use dom::bindings::codegen::InheritTypes::{HTMLFieldSetElementDerived, NodeCast}; use dom::bindings::js::{Root, RootedReference}; use dom::document::Document; +use dom::element::ElementTypeId; use dom::element::{AttributeHandlers, Element, ElementHelpers}; use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlcollection::{HTMLCollection, CollectionFilter}; -use dom::element::ElementTypeId; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{DisabledStateHelpers, Node, NodeHelpers, NodeTypeId, window_from_node}; use dom::validitystate::ValidityState; diff --git a/components/script/dom/htmlfontelement.rs b/components/script/dom/htmlfontelement.rs index 61152a47a00..11825e78c06 100644 --- a/components/script/dom/htmlfontelement.rs +++ b/components/script/dom/htmlfontelement.rs @@ -8,8 +8,8 @@ use dom::bindings::codegen::Bindings::HTMLFontElementBinding::HTMLFontElementMet use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLFontElementDerived}; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use dom::virtualmethods::VirtualMethods; diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index b63037486c0..d015c8eb4e1 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -5,10 +5,10 @@ use dom::attr::AttrValue; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; +use dom::bindings::codegen::Bindings::HTMLButtonElementBinding::HTMLButtonElementMethods; use dom::bindings::codegen::Bindings::HTMLFormElementBinding; use dom::bindings::codegen::Bindings::HTMLFormElementBinding::HTMLFormElementMethods; use dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElementMethods; -use dom::bindings::codegen::Bindings::HTMLButtonElementBinding::HTMLButtonElementMethods; use dom::bindings::codegen::InheritTypes::EventTargetCast; use dom::bindings::codegen::InheritTypes::HTMLDataListElementCast; use dom::bindings::codegen::InheritTypes::HTMLElementCast; @@ -19,25 +19,25 @@ use dom::bindings::codegen::InheritTypes::{HTMLTextAreaElementCast, NodeCast}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{Root}; use dom::document::{Document, DocumentHelpers}; +use dom::element::ElementTypeId; use dom::element::{Element, AttributeHandlers}; use dom::event::{Event, EventHelpers, EventBubbles, EventCancelable}; use dom::eventtarget::{EventTarget, EventTargetTypeId}; -use dom::element::ElementTypeId; +use dom::htmlbuttonelement::{HTMLButtonElement}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::htmlinputelement::{HTMLInputElement, HTMLInputElementHelpers}; -use dom::htmlbuttonelement::{HTMLButtonElement}; use dom::htmltextareaelement::HTMLTextAreaElementHelpers; use dom::node::{Node, NodeHelpers, NodeTypeId, document_from_node, window_from_node}; use dom::virtualmethods::VirtualMethods; -use hyper::method::Method; use hyper::header::ContentType; +use hyper::method::Method; use hyper::mime; use msg::constellation_msg::LoadData; -use util::str::DOMString; use script_task::{ScriptChan, MainThreadScriptMsg}; +use string_cache::Atom; use url::UrlParser; use url::form_urlencoded::serialize; -use string_cache::Atom; +use util::str::DOMString; use std::borrow::ToOwned; use std::cell::Cell; diff --git a/components/script/dom/htmlframeelement.rs b/components/script/dom/htmlframeelement.rs index 450cabfb293..7d60ccc6352 100644 --- a/components/script/dom/htmlframeelement.rs +++ b/components/script/dom/htmlframeelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLFrameElementBinding; use dom::bindings::codegen::InheritTypes::HTMLFrameElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlframesetelement.rs b/components/script/dom/htmlframesetelement.rs index 19129e612e2..5a42343f76f 100644 --- a/components/script/dom/htmlframesetelement.rs +++ b/components/script/dom/htmlframesetelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLFrameSetElementBinding; use dom::bindings::codegen::InheritTypes::HTMLFrameSetElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlheadelement.rs b/components/script/dom/htmlheadelement.rs index bfc46895de7..0353ace6436 100644 --- a/components/script/dom/htmlheadelement.rs +++ b/components/script/dom/htmlheadelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLHeadElementBinding; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLHeadElementDerived}; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use dom::userscripts::load_script; diff --git a/components/script/dom/htmlheadingelement.rs b/components/script/dom/htmlheadingelement.rs index b339a75a8a4..3b01900688d 100644 --- a/components/script/dom/htmlheadingelement.rs +++ b/components/script/dom/htmlheadingelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLHeadingElementBinding; use dom::bindings::codegen::InheritTypes::HTMLHeadingElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlhrelement.rs b/components/script/dom/htmlhrelement.rs index 6e1c228a7d6..ffbe53fadb2 100644 --- a/components/script/dom/htmlhrelement.rs +++ b/components/script/dom/htmlhrelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLHRElementBinding; use dom::bindings::codegen::InheritTypes::HTMLHRElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlhtmlelement.rs b/components/script/dom/htmlhtmlelement.rs index 497ca631e78..4e5250063a7 100644 --- a/components/script/dom/htmlhtmlelement.rs +++ b/components/script/dom/htmlhtmlelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLHtmlElementBinding; use dom::bindings::codegen::InheritTypes::HTMLHtmlElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index eed9a99aac0..213db677812 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -6,21 +6,21 @@ use dom::attr::{Attr, AttrHelpers, AttrHelpersForLayout, AttrValue}; use dom::bindings::codegen::Bindings::HTMLIFrameElementBinding; use dom::bindings::codegen::Bindings::HTMLIFrameElementBinding::HTMLIFrameElementMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; -use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, EventCast}; -use dom::bindings::codegen::InheritTypes::{EventTargetCast, HTMLElementCast}; use dom::bindings::codegen::InheritTypes::HTMLIFrameElementDerived; +use dom::bindings::codegen::InheritTypes::{EventTargetCast, HTMLElementCast}; +use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, EventCast}; use dom::bindings::conversions::ToJSValConvertible; -use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::Error::NotSupported; +use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{Root}; use dom::bindings::utils::Reflectable; use dom::customevent::CustomEvent; use dom::document::Document; +use dom::element::ElementTypeId; use dom::element::{self, AttributeHandlers}; use dom::event::EventHelpers; use dom::eventtarget::{EventTarget, EventTargetTypeId}; -use dom::element::ElementTypeId; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeHelpers, NodeTypeId, window_from_node}; use dom::urlhelper::UrlHelper; @@ -28,20 +28,20 @@ use dom::virtualmethods::VirtualMethods; use dom::window::{Window, WindowHelpers}; use page::IterablePage; -use msg::constellation_msg::{PipelineId, SubpageId, ConstellationChan, MozBrowserEvent, NavigationDirection}; 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::opts; use util::str::DOMString; -use string_cache::Atom; +use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment}; +use js::jsval::UndefinedValue; use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::cell::Cell; use url::{Url, UrlParser}; use util::str::{self, LengthOrPercentageOrAuto}; -use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment}; -use js::jsval::UndefinedValue; #[derive(HeapSizeOf)] enum SandboxAllowance { diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index 53b2cf7fc22..88a73907324 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -8,24 +8,24 @@ use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::HTMLImageElementBinding; use dom::bindings::codegen::Bindings::HTMLImageElementBinding::HTMLImageElementMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; -use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, EventTargetCast}; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLImageElementDerived}; +use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, EventTargetCast}; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; use dom::bindings::js::{LayoutJS, Root}; use dom::bindings::refcounted::Trusted; use dom::document::{Document, DocumentHelpers}; use dom::element::AttributeHandlers; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; use dom::event::{Event, EventBubbles, EventCancelable, EventHelpers}; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{document_from_node, Node, NodeTypeId, NodeHelpers, NodeDamage, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom::window::WindowHelpers; use script_task::{Runnable, ScriptChan, CommonScriptMsg}; -use util::str::DOMString; use string_cache::Atom; +use util::str::DOMString; use ipc_channel::ipc; use ipc_channel::router::ROUTER; diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index f8a6e0a426d..1985c905220 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -3,40 +3,40 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::activation::Activatable; -use dom::attr::{Attr, AttrValue}; use dom::attr::AttrHelpers; +use dom::attr::{Attr, AttrValue}; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; -use dom::bindings::codegen::Bindings::KeyboardEventBinding::KeyboardEventMethods; use dom::bindings::codegen::Bindings::HTMLInputElementBinding; use dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElementMethods; +use dom::bindings::codegen::Bindings::KeyboardEventBinding::KeyboardEventMethods; +use dom::bindings::codegen::InheritTypes::KeyboardEventCast; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast, HTMLInputElementCast, NodeCast}; use dom::bindings::codegen::InheritTypes::{HTMLInputElementDerived, HTMLFieldSetElementDerived, EventTargetCast}; -use dom::bindings::codegen::InheritTypes::KeyboardEventCast; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, LayoutJS, Root, RootedReference}; use dom::document::{Document, DocumentHelpers}; +use dom::element::ElementTypeId; use dom::element::{AttributeHandlers, Element}; use dom::element::{RawLayoutElementHelpers, ActivationElementHelpers}; use dom::event::{Event, EventBubbles, EventCancelable, EventHelpers}; use dom::eventtarget::{EventTarget, EventTargetTypeId}; -use dom::element::ElementTypeId; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; -use dom::keyboardevent::KeyboardEvent; use dom::htmlformelement::{FormSubmitter, FormControl, HTMLFormElement, HTMLFormElementHelpers}; use dom::htmlformelement::{SubmittedFrom, ResetFrom}; +use dom::keyboardevent::KeyboardEvent; use dom::node::{DisabledStateHelpers, Node, NodeHelpers, NodeDamage, NodeTypeId}; use dom::node::{document_from_node, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom::window::WindowHelpers; -use textinput::TextInput; +use msg::constellation_msg::ConstellationChan; use textinput::KeyReaction::{TriggerDefaultAction, DispatchInput, Nothing}; use textinput::Lines::Single; -use msg::constellation_msg::ConstellationChan; +use textinput::TextInput; -use util::str::DOMString; use string_cache::Atom; +use util::str::DOMString; use std::borrow::ToOwned; use std::cell::Cell; diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs index 4b66644f060..479f85d9660 100644 --- a/components/script/dom/htmllabelelement.rs +++ b/components/script/dom/htmllabelelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLLabelElementBinding; use dom::bindings::codegen::InheritTypes::HTMLLabelElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmllegendelement.rs b/components/script/dom/htmllegendelement.rs index 50d67a400d1..0b992092f6f 100644 --- a/components/script/dom/htmllegendelement.rs +++ b/components/script/dom/htmllegendelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLLegendElementBinding; use dom::bindings::codegen::InheritTypes::HTMLLegendElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmllielement.rs b/components/script/dom/htmllielement.rs index a5f15fefec9..ca552e0b405 100644 --- a/components/script/dom/htmllielement.rs +++ b/components/script/dom/htmllielement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLLIElementBinding; use dom::bindings::codegen::InheritTypes::HTMLLIElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index b5012a2b6f3..7ae868bae51 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -2,24 +2,25 @@ * 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::Parser as CssParser; use document_loader::LoadType; -use dom::attr::{Attr, AttrValue}; use dom::attr::AttrHelpers; +use dom::attr::{Attr, AttrValue}; use dom::bindings::codegen::Bindings::HTMLLinkElementBinding; use dom::bindings::codegen::Bindings::HTMLLinkElementBinding::HTMLLinkElementMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; -use dom::bindings::codegen::InheritTypes::{EventTargetCast, HTMLLinkElementDerived}; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast, NodeCast}; +use dom::bindings::codegen::InheritTypes::{EventTargetCast, HTMLLinkElementDerived}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, MutNullableHeap, Root}; use dom::bindings::js::{RootedReference}; use dom::bindings::refcounted::Trusted; use dom::document::{Document, DocumentHelpers}; use dom::domtokenlist::DOMTokenList; +use dom::element::ElementTypeId; use dom::element::{AttributeHandlers, Element}; use dom::event::{EventBubbles, EventCancelable, Event, EventHelpers}; use dom::eventtarget::{EventTarget, EventTargetTypeId}; -use dom::element::ElementTypeId; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeHelpers, NodeTypeId, window_from_node}; use dom::virtualmethods::VirtualMethods; @@ -28,15 +29,14 @@ use layout_interface::{LayoutChan, Msg}; use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::Msg as ConstellationMsg; use script_traits::StylesheetLoadResponder; -use util::str::{DOMString, HTML_SPACE_CHARACTERS}; use style::media_queries::parse_media_query_list; -use cssparser::Parser as CssParser; +use util::str::{DOMString, HTML_SPACE_CHARACTERS}; use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::default::Default; -use url::UrlParser; use string_cache::Atom; +use url::UrlParser; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/htmlmapelement.rs b/components/script/dom/htmlmapelement.rs index 64b4b7b55a7..e79bd1db4c3 100644 --- a/components/script/dom/htmlmapelement.rs +++ b/components/script/dom/htmlmapelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLMapElementBinding; use dom::bindings::codegen::InheritTypes::HTMLMapElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs index 95b7cc5060b..227f298d96d 100644 --- a/components/script/dom/htmlmediaelement.rs +++ b/components/script/dom/htmlmediaelement.rs @@ -4,8 +4,8 @@ use dom::bindings::codegen::InheritTypes::HTMLMediaElementDerived; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::NodeTypeId; use util::str::DOMString; diff --git a/components/script/dom/htmlmetaelement.rs b/components/script/dom/htmlmetaelement.rs index cc2fe60ecbd..55561c81fc0 100644 --- a/components/script/dom/htmlmetaelement.rs +++ b/components/script/dom/htmlmetaelement.rs @@ -7,8 +7,8 @@ use dom::bindings::codegen::Bindings::HTMLMetaElementBinding::HTMLMetaElementMet use dom::bindings::codegen::InheritTypes::HTMLMetaElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlmeterelement.rs b/components/script/dom/htmlmeterelement.rs index 6247b701a87..d91be36f600 100644 --- a/components/script/dom/htmlmeterelement.rs +++ b/components/script/dom/htmlmeterelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLMeterElementBinding; use dom::bindings::codegen::InheritTypes::HTMLMeterElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlmodelement.rs b/components/script/dom/htmlmodelement.rs index 446c4b70544..eed06692bce 100644 --- a/components/script/dom/htmlmodelement.rs +++ b/components/script/dom/htmlmodelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLModElementBinding; use dom::bindings::codegen::InheritTypes::HTMLModElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs index 08406a85ea5..ba0784ab7fb 100644 --- a/components/script/dom/htmlobjectelement.rs +++ b/components/script/dom/htmlobjectelement.rs @@ -13,16 +13,16 @@ use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast}; use dom::bindings::js::Root; use dom::document::Document; use dom::element::AttributeHandlers; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId, NodeHelpers, window_from_node}; use dom::validitystate::ValidityState; use dom::virtualmethods::VirtualMethods; use net_traits::image::base::Image; -use util::str::DOMString; use std::sync::Arc; +use util::str::DOMString; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/htmlolistelement.rs b/components/script/dom/htmlolistelement.rs index 6bf0e106f60..ec27e04ab0a 100644 --- a/components/script/dom/htmlolistelement.rs +++ b/components/script/dom/htmlolistelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLOListElementBinding; use dom::bindings::codegen::InheritTypes::HTMLOListElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmloptgroupelement.rs b/components/script/dom/htmloptgroupelement.rs index 297a0dcedb8..9993f9576b2 100644 --- a/components/script/dom/htmloptgroupelement.rs +++ b/components/script/dom/htmloptgroupelement.rs @@ -11,8 +11,8 @@ use dom::bindings::codegen::InheritTypes::{HTMLOptGroupElementDerived, HTMLOptio use dom::bindings::js::Root; use dom::document::Document; use dom::element::AttributeHandlers; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{DisabledStateHelpers, Node, NodeHelpers, NodeTypeId}; use dom::virtualmethods::VirtualMethods; diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs index 93ed56c437e..55685d6527f 100644 --- a/components/script/dom/htmloptionelement.rs +++ b/components/script/dom/htmloptionelement.rs @@ -7,15 +7,15 @@ use dom::attr::AttrHelpers; use dom::bindings::codegen::Bindings::CharacterDataBinding::CharacterDataMethods; use dom::bindings::codegen::Bindings::HTMLOptionElementBinding; use dom::bindings::codegen::Bindings::HTMLOptionElementBinding::HTMLOptionElementMethods; +use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::InheritTypes::{CharacterDataCast, ElementCast, HTMLElementCast, NodeCast, TextDerived}; use dom::bindings::codegen::InheritTypes::{HTMLOptionElementDerived}; use dom::bindings::codegen::InheritTypes::{HTMLScriptElementDerived}; -use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::js::Root; use dom::document::Document; +use dom::element::ElementTypeId; use dom::element::{AttributeHandlers, ElementHelpers}; use dom::eventtarget::{EventTarget, EventTargetTypeId}; -use dom::element::ElementTypeId; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{DisabledStateHelpers, Node, NodeHelpers, NodeTypeId}; use dom::virtualmethods::VirtualMethods; diff --git a/components/script/dom/htmloutputelement.rs b/components/script/dom/htmloutputelement.rs index 117294c3b6e..48a8dd40ff6 100644 --- a/components/script/dom/htmloutputelement.rs +++ b/components/script/dom/htmloutputelement.rs @@ -7,8 +7,8 @@ use dom::bindings::codegen::Bindings::HTMLOutputElementBinding::HTMLOutputElemen use dom::bindings::codegen::InheritTypes::HTMLOutputElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId, window_from_node}; use dom::validitystate::ValidityState; diff --git a/components/script/dom/htmlparagraphelement.rs b/components/script/dom/htmlparagraphelement.rs index aa5aec990c9..3c39eb42925 100644 --- a/components/script/dom/htmlparagraphelement.rs +++ b/components/script/dom/htmlparagraphelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLParagraphElementBinding; use dom::bindings::codegen::InheritTypes::HTMLParagraphElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlparamelement.rs b/components/script/dom/htmlparamelement.rs index 5df9ff982ef..e1c5a2deea6 100644 --- a/components/script/dom/htmlparamelement.rs +++ b/components/script/dom/htmlparamelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLParamElementBinding; use dom::bindings::codegen::InheritTypes::HTMLParamElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlpreelement.rs b/components/script/dom/htmlpreelement.rs index 3fc2fea0387..bb5000b895b 100644 --- a/components/script/dom/htmlpreelement.rs +++ b/components/script/dom/htmlpreelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLPreElementBinding; use dom::bindings::codegen::InheritTypes::HTMLPreElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlprogresselement.rs b/components/script/dom/htmlprogresselement.rs index a03dfe8f1e4..ea507d36fbc 100644 --- a/components/script/dom/htmlprogresselement.rs +++ b/components/script/dom/htmlprogresselement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLProgressElementBinding; use dom::bindings::codegen::InheritTypes::HTMLProgressElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlquoteelement.rs b/components/script/dom/htmlquoteelement.rs index c7ad4d75d9a..8162bcb5244 100644 --- a/components/script/dom/htmlquoteelement.rs +++ b/components/script/dom/htmlquoteelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLQuoteElementBinding; use dom::bindings::codegen::InheritTypes::HTMLQuoteElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index b2a068e61b0..d38930d4d54 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -13,43 +13,43 @@ use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::HTMLScriptElementBinding; use dom::bindings::codegen::Bindings::HTMLScriptElementBinding::HTMLScriptElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; -use dom::bindings::codegen::InheritTypes::{HTMLScriptElementDerived, HTMLScriptElementCast}; -use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast, NodeCast}; use dom::bindings::codegen::InheritTypes::EventTargetCast; +use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast, NodeCast}; +use dom::bindings::codegen::InheritTypes::{HTMLScriptElementDerived, HTMLScriptElementCast}; use dom::bindings::global::GlobalRef; -use dom::bindings::js::{JS, Root}; use dom::bindings::js::RootedReference; +use dom::bindings::js::{JS, Root}; use dom::bindings::refcounted::Trusted; use dom::bindings::trace::JSTraceable; use dom::document::{Document, DocumentHelpers}; +use dom::element::ElementTypeId; use dom::element::{AttributeHandlers, ElementCreator}; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::event::{Event, EventBubbles, EventCancelable, EventHelpers}; -use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{ChildrenMutation, CloneChildrenFlag, Node, NodeHelpers}; use dom::node::{NodeTypeId, document_from_node, window_from_node}; use dom::servohtmlparser::ServoHTMLParserHelpers; use dom::virtualmethods::VirtualMethods; use dom::window::{WindowHelpers, ScriptHelpers}; -use network_listener::{NetworkListener, PreInvoke}; -use script_task::{ScriptChan, Runnable, CommonScriptMsg}; use js::jsapi::RootedValue; use js::jsval::UndefinedValue; +use network_listener::{NetworkListener, PreInvoke}; +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 net_traits::{Metadata, AsyncResponseListener, AsyncResponseTarget}; -use util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec}; -use html5ever::tree_builder::NextParserState; use std::cell::{RefCell, Cell}; use std::mem; use std::sync::{Arc, Mutex}; use string_cache::Atom; use url::{Url, UrlParser}; +use util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec}; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/htmlselectelement.rs b/components/script/dom/htmlselectelement.rs index f2628f6b882..6b5027f39da 100644 --- a/components/script/dom/htmlselectelement.rs +++ b/components/script/dom/htmlselectelement.rs @@ -12,15 +12,15 @@ use dom::bindings::codegen::UnionTypes::HTMLOptionElementOrHTMLOptGroupElement; use dom::bindings::js::Root; use dom::document::Document; use dom::element::AttributeHandlers; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{DisabledStateHelpers, Node, NodeHelpers, NodeTypeId, window_from_node}; use dom::validitystate::ValidityState; use dom::virtualmethods::VirtualMethods; -use util::str::DOMString; use string_cache::Atom; +use util::str::DOMString; use std::borrow::ToOwned; diff --git a/components/script/dom/htmlsourceelement.rs b/components/script/dom/htmlsourceelement.rs index 5b00feab231..1d1294883f4 100644 --- a/components/script/dom/htmlsourceelement.rs +++ b/components/script/dom/htmlsourceelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLSourceElementBinding; use dom::bindings::codegen::InheritTypes::HTMLSourceElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlspanelement.rs b/components/script/dom/htmlspanelement.rs index 8bbad4c20bb..2cb3f766767 100644 --- a/components/script/dom/htmlspanelement.rs +++ b/components/script/dom/htmlspanelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLSpanElementBinding; use dom::bindings::codegen::InheritTypes::HTMLSpanElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs index a8a989641a0..fb87535fa3a 100644 --- a/components/script/dom/htmlstyleelement.rs +++ b/components/script/dom/htmlstyleelement.rs @@ -2,24 +2,24 @@ * 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::Parser as CssParser; use dom::attr::AttrHelpers; use dom::bindings::codegen::Bindings::HTMLStyleElementBinding; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast, HTMLStyleElementDerived, NodeCast}; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::{ElementTypeId, AttributeHandlers}; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; -use dom::node::{ChildrenMutation, Node, NodeHelpers, NodeTypeId}; use dom::node::window_from_node; +use dom::node::{ChildrenMutation, Node, NodeHelpers, NodeTypeId}; use dom::virtualmethods::VirtualMethods; use dom::window::WindowHelpers; use layout_interface::{LayoutChan, Msg}; -use util::str::DOMString; -use style::stylesheets::{Origin, Stylesheet}; use style::media_queries::parse_media_query_list; -use cssparser::Parser as CssParser; +use style::stylesheets::{Origin, Stylesheet}; +use util::str::DOMString; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/htmltablecaptionelement.rs b/components/script/dom/htmltablecaptionelement.rs index ca6ee6037d2..80d643e338a 100644 --- a/components/script/dom/htmltablecaptionelement.rs +++ b/components/script/dom/htmltablecaptionelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLTableCaptionElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTableCaptionElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs index 6f5d580eee8..29cf8eaaebd 100644 --- a/components/script/dom/htmltablecellelement.rs +++ b/components/script/dom/htmltablecellelement.rs @@ -6,8 +6,8 @@ use dom::attr::{Attr, AttrHelpers, AttrValue}; use dom::bindings::codegen::Bindings::HTMLTableCellElementBinding::HTMLTableCellElementMethods; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLTableCellElementDerived}; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::NodeTypeId; use dom::virtualmethods::VirtualMethods; diff --git a/components/script/dom/htmltablecolelement.rs b/components/script/dom/htmltablecolelement.rs index ab7f26da579..24cbd7ae335 100644 --- a/components/script/dom/htmltablecolelement.rs +++ b/components/script/dom/htmltablecolelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLTableColElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTableColElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmltabledatacellelement.rs b/components/script/dom/htmltabledatacellelement.rs index a26c5da8bbf..248374948fc 100644 --- a/components/script/dom/htmltabledatacellelement.rs +++ b/components/script/dom/htmltabledatacellelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLTableDataCellElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTableDataCellElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::HTMLElementTypeId; use dom::htmltablecellelement::{HTMLTableCellElement, HTMLTableCellElementTypeId}; use dom::node::{Node, NodeTypeId}; diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs index e889716572d..1d05cf70060 100644 --- a/components/script/dom/htmltableelement.rs +++ b/components/script/dom/htmltableelement.rs @@ -3,16 +3,16 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::attr::{Attr, AttrHelpers, AttrValue}; -use dom::bindings::codegen::Bindings::HTMLTableElementBinding::HTMLTableElementMethods; use dom::bindings::codegen::Bindings::HTMLTableElementBinding; +use dom::bindings::codegen::Bindings::HTMLTableElementBinding::HTMLTableElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; +use dom::bindings::codegen::InheritTypes::HTMLTableSectionElementDerived; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast, HTMLTableCaptionElementCast}; use dom::bindings::codegen::InheritTypes::{HTMLTableElementDerived, NodeCast}; -use dom::bindings::codegen::InheritTypes::HTMLTableSectionElementDerived; use dom::bindings::js::{Root, RootedReference}; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::{ElementHelpers, ElementTypeId}; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::htmltablecaptionelement::HTMLTableCaptionElement; use dom::htmltablesectionelement::HTMLTableSectionElement; diff --git a/components/script/dom/htmltableheadercellelement.rs b/components/script/dom/htmltableheadercellelement.rs index 3bcd41db05d..8b5cc867354 100644 --- a/components/script/dom/htmltableheadercellelement.rs +++ b/components/script/dom/htmltableheadercellelement.rs @@ -7,8 +7,8 @@ use dom::bindings::codegen::InheritTypes::HTMLTableHeaderCellElementDerived; use dom::bindings::js::Root; use dom::document::Document; use dom::element::ElementTypeId; -use dom::htmlelement::HTMLElementTypeId; use dom::eventtarget::{EventTarget, EventTargetTypeId}; +use dom::htmlelement::HTMLElementTypeId; use dom::htmltablecellelement::{HTMLTableCellElement, HTMLTableCellElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmltablerowelement.rs b/components/script/dom/htmltablerowelement.rs index 5d200eac16f..d93a4462bd8 100644 --- a/components/script/dom/htmltablerowelement.rs +++ b/components/script/dom/htmltablerowelement.rs @@ -7,15 +7,15 @@ use dom::bindings::codegen::Bindings::HTMLTableRowElementBinding; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLTableRowElementDerived}; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use dom::virtualmethods::VirtualMethods; use cssparser::RGBA; -use util::str::{self, DOMString}; use std::cell::Cell; +use util::str::{self, DOMString}; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/htmltablesectionelement.rs b/components/script/dom/htmltablesectionelement.rs index ceb03aa60ec..d0f1b8dd60d 100644 --- a/components/script/dom/htmltablesectionelement.rs +++ b/components/script/dom/htmltablesectionelement.rs @@ -7,15 +7,15 @@ use dom::bindings::codegen::Bindings::HTMLTableSectionElementBinding; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLTableSectionElementDerived}; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use dom::virtualmethods::VirtualMethods; use cssparser::RGBA; -use util::str::{self, DOMString}; use std::cell::Cell; +use util::str::{self, DOMString}; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/htmltemplateelement.rs b/components/script/dom/htmltemplateelement.rs index ba3250e0744..099e0f2975c 100644 --- a/components/script/dom/htmltemplateelement.rs +++ b/components/script/dom/htmltemplateelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTemplateElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index 9cd91e217bd..f92f797a4d5 100644 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -2,37 +2,37 @@ * 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::{Attr, AttrValue}; use dom::attr::AttrHelpers; +use dom::attr::{Attr, AttrValue}; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding; use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding::HTMLTextAreaElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; +use dom::bindings::codegen::InheritTypes::KeyboardEventCast; use dom::bindings::codegen::InheritTypes::{ElementCast, EventTargetCast, HTMLElementCast, NodeCast}; use dom::bindings::codegen::InheritTypes::{HTMLTextAreaElementDerived, HTMLFieldSetElementDerived}; -use dom::bindings::codegen::InheritTypes::KeyboardEventCast; use dom::bindings::global::GlobalRef; use dom::bindings::js::{LayoutJS, Root}; use dom::bindings::refcounted::Trusted; use dom::document::{Document, DocumentHelpers}; +use dom::element::ElementTypeId; use dom::element::{Element, AttributeHandlers}; use dom::event::{Event, EventBubbles, EventCancelable}; use dom::eventtarget::{EventTarget, EventTargetHelpers, EventTargetTypeId}; -use dom::element::ElementTypeId; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::htmlformelement::FormControl; use dom::keyboardevent::KeyboardEvent; use dom::node::{ChildrenMutation, DisabledStateHelpers, Node, NodeDamage}; use dom::node::{NodeHelpers, NodeTypeId, document_from_node, window_from_node}; -use textinput::{TextInput, Lines, KeyReaction}; use dom::virtualmethods::VirtualMethods; use dom::window::WindowHelpers; -use script_task::{Runnable, CommonScriptMsg}; use msg::constellation_msg::ConstellationChan; +use script_task::{Runnable, CommonScriptMsg}; +use textinput::{TextInput, Lines, KeyReaction}; -use util::str::DOMString; use string_cache::Atom; +use util::str::DOMString; use std::borrow::ToOwned; use std::cell::Cell; diff --git a/components/script/dom/htmltimeelement.rs b/components/script/dom/htmltimeelement.rs index 37bca69f08d..4a94581a386 100644 --- a/components/script/dom/htmltimeelement.rs +++ b/components/script/dom/htmltimeelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLTimeElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTimeElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmltitleelement.rs b/components/script/dom/htmltitleelement.rs index edc8c73946f..99aebc3e978 100644 --- a/components/script/dom/htmltitleelement.rs +++ b/components/script/dom/htmltitleelement.rs @@ -5,13 +5,13 @@ use dom::bindings::codegen::Bindings::HTMLTitleElementBinding; use dom::bindings::codegen::Bindings::HTMLTitleElementBinding::HTMLTitleElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; -use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLTitleElementDerived, NodeCast}; use dom::bindings::codegen::InheritTypes::{CharacterDataCast, TextCast}; +use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLTitleElementDerived, NodeCast}; use dom::bindings::js::Root; use dom::characterdata::CharacterDataHelpers; use dom::document::{Document, DocumentHelpers}; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{ChildrenMutation, Node, NodeHelpers, NodeTypeId}; use dom::text::Text; diff --git a/components/script/dom/htmltrackelement.rs b/components/script/dom/htmltrackelement.rs index 599a214f1d9..df3582483ec 100644 --- a/components/script/dom/htmltrackelement.rs +++ b/components/script/dom/htmltrackelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLTrackElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTrackElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/htmlulistelement.rs b/components/script/dom/htmlulistelement.rs index 40133f9b365..0ec7be9d5ca 100644 --- a/components/script/dom/htmlulistelement.rs +++ b/components/script/dom/htmlulistelement.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::HTMLUListElementBinding; use dom::bindings::codegen::InheritTypes::HTMLUListElementDerived; use dom::bindings::js::Root; use dom::document::Document; -use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::element::ElementTypeId; +use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::node::{Node, NodeTypeId}; use util::str::DOMString; diff --git a/components/script/dom/imagedata.rs b/components/script/dom/imagedata.rs index 00b725b7b97..88ed652f752 100644 --- a/components/script/dom/imagedata.rs +++ b/components/script/dom/imagedata.rs @@ -11,10 +11,10 @@ use euclid::size::Size2D; use js::jsapi::{JSContext, JSObject, Heap}; use js::jsapi::{JS_NewUint8ClampedArray, JS_GetUint8ClampedArrayData}; use libc::uint8_t; -use std::vec::Vec; -use std::slice; -use std::ptr; use std::default::Default; +use std::ptr; +use std::slice; +use std::vec::Vec; #[dom_struct] #[allow(raw_pointer_derive)] diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs index a3e2a24cb1a..e17bd16a513 100644 --- a/components/script/dom/location.rs +++ b/components/script/dom/location.rs @@ -12,8 +12,8 @@ use dom::urlhelper::UrlHelper; use dom::window::Window; use dom::window::WindowHelpers; -use util::str::DOMString; use url::{Url, UrlParser}; +use util::str::DOMString; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs index 74fae719db5..c2becf46c48 100644 --- a/components/script/dom/macros.rs +++ b/components/script/dom/macros.rs @@ -6,8 +6,8 @@ macro_rules! make_getter( ( $attr:ident, $htmlname:expr ) => ( fn $attr(self) -> DOMString { - use dom::element::AttributeHandlers; use dom::bindings::codegen::InheritTypes::ElementCast; + use dom::element::AttributeHandlers; use string_cache::Atom; let element = ElementCast::from_ref(self); element.get_string_attribute(&Atom::from_slice($htmlname)) @@ -22,8 +22,8 @@ macro_rules! make_getter( macro_rules! make_bool_getter( ( $attr:ident, $htmlname:expr ) => ( fn $attr(self) -> bool { - use dom::element::AttributeHandlers; use dom::bindings::codegen::InheritTypes::ElementCast; + use dom::element::AttributeHandlers; use string_cache::Atom; let element = ElementCast::from_ref(self); // FIXME(pcwalton): Do this at compile time, not runtime. @@ -39,8 +39,8 @@ macro_rules! make_bool_getter( macro_rules! make_uint_getter( ($attr:ident, $htmlname:expr, $default:expr) => ( fn $attr(self) -> u32 { - use dom::element::AttributeHandlers; use dom::bindings::codegen::InheritTypes::ElementCast; + use dom::element::AttributeHandlers; use string_cache::Atom; let element = ElementCast::from_ref(self); // FIXME(pcwalton): Do this at compile time, not runtime. @@ -59,8 +59,8 @@ macro_rules! make_uint_getter( macro_rules! make_url_getter( ( $attr:ident, $htmlname:expr ) => ( fn $attr(self) -> DOMString { - use dom::element::AttributeHandlers; use dom::bindings::codegen::InheritTypes::ElementCast; + use dom::element::AttributeHandlers; use string_cache::Atom; let element = ElementCast::from_ref(self); // FIXME(pcwalton): Do this at compile time, not runtime. @@ -77,8 +77,8 @@ macro_rules! make_url_getter( macro_rules! make_url_or_base_getter( ( $attr:ident, $htmlname:expr ) => ( fn $attr(self) -> DOMString { - use dom::element::AttributeHandlers; use dom::bindings::codegen::InheritTypes::ElementCast; + use dom::element::AttributeHandlers; use dom::window::WindowHelpers; use string_cache::Atom; let element = ElementCast::from_ref(self); @@ -100,11 +100,11 @@ macro_rules! make_url_or_base_getter( macro_rules! make_enumerated_getter( ( $attr:ident, $htmlname:expr, $default:expr, $(($choices: pat))|+) => ( fn $attr(self) -> DOMString { - use dom::element::AttributeHandlers; use dom::bindings::codegen::InheritTypes::ElementCast; - use string_cache::Atom; - use std::borrow::ToOwned; + use dom::element::AttributeHandlers; use std::ascii::AsciiExt; + use std::borrow::ToOwned; + use string_cache::Atom; let element = ElementCast::from_ref(self); let mut val = element.get_string_attribute(&Atom::from_slice($htmlname)); val.make_ascii_lowercase(); @@ -126,8 +126,8 @@ macro_rules! make_enumerated_getter( macro_rules! make_setter( ( $attr:ident, $htmlname:expr ) => ( fn $attr(self, value: DOMString) { - use dom::element::AttributeHandlers; use dom::bindings::codegen::InheritTypes::ElementCast; + use dom::element::AttributeHandlers; use string_cache::Atom; let element = ElementCast::from_ref(self); // FIXME(pcwalton): Do this at compile time, not at runtime. @@ -140,8 +140,8 @@ macro_rules! make_setter( macro_rules! make_bool_setter( ( $attr:ident, $htmlname:expr ) => ( fn $attr(self, value: bool) { - use dom::element::AttributeHandlers; use dom::bindings::codegen::InheritTypes::ElementCast; + use dom::element::AttributeHandlers; use string_cache::Atom; let element = ElementCast::from_ref(self); // FIXME(pcwalton): Do this at compile time, not at runtime. @@ -154,8 +154,8 @@ macro_rules! make_bool_setter( macro_rules! make_uint_setter( ($attr:ident, $htmlname:expr, $default:expr) => ( fn $attr(self, value: u32) { - use dom::element::AttributeHandlers; use dom::bindings::codegen::InheritTypes::ElementCast; + use dom::element::AttributeHandlers; use string_cache::Atom; let value = if value > 2147483647 { $default @@ -176,8 +176,8 @@ macro_rules! make_uint_setter( macro_rules! make_limited_uint_setter( ($attr:ident, $htmlname:expr, $default:expr) => ( fn $attr(self, value: u32) -> $crate::dom::bindings::error::ErrorResult { - use dom::element::AttributeHandlers; use dom::bindings::codegen::InheritTypes::ElementCast; + use dom::element::AttributeHandlers; use string_cache::Atom; let value = if value == 0 { return Err($crate::dom::bindings::error::Error::IndexSize); @@ -204,8 +204,8 @@ macro_rules! make_limited_uint_setter( macro_rules! make_atomic_setter( ( $attr:ident, $htmlname:expr ) => ( fn $attr(self, value: DOMString) { - use dom::element::AttributeHandlers; use dom::bindings::codegen::InheritTypes::ElementCast; + use dom::element::AttributeHandlers; use string_cache::Atom; let element = ElementCast::from_ref(self); // FIXME(pcwalton): Do this at compile time, not at runtime. diff --git a/components/script/dom/mouseevent.rs b/components/script/dom/mouseevent.rs index 0a15c8ad640..08cd4543e54 100644 --- a/components/script/dom/mouseevent.rs +++ b/components/script/dom/mouseevent.rs @@ -14,10 +14,10 @@ use dom::event::{Event, EventTypeId, EventBubbles, EventCancelable}; use dom::eventtarget::EventTarget; use dom::uievent::{UIEvent, UIEventTypeId}; use dom::window::Window; -use util::opts; -use util::str::DOMString; use std::cell::Cell; use std::default::Default; +use util::opts; +use util::str::DOMString; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/navigatorinfo.rs b/components/script/dom/navigatorinfo.rs index 4982908969b..d47b02f21dd 100644 --- a/components/script/dom/navigatorinfo.rs +++ b/components/script/dom/navigatorinfo.rs @@ -2,8 +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 util::str::DOMString; use util::opts; +use util::str::DOMString; use std::borrow::ToOwned; diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 6ca62f181e3..5b482c817b9 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 devtools_traits::NodeInfo; use document_loader::DocumentLoader; use dom::attr::{Attr, AttrHelpers}; use dom::bindings::cell::DOMRefCell; @@ -22,12 +23,12 @@ use dom::bindings::codegen::InheritTypes::{HTMLOptGroupElementDerived, NodeBase, use dom::bindings::codegen::InheritTypes::{ProcessingInstructionCast, TextCast, TextDerived}; use dom::bindings::codegen::UnionTypes::NodeOrString; use dom::bindings::conversions; -use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::Error::{NotFound, HierarchyRequest, Syntax}; +use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; -use dom::bindings::js::{JS, LayoutJS, MutNullableHeap}; use dom::bindings::js::Root; use dom::bindings::js::RootedReference; +use dom::bindings::js::{JS, LayoutJS, MutNullableHeap}; use dom::bindings::trace::JSTraceable; use dom::bindings::trace::RootedVec; use dom::bindings::utils::{namespace_from_domstring, Reflectable, reflect_dom_object}; @@ -36,8 +37,8 @@ use dom::comment::Comment; use dom::document::{Document, DocumentHelpers, IsHTMLDocument, DocumentSource}; use dom::documentfragment::DocumentFragment; use dom::documenttype::DocumentType; -use dom::element::{AttributeHandlers, Element, ElementCreator, ElementTypeId}; use dom::element::ElementHelpers; +use dom::element::{AttributeHandlers, Element, ElementCreator, ElementTypeId}; use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::htmlelement::HTMLElementTypeId; use dom::nodelist::{NodeList, NodeListHelpers}; @@ -47,19 +48,18 @@ use dom::virtualmethods::{VirtualMethods, vtable_for}; use dom::window::{Window, WindowHelpers}; use euclid::rect::Rect; use layout_interface::{LayoutChan, Msg}; -use devtools_traits::NodeInfo; use parse::html::parse_html_fragment; use script_traits::UntrustedNodeAddress; -use util::geometry::Au; -use util::str::DOMString; -use util::task_state; +use selectors::matching::matches; use selectors::parser::Selector; use selectors::parser::parse_author_origin_selector_list_from_str; -use selectors::matching::matches; use style::properties::ComputedValues; +use util::geometry::Au; +use util::str::DOMString; +use util::task_state; -use js::jsapi::{JSContext, JSObject, JSRuntime}; use core::nonzero::NonZero; +use js::jsapi::{JSContext, JSObject, JSRuntime}; use libc; use libc::{uintptr_t, c_void}; use std::borrow::ToOwned; @@ -69,8 +69,8 @@ use std::iter::{FilterMap, Peekable}; use std::mem; use std::slice::ref_slice; use std::sync::Arc; -use uuid; use string_cache::{Atom, Namespace, QualName}; +use uuid; // // The basic Node structure diff --git a/components/script/dom/nodeiterator.rs b/components/script/dom/nodeiterator.rs index 0958bfca992..d1194c1326a 100644 --- a/components/script/dom/nodeiterator.rs +++ b/components/script/dom/nodeiterator.rs @@ -3,11 +3,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::callback::ExceptionHandling::Rethrow; -use dom::bindings::codegen::Bindings::NodeIteratorBinding; -use dom::bindings::codegen::Bindings::NodeIteratorBinding::NodeIteratorMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeFilterBinding::NodeFilter; use dom::bindings::codegen::Bindings::NodeFilterBinding::NodeFilterConstants; +use dom::bindings::codegen::Bindings::NodeIteratorBinding; +use dom::bindings::codegen::Bindings::NodeIteratorBinding::NodeIteratorMethods; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, MutHeap, Root}; diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs index 78af618eff5..c0e832e7ae4 100644 --- a/components/script/dom/range.rs +++ b/components/script/dom/range.rs @@ -6,13 +6,13 @@ use dom::bindings::codegen::Bindings::CharacterDataBinding::CharacterDataMethods use dom::bindings::codegen::Bindings::NodeBinding::NodeConstants; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeListBinding::NodeListMethods; -use dom::bindings::codegen::Bindings::RangeBinding::{self, RangeConstants}; use dom::bindings::codegen::Bindings::RangeBinding::RangeMethods; +use dom::bindings::codegen::Bindings::RangeBinding::{self, RangeConstants}; use dom::bindings::codegen::Bindings::TextBinding::TextMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::codegen::InheritTypes::{CharacterDataCast, NodeCast, TextCast}; -use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::error::Error::HierarchyRequest; +use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, Root, RootedReference}; use dom::bindings::utils::{Reflector, reflect_dom_object}; diff --git a/components/script/dom/servohtmlparser.rs b/components/script/dom/servohtmlparser.rs index b9ccd50632f..63cb459379f 100644 --- a/components/script/dom/servohtmlparser.rs +++ b/components/script/dom/servohtmlparser.rs @@ -9,9 +9,9 @@ use document_loader::LoadType; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::ServoHTMLParserBinding; use dom::bindings::global::GlobalRef; -use dom::bindings::trace::JSTraceable; use dom::bindings::js::{JS, Root}; use dom::bindings::refcounted::Trusted; +use dom::bindings::trace::JSTraceable; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::document::{Document, DocumentHelpers}; use dom::node::{window_from_node, Node}; @@ -25,15 +25,15 @@ use net_traits::{Metadata, AsyncResponseListener}; use encoding::all::UTF_8; use encoding::types::{Encoding, DecoderTrap}; -use std::cell::{Cell, RefCell}; -use std::default::Default; -use url::Url; -use js::jsapi::JSTracer; use html5ever::tokenizer; use html5ever::tree_builder; use html5ever::tree_builder::{TreeBuilder, TreeBuilderOpts}; use hyper::header::ContentType; use hyper::mime::{Mime, TopLevel, SubLevel}; +use js::jsapi::JSTracer; +use std::cell::{Cell, RefCell}; +use std::default::Default; +use url::Url; #[must_root] #[derive(JSTraceable, HeapSizeOf)] diff --git a/components/script/dom/storage.rs b/components/script/dom/storage.rs index 7231d10247d..ca47bb76c03 100644 --- a/components/script/dom/storage.rs +++ b/components/script/dom/storage.rs @@ -4,23 +4,23 @@ use dom::bindings::codegen::Bindings::StorageBinding; use dom::bindings::codegen::Bindings::StorageBinding::StorageMethods; +use dom::bindings::codegen::InheritTypes::{EventCast, EventTargetCast}; use dom::bindings::global::{GlobalRef, GlobalField}; use dom::bindings::js::{Root, RootedReference}; use dom::bindings::refcounted::Trusted; use dom::bindings::utils::{Reflector, reflect_dom_object}; -use dom::bindings::codegen::InheritTypes::{EventCast, EventTargetCast}; use dom::event::{EventHelpers, EventBubbles, EventCancelable}; use dom::storageevent::StorageEvent; use dom::urlhelper::UrlHelper; use dom::window::WindowHelpers; use ipc_channel::ipc; -use util::str::DOMString; -use page::IterablePage; use net_traits::storage_task::{StorageTask, StorageTaskMsg, StorageType}; +use page::IterablePage; use script_task::{ScriptTask, MainThreadRunnable, MainThreadScriptMsg}; use std::borrow::ToOwned; use std::sync::mpsc::channel; use url::Url; +use util::str::DOMString; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index d783e876b98..e61b12eee7b 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -4,11 +4,11 @@ // check-tidy: no specs after this line +use dom::bindings::codegen::Bindings::EventListenerBinding::EventListener; +use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::TestBindingBinding::TestBindingMethods; use dom::bindings::codegen::Bindings::TestBindingBinding::TestEnum; use dom::bindings::codegen::Bindings::TestBindingBinding::TestEnum::_empty; -use dom::bindings::codegen::Bindings::EventListenerBinding::EventListener; -use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::UnionTypes::BlobOrString; use dom::bindings::codegen::UnionTypes::EventOrString; use dom::bindings::codegen::UnionTypes::EventOrString::eString; diff --git a/components/script/dom/text.rs b/components/script/dom/text.rs index e2fed3be09c..d5f314ab0c6 100644 --- a/components/script/dom/text.rs +++ b/components/script/dom/text.rs @@ -2,17 +2,17 @@ * 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::codegen::Bindings::TextBinding::{self, TextMethods}; use dom::bindings::codegen::Bindings::CharacterDataBinding::CharacterDataMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; +use dom::bindings::codegen::Bindings::TextBinding::{self, TextMethods}; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; -use dom::bindings::codegen::InheritTypes::{CharacterDataCast, TextDerived}; use dom::bindings::codegen::InheritTypes::NodeCast; +use dom::bindings::codegen::InheritTypes::{CharacterDataCast, TextDerived}; use dom::bindings::error::{Error, Fallible}; use dom::bindings::global::GlobalRef; -use dom::bindings::js::{RootedReference}; use dom::bindings::js::Root; +use dom::bindings::js::{RootedReference}; use dom::characterdata::{CharacterData, CharacterDataHelpers, CharacterDataTypeId}; use dom::document::Document; use dom::eventtarget::{EventTarget, EventTargetTypeId}; diff --git a/components/script/dom/textdecoder.rs b/components/script/dom/textdecoder.rs index e83d85072b3..c921dc68289 100644 --- a/components/script/dom/textdecoder.rs +++ b/components/script/dom/textdecoder.rs @@ -14,10 +14,10 @@ use dom::bindings::utils::{Reflector, reflect_dom_object}; use util::str::DOMString; use encoding::Encoding; -use encoding::types::{EncodingRef, DecoderTrap}; use encoding::label::encoding_from_whatwg_label; -use js::jsapi::{JSContext, JSObject}; +use encoding::types::{EncodingRef, DecoderTrap}; use js::jsapi::JS_GetObjectAsArrayBufferView; +use js::jsapi::{JSContext, JSObject}; use std::borrow::ToOwned; use std::ptr; diff --git a/components/script/dom/textencoder.rs b/components/script/dom/textencoder.rs index 1b76de05d0d..47a23681e74 100644 --- a/components/script/dom/textencoder.rs +++ b/components/script/dom/textencoder.rs @@ -4,9 +4,9 @@ use dom::bindings::codegen::Bindings::TextEncoderBinding; use dom::bindings::codegen::Bindings::TextEncoderBinding::TextEncoderMethods; -use dom::bindings::global::GlobalRef; -use dom::bindings::error::Fallible; use dom::bindings::error::Error::Range; +use dom::bindings::error::Fallible; +use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::str::USVString; use dom::bindings::utils::{Reflector, reflect_dom_object}; @@ -16,13 +16,13 @@ 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 encoding::label::encoding_from_whatwg_label; -use libc::uint8_t; use js::jsapi::{JSContext, JSObject}; use js::jsapi::{JS_NewUint8Array, JS_GetUint8ArrayData}; +use libc::uint8_t; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/treewalker.rs b/components/script/dom/treewalker.rs index b8271909505..cc90a0ab23e 100644 --- a/components/script/dom/treewalker.rs +++ b/components/script/dom/treewalker.rs @@ -3,15 +3,15 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::callback::ExceptionHandling::Rethrow; -use dom::bindings::codegen::Bindings::TreeWalkerBinding; -use dom::bindings::codegen::Bindings::TreeWalkerBinding::TreeWalkerMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeFilterBinding::NodeFilter; use dom::bindings::codegen::Bindings::NodeFilterBinding::NodeFilterConstants; +use dom::bindings::codegen::Bindings::TreeWalkerBinding; +use dom::bindings::codegen::Bindings::TreeWalkerBinding::TreeWalkerMethods; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; -use dom::bindings::js::{JS, MutHeap}; use dom::bindings::js::Root; +use dom::bindings::js::{JS, MutHeap}; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::document::{Document, DocumentHelpers}; use dom::node::Node; diff --git a/components/script/dom/uievent.rs b/components/script/dom/uievent.rs index b9d66082594..abccf1abcd2 100644 --- a/components/script/dom/uievent.rs +++ b/components/script/dom/uievent.rs @@ -8,8 +8,8 @@ use dom::bindings::codegen::Bindings::UIEventBinding::UIEventMethods; use dom::bindings::codegen::InheritTypes::{EventCast, UIEventDerived}; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; -use dom::bindings::js::{JS, MutNullableHeap, RootedReference}; 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}; diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs index d4a8b5a23ff..daba091955c 100644 --- a/components/script/dom/url.rs +++ b/components/script/dom/url.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::URLBinding::{self, URLMethods}; 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 dom::bindings::str::USVString; +use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::urlhelper::UrlHelper; use url::{Host, Url, UrlParser}; diff --git a/components/script/dom/userscripts.rs b/components/script/dom/userscripts.rs index a71ead38e52..c8fce99002c 100644 --- a/components/script/dom/userscripts.rs +++ b/components/script/dom/userscripts.rs @@ -2,18 +2,18 @@ * 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::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; +use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::InheritTypes::NodeCast; use dom::bindings::js::{RootedReference}; use dom::element::AttributeHandlers; use dom::htmlheadelement::HTMLHeadElement; use dom::node::NodeHelpers; -use util::opts; -use util::resource_files::resources_dir_path; use std::borrow::ToOwned; use std::fs::read_dir; use std::path::PathBuf; +use util::opts; +use util::resource_files::resources_dir_path; pub fn load_script(head: &HTMLHeadElement) { diff --git a/components/script/dom/virtualmethods.rs b/components/script/dom/virtualmethods.rs index 437f39422c6..22f33d63201 100644 --- a/components/script/dom/virtualmethods.rs +++ b/components/script/dom/virtualmethods.rs @@ -5,8 +5,8 @@ use dom::attr::{Attr, AttrValue}; use dom::bindings::codegen::InheritTypes::ElementCast; use dom::bindings::codegen::InheritTypes::HTMLAnchorElementCast; -use dom::bindings::codegen::InheritTypes::HTMLAreaElementCast; use dom::bindings::codegen::InheritTypes::HTMLAppletElementCast; +use dom::bindings::codegen::InheritTypes::HTMLAreaElementCast; use dom::bindings::codegen::InheritTypes::HTMLBaseElementCast; use dom::bindings::codegen::InheritTypes::HTMLBodyElementCast; use dom::bindings::codegen::InheritTypes::HTMLButtonElementCast; @@ -26,8 +26,8 @@ use dom::bindings::codegen::InheritTypes::HTMLOptionElementCast; use dom::bindings::codegen::InheritTypes::HTMLScriptElementCast; use dom::bindings::codegen::InheritTypes::HTMLSelectElementCast; use dom::bindings::codegen::InheritTypes::HTMLStyleElementCast; -use dom::bindings::codegen::InheritTypes::HTMLTableElementCast; use dom::bindings::codegen::InheritTypes::HTMLTableCellElementCast; +use dom::bindings::codegen::InheritTypes::HTMLTableElementCast; use dom::bindings::codegen::InheritTypes::HTMLTableRowElementCast; use dom::bindings::codegen::InheritTypes::HTMLTableSectionElementCast; use dom::bindings::codegen::InheritTypes::HTMLTextAreaElementCast; @@ -36,8 +36,8 @@ use dom::document::Document; use dom::element::ElementTypeId; use dom::event::Event; use dom::htmlelement::HTMLElementTypeId; -use dom::node::{ChildrenMutation, CloneChildrenFlag, Node, NodeHelpers}; use dom::node::NodeTypeId; +use dom::node::{ChildrenMutation, CloneChildrenFlag, Node, NodeHelpers}; use util::str::DOMString; diff --git a/components/script/dom/webglobject.rs b/components/script/dom/webglobject.rs index 46ac7d81d80..ea31d7364e7 100644 --- a/components/script/dom/webglobject.rs +++ b/components/script/dom/webglobject.rs @@ -5,8 +5,8 @@ // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl use dom::bindings::codegen::Bindings::WebGLObjectBinding; use dom::bindings::global::GlobalRef; -use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::bindings::js::Root; +use dom::bindings::utils::{Reflector, reflect_dom_object}; #[dom_struct] #[derive(HeapSizeOf)] diff --git a/components/script/dom/webglprogram.rs b/components/script/dom/webglprogram.rs index 0c93aba3b5b..e4f598285d3 100644 --- a/components/script/dom/webglprogram.rs +++ b/components/script/dom/webglprogram.rs @@ -8,8 +8,8 @@ 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::webglshader::{WebGLShader, WebGLShaderHelpers}; use dom::webglrenderingcontext::MAX_UNIFORM_AND_ATTRIBUTE_LEN; +use dom::webglshader::{WebGLShader, WebGLShaderHelpers}; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 4acf36256c8..356e556eaa6 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -9,17 +9,17 @@ use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding:: {self, WebGLContextAttributes, WebGLRenderingContextMethods}; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; +use dom::bindings::conversions::ToJSValConvertible; use dom::bindings::global::{GlobalRef, GlobalField}; use dom::bindings::js::{JS, LayoutJS, Root}; use dom::bindings::utils::{Reflector, reflect_dom_object}; -use dom::bindings::conversions::ToJSValConvertible; use dom::htmlcanvaselement::{HTMLCanvasElement}; use dom::webglbuffer::{WebGLBuffer, WebGLBufferHelpers}; use dom::webglframebuffer::{WebGLFramebuffer, WebGLFramebufferHelpers}; +use dom::webglprogram::{WebGLProgram, WebGLProgramHelpers}; use dom::webglrenderbuffer::{WebGLRenderbuffer, WebGLRenderbufferHelpers}; -use dom::webgltexture::{WebGLTexture, WebGLTextureHelpers}; use dom::webglshader::{WebGLShader, WebGLShaderHelpers}; -use dom::webglprogram::{WebGLProgram, WebGLProgramHelpers}; +use dom::webgltexture::{WebGLTexture, WebGLTextureHelpers}; use dom::webgluniformlocation::{WebGLUniformLocation, WebGLUniformLocationHelpers}; use euclid::size::Size2D; use ipc_channel::ipc::{self, IpcSender}; @@ -27,13 +27,13 @@ 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 offscreen_gl_context::GLContextAttributes; use std::cell::Cell; use std::mem; use std::ptr; use std::slice; use std::sync::mpsc::channel; use util::str::DOMString; -use offscreen_gl_context::GLContextAttributes; pub const MAX_UNIFORM_AND_ATTRIBUTE_LEN: usize = 256; diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs index 1e00a9e507a..9bd0610d666 100644 --- a/components/script/dom/websocket.rs +++ b/components/script/dom/websocket.rs @@ -3,14 +3,14 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::cell::DOMRefCell; +use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; use dom::bindings::codegen::Bindings::WebSocketBinding; use dom::bindings::codegen::Bindings::WebSocketBinding::{BinaryType, WebSocketMethods}; -use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; -use dom::bindings::codegen::InheritTypes::EventTargetCast; use dom::bindings::codegen::InheritTypes::EventCast; +use dom::bindings::codegen::InheritTypes::EventTargetCast; use dom::bindings::conversions::ToJSValConvertible; -use dom::bindings::error::{Error, Fallible}; use dom::bindings::error::Error::{InvalidAccess, Syntax}; +use dom::bindings::error::{Error, Fallible}; use dom::bindings::global::{GlobalField, GlobalRef}; use dom::bindings::js::Root; use dom::bindings::refcounted::Trusted; @@ -28,21 +28,21 @@ use net_traits::hosts::replace_hosts; use util::str::DOMString; use util::task::spawn_named; -use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment}; +use hyper::header::Host; use js::jsapi::{JS_NewArrayBuffer, JS_GetArrayBufferData}; +use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment}; use js::jsval::UndefinedValue; -use hyper::header::Host; use libc::{uint8_t, uint32_t}; +use websocket::Client; use websocket::Message; -use websocket::ws::sender::Sender as Sender_Object; -use websocket::client::sender::Sender; use websocket::client::receiver::Receiver; -use websocket::stream::WebSocketStream; use websocket::client::request::Url; -use websocket::Client; +use websocket::client::sender::Sender; use websocket::header::Origin; use websocket::result::WebSocketResult; +use websocket::stream::WebSocketStream; 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; diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 82e3247dc8e..ae9a0500c9e 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -2,19 +2,19 @@ * 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::callback::ExceptionHandling; -use dom::bindings::codegen::Bindings::EventHandlerBinding::{OnErrorEventHandlerNonNull, EventHandlerNonNull}; +use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; +use dom::bindings::codegen::Bindings::EventHandlerBinding::{OnErrorEventHandlerNonNull, EventHandlerNonNull}; use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::WindowBinding::{self, WindowMethods, FrameRequestCallback}; use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, EventTargetCast, WindowDerived}; -use dom::bindings::global::global_object_for_js_object; -use dom::bindings::error::{report_pending_exception, Fallible}; use dom::bindings::error::Error::InvalidCharacter; +use dom::bindings::error::{report_pending_exception, Fallible}; use dom::bindings::global::GlobalRef; -use dom::bindings::js::{JS, Root, MutNullableHeap}; +use dom::bindings::global::global_object_for_js_object; use dom::bindings::js::RootedReference; +use dom::bindings::js::{JS, Root, MutNullableHeap}; use dom::bindings::num::Finite; use dom::bindings::utils::{GlobalStaticData, Reflectable, WindowProxyHandler}; use dom::browsercontext::BrowsingContext; @@ -31,11 +31,11 @@ use dom::node::{window_from_node, TrustedNodeAddress, NodeHelpers, from_untruste use dom::performance::Performance; use dom::screen::Screen; use dom::storage::Storage; -use layout_interface::{ReflowGoal, ReflowQueryType, LayoutRPC, LayoutChan, Reflow, Msg}; use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow}; +use layout_interface::{ReflowGoal, ReflowQueryType, LayoutRPC, LayoutChan, Reflow, Msg}; use page::Page; -use script_task::{TimerSource, ScriptChan, ScriptPort, MainThreadScriptMsg}; 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; @@ -51,16 +51,16 @@ use net_traits::storage_task::{StorageTask, StorageType}; use profile_traits::mem; use string_cache::Atom; use util::geometry::{self, Au, MAX_RECT}; -use util::{breakpoint, opts}; use util::str::{DOMString, HTML_SPACE_CHARACTERS}; +use util::{breakpoint, opts}; use euclid::{Point2D, Rect, Size2D}; use ipc_channel::ipc::IpcSender; use js::jsapi::{Evaluate2, MutableHandleValue}; use js::jsapi::{JSContext, HandleValue}; use js::jsapi::{JS_GC, JS_GetRuntime, JSAutoCompartment, JSAutoRequest}; -use js::rust::Runtime; use js::rust::CompileOptionsWrapper; +use js::rust::Runtime; use selectors::parser::PseudoElement; use url::Url; diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs index 7ecbcaa864c..fe4d5aecaf6 100644 --- a/components/script/dom/worker.rs +++ b/components/script/dom/worker.rs @@ -2,32 +2,32 @@ * 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::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; use dom::bindings::codegen::Bindings::WorkerBinding; use dom::bindings::codegen::Bindings::WorkerBinding::WorkerMethods; -use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; use dom::bindings::codegen::InheritTypes::{EventCast, EventTargetCast}; -use dom::bindings::error::{Fallible, ErrorResult}; use dom::bindings::error::Error::Syntax; +use dom::bindings::error::{Fallible, ErrorResult}; use dom::bindings::global::{GlobalRef, GlobalField}; +use dom::bindings::js::Root; use dom::bindings::refcounted::Trusted; use dom::bindings::structuredclone::StructuredCloneData; use dom::bindings::trace::JSTraceable; use dom::bindings::utils::{Reflectable, reflect_dom_object}; -use dom::bindings::js::Root; -use dom::window::WindowHelpers; use dom::dedicatedworkerglobalscope::{DedicatedWorkerGlobalScope, WorkerScriptMsg}; use dom::errorevent::ErrorEvent; use dom::event::{Event, EventBubbles, EventCancelable, EventHelpers}; use dom::eventtarget::{EventTarget, EventTargetHelpers, EventTargetTypeId}; use dom::messageevent::MessageEvent; +use dom::window::WindowHelpers; use dom::workerglobalscope::WorkerGlobalScopeInit; use devtools_traits::{DevtoolsPageInfo, ScriptToDevtoolsControlMsg}; use script_task::{ScriptChan, Runnable}; use ipc_channel::ipc; -use js::jsapi::{JSContext, HandleValue, RootedValue}; use js::jsapi::{JSAutoRequest, JSAutoCompartment}; +use js::jsapi::{JSContext, HandleValue, RootedValue}; use js::jsval::UndefinedValue; use url::UrlParser; use util::str::DOMString; diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index 468de091271..33201a35509 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -5,8 +5,8 @@ use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods; use dom::bindings::codegen::InheritTypes::DedicatedWorkerGlobalScopeCast; -use dom::bindings::error::{ErrorResult, Fallible, report_pending_exception}; use dom::bindings::error::Error::{Syntax, Network, JSFailed}; +use dom::bindings::error::{ErrorResult, Fallible, report_pending_exception}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, Root, MutNullableHeap}; use dom::bindings::utils::Reflectable; @@ -14,17 +14,17 @@ use dom::console::Console; use dom::crypto::Crypto; use dom::dedicatedworkerglobalscope::DedicatedWorkerGlobalScopeHelpers; use dom::eventtarget::{EventTarget, EventTargetTypeId}; +use dom::window::{base64_atob, base64_btoa}; use dom::workerlocation::WorkerLocation; use dom::workernavigator::WorkerNavigator; -use dom::window::{base64_atob, base64_btoa}; 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 profile_traits::mem; use net_traits::{load_whole_resource, ResourceTask}; +use profile_traits::mem; use util::str::DOMString; use ipc_channel::ipc::IpcSender; @@ -32,8 +32,8 @@ use js::jsapi::{JSContext, HandleValue, JSAutoRequest}; use js::rust::Runtime; use url::{Url, UrlParser}; -use std::default::Default; use std::cell::Cell; +use std::default::Default; use std::rc::Rc; use std::sync::mpsc::Receiver; diff --git a/components/script/dom/workerlocation.rs b/components/script/dom/workerlocation.rs index fa52ce1dcf4..f4f9209445a 100644 --- a/components/script/dom/workerlocation.rs +++ b/components/script/dom/workerlocation.rs @@ -4,8 +4,8 @@ use dom::bindings::codegen::Bindings::WorkerLocationBinding; use dom::bindings::codegen::Bindings::WorkerLocationBinding::WorkerLocationMethods; -use dom::bindings::js::Root; use dom::bindings::global::GlobalRef; +use dom::bindings::js::Root; use dom::bindings::str::USVString; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::urlhelper::UrlHelper; diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 577416fe700..40325fdcf49 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -10,12 +10,12 @@ use dom::bindings::codegen::Bindings::XMLHttpRequestBinding::XMLHttpRequestRespo use dom::bindings::codegen::Bindings::XMLHttpRequestBinding::XMLHttpRequestResponseType::{_empty, Json, Text}; use dom::bindings::codegen::InheritTypes::{EventCast, EventTargetCast, XMLHttpRequestDerived}; use dom::bindings::conversions::ToJSValConvertible; -use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::error::Error::{InvalidState, InvalidAccess}; use dom::bindings::error::Error::{Network, Syntax, Security, Abort, Timeout}; +use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::{GlobalField, GlobalRef, GlobalRoot}; -use dom::bindings::js::{JS, MutNullableHeap}; use dom::bindings::js::Root; +use dom::bindings::js::{JS, MutNullableHeap}; use dom::bindings::refcounted::Trusted; use dom::bindings::str::ByteString; use dom::bindings::utils::{Reflectable, reflect_dom_object}; @@ -37,18 +37,18 @@ use encoding::types::{DecoderTrap, Encoding, EncodingRef, EncoderTrap}; use hyper::header::Headers; use hyper::header::{Accept, ContentLength, ContentType, qitem}; use hyper::http::RawStatus; -use hyper::mime::{self, Mime}; use hyper::method::Method; +use hyper::mime::{self, Mime}; -use js::jsapi::{JS_ParseJSON, JSContext, RootedValue}; 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::{ResourceTask, ResourceCORSData, LoadData, LoadConsumer}; use net_traits::{AsyncResponseListener, AsyncResponseTarget, Metadata}; -use cors::{allow_cross_origin_request, CORSRequest, RequestMode, AsyncCORSResponseListener}; -use cors::CORSResponse; +use net_traits::{ResourceTask, ResourceCORSData, LoadData, LoadConsumer}; use util::mem::HeapSizeOf; use util::str::DOMString; use util::task::spawn_named; @@ -59,8 +59,8 @@ use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::cell::{RefCell, Cell}; use std::default::Default; -use std::sync::{Mutex, Arc}; use std::sync::mpsc::{channel, Sender, TryRecvError}; +use std::sync::{Mutex, Arc}; use std::thread::sleep_ms; use time; use url::{Url, UrlParser}; @@ -1052,10 +1052,10 @@ impl<'a> PrivateXMLHttpRequestHelpers for &'a XMLHttpRequest { } fn filter_response_headers(self) -> Headers { // https://fetch.spec.whatwg.org/#concept-response-header-list - use std::fmt; - use hyper::header::{Header, HeaderFormat}; - use hyper::header::SetCookie; use hyper::error::Result; + use hyper::header::SetCookie; + use hyper::header::{Header, HeaderFormat}; + use std::fmt; // a dummy header so we can use headers.remove::<SetCookie2>() #[derive(Clone, Debug, HeapSizeOf)] diff --git a/components/script/dom/xmlhttprequestupload.rs b/components/script/dom/xmlhttprequestupload.rs index 02e1b38deae..5753117863b 100644 --- a/components/script/dom/xmlhttprequestupload.rs +++ b/components/script/dom/xmlhttprequestupload.rs @@ -2,8 +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 dom::bindings::codegen::InheritTypes::XMLHttpRequestUploadDerived; use dom::bindings::codegen::Bindings::XMLHttpRequestUploadBinding; +use dom::bindings::codegen::InheritTypes::XMLHttpRequestUploadDerived; use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::utils::reflect_dom_object; diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs index 8a93faa8fe2..053c58dc387 100644 --- a/components/script/layout_interface.rs +++ b/components/script/layout_interface.rs @@ -12,12 +12,12 @@ use euclid::point::Point2D; use euclid::rect::Rect; use ipc_channel::ipc::{IpcReceiver, IpcSender}; use libc::uintptr_t; +use msg::compositor_msg::Epoch; use msg::compositor_msg::LayerId; use msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, PipelineId}; use msg::constellation_msg::{WindowSizeData}; -use msg::compositor_msg::Epoch; -use net_traits::image_cache_task::ImageCacheTask; use net_traits::PendingAsyncLoad; +use net_traits::image_cache_task::ImageCacheTask; use profile_traits::mem::ReportsChan; use script_traits::{ConstellationControlMsg, LayoutControlMsg}; use script_traits::{OpaqueScriptLayoutChannel, StylesheetLoadResponder, UntrustedNodeAddress}; diff --git a/components/script/network_listener.rs b/components/script/network_listener.rs index e8b2e9f59ba..a65fec9a689 100644 --- a/components/script/network_listener.rs +++ b/components/script/network_listener.rs @@ -2,8 +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 script_task::{ScriptChan, Runnable, CommonScriptMsg}; use net_traits::{AsyncResponseListener, ResponseAction}; +use script_task::{ScriptChan, Runnable, CommonScriptMsg}; use std::sync::{Arc, Mutex}; /// An off-thread sink for async network event runnables. All such events are forwarded to diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs index cd4e6dd1d47..872fd334ab4 100644 --- a/components/script/parse/html.rs +++ b/components/script/parse/html.rs @@ -8,10 +8,10 @@ use document_loader::DocumentLoader; use dom::attr::AttrHelpers; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; +use dom::bindings::codegen::InheritTypes::ProcessingInstructionCast; use dom::bindings::codegen::InheritTypes::{CharacterDataCast, DocumentTypeCast}; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLScriptElementCast}; use dom::bindings::codegen::InheritTypes::{HTMLFormElementDerived, NodeCast}; -use dom::bindings::codegen::InheritTypes::ProcessingInstructionCast; use dom::bindings::js::{JS, Root}; use dom::bindings::js::{RootedReference}; use dom::characterdata::{CharacterDataHelpers, CharacterDataTypeId}; @@ -32,18 +32,18 @@ use parse::Parser; use encoding::types::Encoding; -use msg::constellation_msg::PipelineId; -use util::str::DOMString; -use std::borrow::Cow; -use std::io::{self, Write}; -use url::Url; use html5ever::Attribute; -use html5ever::serialize::{Serializable, Serializer, AttrRef}; use html5ever::serialize::TraversalScope; use html5ever::serialize::TraversalScope::{IncludeNode, ChildrenOnly}; +use html5ever::serialize::{Serializable, Serializer, AttrRef}; use html5ever::tree_builder::{TreeSink, QuirksMode, NodeOrText, AppendNode, AppendText, NextParserState}; +use msg::constellation_msg::PipelineId; +use std::borrow::Cow; +use std::io::{self, Write}; use string_cache::QualName; use tendril::StrTendril; +use url::Url; +use util::str::DOMString; trait SinkHelpers { fn get_or_create(&self, child: NodeOrText<JS<Node>>) -> Root<Node>; diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 438efaed0b1..17e0a58314f 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -19,6 +19,7 @@ #![allow(unsafe_code)] +use devtools; use document_loader::{LoadType, DocumentLoader, NotifierData}; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; @@ -37,47 +38,46 @@ use dom::document::{DocumentProgressTask, DocumentSource, MouseEventType}; use dom::element::{Element, AttributeHandlers}; use dom::event::{EventHelpers, EventBubbles, EventCancelable}; use dom::htmliframeelement::HTMLIFrameElementHelpers; -use dom::uievent::UIEvent; use dom::node::{Node, NodeHelpers, NodeDamage, window_from_node}; use dom::servohtmlparser::{ServoHTMLParser, ParserContext}; +use dom::uievent::UIEvent; use dom::window::{Window, WindowHelpers, ScriptHelpers, ReflowReason}; use dom::worker::TrustedWorkerAddress; -use parse::html::{ParseContext, parse_html}; -use layout_interface::{self, NewLayoutTaskInfo, ScriptLayoutChan, LayoutChan, ReflowGoal}; use layout_interface::{ReflowQueryType}; +use layout_interface::{self, NewLayoutTaskInfo, ScriptLayoutChan, LayoutChan, ReflowGoal}; use mem::heap_size_of_eventtarget; use network_listener::NetworkListener; use page::{Page, IterablePage, Frame}; +use parse::html::{ParseContext, parse_html}; use timers::TimerId; -use devtools; use webdriver_handlers; use devtools_traits::{DevtoolsPageInfo, DevtoolScriptControlMsg}; use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType}; use devtools_traits::{TracingMetadata}; -use script_traits::CompositorEvent::{MouseDownEvent, MouseUpEvent}; -use script_traits::CompositorEvent::{MouseMoveEvent, KeyEvent}; -use script_traits::CompositorEvent::{ResizeEvent, ClickEvent}; -use script_traits::{CompositorEvent, MouseButton}; -use script_traits::ConstellationControlMsg; -use script_traits::{NewLayoutInfo, OpaqueScriptLayoutChannel}; -use script_traits::{ScriptState, ScriptTaskFactory}; use msg::compositor_msg::{LayerId, ScriptToCompositorMsg}; +use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, FocusType}; -use msg::constellation_msg::{LoadData, PipelineId, SubpageId, MozBrowserEvent, WorkerId}; use msg::constellation_msg::{Failure, WindowSizeData, PipelineExitType}; -use msg::constellation_msg::Msg as ConstellationMsg; +use msg::constellation_msg::{LoadData, PipelineId, SubpageId, MozBrowserEvent, WorkerId}; use msg::webdriver_msg::WebDriverScriptCommand; use net_traits::LoadData as NetLoadData; -use net_traits::{AsyncResponseTarget, ResourceTask, LoadConsumer, ControlMsg, Metadata}; use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageCacheResult}; use net_traits::storage_task::StorageTask; +use net_traits::{AsyncResponseTarget, ResourceTask, LoadConsumer, ControlMsg, Metadata}; use profile_traits::mem::{self, Report, ReportKind, ReportsChan, OpaqueSender}; +use script_traits::CompositorEvent::{MouseDownEvent, MouseUpEvent}; +use script_traits::CompositorEvent::{MouseMoveEvent, KeyEvent}; +use script_traits::CompositorEvent::{ResizeEvent, ClickEvent}; +use script_traits::ConstellationControlMsg; +use script_traits::{CompositorEvent, MouseButton}; +use script_traits::{NewLayoutInfo, OpaqueScriptLayoutChannel}; +use script_traits::{ScriptState, ScriptTaskFactory}; use string_cache::Atom; +use util::opts; use util::str::DOMString; use util::task::spawn_named_with_send_on_failure; use util::task_state; -use util::opts; use euclid::Rect; use euclid::point::Point2D; @@ -86,11 +86,11 @@ use hyper::method::Method; use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::router::ROUTER; use js::glue::CollectServoSizes; -use js::jsapi::{JS_SetWrapObjectCallbacks, JS_AddExtraGCRootsTracer, DisableIncrementalGC}; use js::jsapi::{JSContext, JSRuntime, JSTracer}; +use js::jsapi::{JSGCInvocationKind, GCDescription, SetGCSliceCallback, GCProgress}; use js::jsapi::{JS_GetRuntime, JS_SetGCCallback, JSGCStatus, JSAutoRequest, SetDOMCallbacks}; +use js::jsapi::{JS_SetWrapObjectCallbacks, JS_AddExtraGCRootsTracer, DisableIncrementalGC}; use js::jsapi::{SetDOMProxyInformation, DOMProxyShadowsResult, HandleObject, HandleId, RootedValue}; -use js::jsapi::{JSGCInvocationKind, GCDescription, SetGCSliceCallback, GCProgress}; use js::jsval::UndefinedValue; use js::rust::Runtime; use url::{Url, UrlParser}; @@ -106,8 +106,8 @@ use std::option::Option; use std::ptr; use std::rc::Rc; use std::result::Result; -use std::sync::{Arc, Mutex}; use std::sync::mpsc::{channel, Sender, Receiver, Select}; +use std::sync::{Arc, Mutex}; use time::{self, Tm}; use hyper::header::{ContentType, HttpDate}; diff --git a/components/script/textinput.rs b/components/script/textinput.rs index 5ecf6a4f312..b2c2afdec0f 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -6,8 +6,8 @@ use clipboard_provider::ClipboardProvider; use dom::keyboardevent::{KeyboardEvent, KeyboardEventHelpers, key_value}; -use msg::constellation_msg::{SHIFT, CONTROL, ALT, SUPER}; use msg::constellation_msg::{Key, KeyModifiers}; +use msg::constellation_msg::{SHIFT, CONTROL, ALT, SUPER}; use util::mem::HeapSizeOf; use util::str::{DOMString, slice_chars}; diff --git a/components/script/timers.rs b/components/script/timers.rs index 8cc317f83ac..f18b2231417 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -2,19 +2,19 @@ * 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::callback::ExceptionHandling::Report; +use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::global::global_object_for_js_object; use dom::bindings::utils::Reflectable; use dom::window::ScriptHelpers; -use script_task::{ScriptChan, TimerSource, CommonScriptMsg}; use horribly_inefficient_timers; +use script_task::{ScriptChan, TimerSource, CommonScriptMsg}; use util::mem::HeapSizeOf; -use util::task::spawn_named; use util::str::DOMString; +use util::task::spawn_named; use js::jsapi::{RootedValue, HandleValue, Heap}; use js::jsval::{JSVal, UndefinedValue}; @@ -23,11 +23,11 @@ use std::borrow::ToOwned; use std::cell::Cell; use std::cmp; use std::collections::HashMap; -use std::sync::mpsc::{channel, Sender}; -use std::sync::mpsc::Select; +use std::default::Default; use std::hash::{Hash, Hasher}; use std::rc::Rc; -use std::default::Default; +use std::sync::mpsc::Select; +use std::sync::mpsc::{channel, Sender}; #[derive(JSTraceable, PartialEq, Eq, Copy, Clone, HeapSizeOf)] pub struct TimerId(i32); diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs index 910aadda16d..e25e1fb247c 100644 --- a/components/script/webdriver_handlers.rs +++ b/components/script/webdriver_handlers.rs @@ -2,25 +2,25 @@ * 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::conversions::FromJSValConvertible; -use dom::bindings::conversions::StringificationBehavior; -use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, HTMLIFrameElementCast}; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::ElementBinding::ElementMethods; use dom::bindings::codegen::Bindings::HTMLIFrameElementBinding::HTMLIFrameElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeListBinding::NodeListMethods; +use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, HTMLIFrameElementCast}; +use dom::bindings::conversions::FromJSValConvertible; +use dom::bindings::conversions::StringificationBehavior; use dom::bindings::js::Root; +use dom::document::DocumentHelpers; use dom::node::{Node, NodeHelpers}; use dom::window::{ScriptHelpers, WindowHelpers}; -use dom::document::DocumentHelpers; use js::jsapi::JSContext; -use page::Page; +use js::jsapi::{RootedValue, HandleValue}; +use js::jsval::UndefinedValue; use msg::constellation_msg::{PipelineId, SubpageId}; use msg::webdriver_msg::{WebDriverJSValue, WebDriverJSError, WebDriverJSResult, WebDriverFrameId}; +use page::Page; use script_task::get_page; -use js::jsapi::{RootedValue, HandleValue}; -use js::jsval::UndefinedValue; use ipc_channel::ipc::IpcSender; use std::rc::Rc; diff --git a/components/servo/lib.rs b/components/servo/lib.rs index ae1a42ec92a..e588f49b95a 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -39,14 +39,14 @@ use compositing::windowing::WindowEvent; use compositing::windowing::WindowMethods; use compositing::{CompositorProxy, CompositorTask, Constellation}; -use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::ConstellationChan; +use msg::constellation_msg::Msg as ConstellationMsg; use script::dom::bindings::codegen::RegisterBindings; use net::image_cache_task::new_image_cache_task; -use net::storage_task::StorageTaskFactory; use net::resource_task::new_resource_task; +use net::storage_task::StorageTaskFactory; use net_traits::storage_task::StorageTask; use gfx::font_cache_task::FontCacheTask; diff --git a/components/servo/main.rs b/components/servo/main.rs index ec3bbd9dbc4..e96703026fe 100644 --- a/components/servo/main.rs +++ b/components/servo/main.rs @@ -35,11 +35,11 @@ extern crate env_logger; #[macro_use] extern crate android_glue; -use std::rc::Rc; -use util::opts; +use compositing::windowing::WindowEvent; use net_traits::hosts; use servo::Browser; -use compositing::windowing::WindowEvent; +use std::rc::Rc; +use util::opts; #[cfg(target_os="android")] use std::borrow::ToOwned; @@ -186,13 +186,13 @@ mod android { unsafe impl Send for FilePtr {} fn redirect_output(file_no: c_int) { - use self::libc::funcs::posix88::unistd::{pipe, dup2}; - use self::libc::funcs::posix88::stdio::fdopen; use self::libc::funcs::c95::stdio::fgets; - use util::task::spawn_named; + use self::libc::funcs::posix88::stdio::fdopen; + use self::libc::funcs::posix88::unistd::{pipe, dup2}; + use std::ffi::CStr; use std::ffi::CString; use std::str::from_utf8; - use std::ffi::CStr; + use util::task::spawn_named; unsafe { let mut pipes: [c_int; 2] = [ 0, 0 ]; diff --git a/components/style/animation.rs b/components/style/animation.rs index 438ec1683dd..0608668b171 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -2,28 +2,28 @@ * 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, Color}; use properties::ComputedValues; -use properties::longhands::transition_property::computed_value::TransitionProperty; -use properties::longhands::transition_timing_function::computed_value::{StartEnd}; -use properties::longhands::transition_timing_function::computed_value::{TransitionTimingFunction}; -use properties::longhands::z_index::computed_value::T as ZIndex; -use properties::longhands::visibility::computed_value::T as Visibility; -use properties::longhands::vertical_align::computed_value::T as VerticalAlign; +use properties::longhands::background_position::computed_value::T as BackgroundPosition; use properties::longhands::border_spacing::computed_value::T as BorderSpacing; -use properties::longhands::line_height::computed_value::T as LineHeight; -use properties::longhands::font_weight::computed_value::T as FontWeight; use properties::longhands::clip::computed_value::ClipRect; -use properties::longhands::text_shadow::computed_value::TextShadow; +use properties::longhands::font_weight::computed_value::T as FontWeight; +use properties::longhands::line_height::computed_value::T as LineHeight; use properties::longhands::text_shadow::computed_value::T as TextShadowList; -use properties::longhands::background_position::computed_value::T as BackgroundPosition; -use properties::longhands::transition_property; +use properties::longhands::text_shadow::computed_value::TextShadow; use properties::longhands::transform::computed_value::ComputedMatrix; use properties::longhands::transform::computed_value::ComputedOperation as TransformOperation; use properties::longhands::transform::computed_value::T as TransformList; +use properties::longhands::transition_property; +use properties::longhands::transition_property::computed_value::TransitionProperty; +use properties::longhands::transition_timing_function::computed_value::{StartEnd}; +use properties::longhands::transition_timing_function::computed_value::{TransitionTimingFunction}; +use properties::longhands::vertical_align::computed_value::T as VerticalAlign; +use properties::longhands::visibility::computed_value::T as Visibility; +use properties::longhands::z_index::computed_value::T as ZIndex; +use values::CSSFloat; use values::computed::{Angle, LengthOrPercentageOrAuto, LengthOrPercentageOrNone}; use values::computed::{LengthOrPercentage, Length, Time}; -use values::CSSFloat; -use cssparser::{RGBA, Color}; use euclid::point::Point2D; use std::cmp::Ordering; diff --git a/components/style/build.rs b/components/style/build.rs index 87550d67c2b..40bdc32b062 100644 --- a/components/style/build.rs +++ b/components/style/build.rs @@ -5,8 +5,8 @@ use std::env; use std::fs::File; use std::io::Write; -use std::process::{Command, Stdio, exit}; use std::path::Path; +use std::process::{Command, Stdio, exit}; fn main() { diff --git a/components/style/legacy.rs b/components/style/legacy.rs index c2e37731b89..127d9f8c526 100644 --- a/components/style/legacy.rs +++ b/components/style/legacy.rs @@ -7,11 +7,11 @@ use std::sync::Arc; -use selectors::Element; -use selectors::matching::DeclarationBlock; use node::TElementAttributes; use properties::PropertyDeclaration; use selector_matching::Stylist; +use selectors::Element; +use selectors::matching::DeclarationBlock; use smallvec::VecLike; diff --git a/components/style/media_queries.rs b/components/style/media_queries.rs index 9fa4a921d0f..111354145e6 100644 --- a/components/style/media_queries.rs +++ b/components/style/media_queries.rs @@ -2,8 +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 std::ascii::AsciiExt; use cssparser::{Token, Parser, Delimiter}; +use std::ascii::AsciiExt; use euclid::size::{Size2D, TypedSize2D}; use properties::longhands; diff --git a/components/style/parser.rs b/components/style/parser.rs index 3236d6871cd..ac9afe43cf6 100644 --- a/components/style/parser.rs +++ b/components/style/parser.rs @@ -3,10 +3,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use selectors::parser::ParserContext as SelectorParserContext; use cssparser::{Parser, SourcePosition}; -use url::{Url, UrlParser}; use log; +use selectors::parser::ParserContext as SelectorParserContext; +use url::{Url, UrlParser}; use stylesheets::Origin; diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index bafa23e948b..4ddce63b6d0 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -14,21 +14,21 @@ use std::intrinsics; use std::mem; use std::sync::Arc; -use util::logical_geometry::{LogicalMargin, PhysicalSide, WritingMode}; -use util::geometry::Au; -use url::Url; use cssparser::{Parser, Color, RGBA, AtRuleParser, DeclarationParser, DeclarationListParser, parse_important, ToCss}; -use fnv::FnvHasher; +use url::Url; +use util::geometry::Au; +use util::logical_geometry::{LogicalMargin, PhysicalSide, WritingMode}; use euclid::SideOffsets2D; use euclid::size::Size2D; +use fnv::FnvHasher; -use values::specified::{Length, BorderStyle}; -use values::computed::{self, ToComputedValue}; -use selectors::matching::DeclarationBlock; +use computed_values; use parser::{ParserContext, log_css_error}; +use selectors::matching::DeclarationBlock; use stylesheets::Origin; -use computed_values; +use values::computed::{self, ToComputedValue}; +use values::specified::{Length, BorderStyle}; use self::property_bit_field::PropertyBitField; @@ -128,9 +128,9 @@ pub mod longhands { use properties::longhands; use properties::property_bit_field::PropertyBitField; use properties::{ComputedValues, PropertyDeclaration}; + use std::sync::Arc; use values::computed::ToComputedValue; use values::{computed, specified}; - use std::sync::Arc; ${caller.body()} #[allow(unused_variables)] pub fn cascade_property(declaration: &PropertyDeclaration, @@ -287,10 +287,10 @@ pub mod longhands { % for side in ["top", "right", "bottom", "left"]: <%self:longhand name="border-${side}-width"> - use values::computed::Context; - use util::geometry::Au; use cssparser::ToCss; use std::fmt; + use util::geometry::Au; + use values::computed::Context; impl ToCss for SpecifiedValue { fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { @@ -355,10 +355,10 @@ pub mod longhands { </%self:longhand> <%self:longhand name="outline-width"> - use values::computed::Context; - use util::geometry::Au; use cssparser::ToCss; use std::fmt; + use util::geometry::Au; + use values::computed::Context; impl ToCss for SpecifiedValue { fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { @@ -556,10 +556,10 @@ pub mod longhands { ${switch_to_style_struct("InheritedBox")} <%self:longhand name="line-height"> - use values::computed::Context; use cssparser::ToCss; use std::fmt; use values::CSSFloat; + use values::computed::Context; #[derive(Clone, PartialEq, Copy)] pub enum SpecifiedValue { @@ -581,8 +581,8 @@ pub mod longhands { } /// normal | <number> | <length> | <percentage> pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> { - use std::ascii::AsciiExt; use cssparser::Token; + use std::ascii::AsciiExt; match try!(input.next()) { Token::Number(ref value) if value.value >= 0. => { Ok(SpecifiedValue::Number(value.value)) @@ -601,9 +601,9 @@ pub mod longhands { } } pub mod computed_value { - use values::CSSFloat; - use util::geometry::Au; use std::fmt; + use util::geometry::Au; + use values::CSSFloat; #[derive(PartialEq, Copy, Clone, HeapSizeOf)] pub enum T { Normal, @@ -655,9 +655,9 @@ pub mod longhands { ${switch_to_style_struct("Box")} <%self:longhand name="vertical-align"> - use values::computed::Context; use cssparser::ToCss; use std::fmt; + use values::computed::Context; <% vertical_align_keywords = ( "baseline sub super top text-top middle bottom text-bottom".split()) %> @@ -700,9 +700,9 @@ pub mod longhands { }) } pub mod computed_value { - use values::CSSFloat; - use util::geometry::Au; use std::fmt; + use util::geometry::Au; + use values::CSSFloat; #[allow(non_camel_case_types)] #[derive(PartialEq, Copy, Clone, HeapSizeOf)] pub enum T { @@ -1028,9 +1028,9 @@ pub mod longhands { """)} <%self:longhand name="list-style-image"> - use url::Url; use cssparser::{ToCss, Token}; use std::fmt; + use url::Url; use values::computed::Context; #[derive(Clone, PartialEq, Eq)] @@ -1051,9 +1051,9 @@ pub mod longhands { } pub mod computed_value { - use url::Url; use cssparser::{ToCss, Token}; use std::fmt; + use url::Url; #[derive(Clone, PartialEq, HeapSizeOf)] pub struct T(pub Option<Url>); @@ -1094,9 +1094,9 @@ pub mod longhands { </%self:longhand> <%self:longhand name="quotes"> + use std::borrow::Cow; use std::fmt; use values::computed::ComputedValueAsSpecified; - use std::borrow::Cow; use cssparser::{ToCss, Token}; @@ -1162,8 +1162,8 @@ pub mod longhands { ${new_style_struct("Counters", is_inherited=False)} <%self:longhand name="counter-increment"> - use super::content; use std::fmt; + use super::content; use values::computed::ComputedValueAsSpecified; use cssparser::{ToCss, Token}; @@ -1240,10 +1240,10 @@ pub mod longhands { "::cssparser::Color::RGBA(::cssparser::RGBA { red: 0., green: 0., blue: 0., alpha: 0. }) /* transparent */")} <%self:longhand name="background-image"> - use values::specified::Image; - use values::computed::Context; use cssparser::ToCss; use std::fmt; + use values::computed::Context; + use values::specified::Image; pub mod computed_value { use values::computed; @@ -1563,8 +1563,8 @@ pub mod longhands { <%self:raw_longhand name="color"> use cssparser::{Color, RGBA}; - use values::specified::{CSSColor, CSSRGBA}; use values::computed::Context; + use values::specified::{CSSColor, CSSRGBA}; impl ToComputedValue for SpecifiedValue { type ComputedValue = computed_value::T; @@ -1610,8 +1610,8 @@ pub mod longhands { impl ComputedValueAsSpecified for SpecifiedValue {} pub mod computed_value { use cssparser::ToCss; - use string_cache::Atom; use std::fmt; + use string_cache::Atom; #[derive(PartialEq, Eq, Clone, Hash, HeapSizeOf)] pub enum FontFamily { @@ -1818,10 +1818,10 @@ pub mod longhands { </%self:longhand> <%self:longhand name="font-size"> - use util::geometry::Au; - use values::computed::Context; use cssparser::ToCss; use std::fmt; + use util::geometry::Au; + use values::computed::Context; impl ToCss for SpecifiedValue { fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { @@ -1937,9 +1937,9 @@ pub mod longhands { </%self:longhand> <%self:longhand name="letter-spacing"> - use values::computed::Context; use cssparser::ToCss; use std::fmt; + use values::computed::Context; #[derive(Clone, Copy, PartialEq)] pub enum SpecifiedValue { @@ -1999,9 +1999,9 @@ pub mod longhands { </%self:longhand> <%self:longhand name="word-spacing"> - use values::computed::Context; use cssparser::ToCss; use std::fmt; + use values::computed::Context; #[derive(Clone, Copy, PartialEq)] pub enum SpecifiedValue { @@ -2439,9 +2439,9 @@ pub mod longhands { ${new_style_struct("Column", is_inherited=False)} <%self:longhand name="column-width" experimental="True"> - use values::computed::Context; use cssparser::ToCss; use std::fmt; + use values::computed::Context; #[derive(Clone, Copy, PartialEq)] pub enum SpecifiedValue { @@ -2501,9 +2501,9 @@ pub mod longhands { </%self:longhand> <%self:longhand name="column-count" experimental="True"> - use values::computed::Context; use cssparser::ToCss; use std::fmt; + use values::computed::Context; #[derive(Clone, Copy, PartialEq)] pub enum SpecifiedValue { @@ -2567,9 +2567,9 @@ pub mod longhands { </%self:longhand> <%self:longhand name="column-gap" experimental="True"> - use values::computed::Context; use cssparser::ToCss; use std::fmt; + use values::computed::Context; #[derive(Clone, Copy, PartialEq)] pub enum SpecifiedValue { @@ -2632,10 +2632,10 @@ pub mod longhands { ${new_style_struct("Effects", is_inherited=False)} <%self:longhand name="opacity"> - use values::CSSFloat; - use values::computed::Context; use cssparser::ToCss; use std::fmt; + use values::CSSFloat; + use values::computed::Context; impl ToCss for SpecifiedValue { fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { @@ -2730,9 +2730,9 @@ pub mod longhands { } pub mod computed_value { + use std::fmt; use util::geometry::Au; use values::computed; - use std::fmt; #[derive(Clone, PartialEq, HeapSizeOf)] pub struct T(pub Vec<BoxShadow>); @@ -3243,10 +3243,10 @@ pub mod longhands { <%self:longhand name="filter"> //pub use self::computed_value::T as SpecifiedValue; - use values::specified::{Angle, Length}; - use values::CSSFloat; use cssparser::ToCss; use std::fmt; + use values::CSSFloat; + use values::specified::{Angle, Length}; #[derive(Clone, PartialEq)] pub struct SpecifiedValue(Vec<SpecifiedFilter>); @@ -4862,8 +4862,8 @@ pub mod shorthands { <%self:shorthand name="${name}" sub_properties="${ ' '.join(sub_property_pattern % side for side in ['top', 'right', 'bottom', 'left'])}"> - use values::specified; use super::parse_four_sides; + use values::specified; let _unused = context; let (top, right, bottom, left) = try!(parse_four_sides(input, ${parser_function})); Ok(Longhands { @@ -4976,8 +4976,8 @@ pub mod shorthands { <%self:shorthand name="border-width" sub_properties="${ ' '.join('border-%s-width' % side for side in ['top', 'right', 'bottom', 'left'])}"> - use values::specified; use super::parse_four_sides; + use values::specified; let _unused = context; let (top, right, bottom, left) = try!(parse_four_sides(input, specified::parse_border_width)); Ok(Longhands { @@ -5100,8 +5100,8 @@ pub mod shorthands { </%self:shorthand> <%self:shorthand name="outline" sub_properties="outline-color outline-style outline-width"> - use values::specified; use properties::longhands::outline_width; + use values::specified; let _unused = context; let mut color = None; diff --git a/components/style/selector_matching.rs b/components/style/selector_matching.rs index 666d8753b8c..4cf0f7f2846 100644 --- a/components/style/selector_matching.rs +++ b/components/style/selector_matching.rs @@ -4,15 +4,15 @@ use url::Url; +use selectors::Element; use selectors::bloom::BloomFilter; -use selectors::matching::{SelectorMap, Rule}; use selectors::matching::DeclarationBlock as GenericDeclarationBlock; +use selectors::matching::{SelectorMap, Rule}; use selectors::parser::PseudoElement; -use selectors::Element; -use std::process; use smallvec::VecLike; -use util::resource_files::read_resource_file; +use std::process; use util::opts; +use util::resource_files::read_resource_file; use legacy::PresentationalHintSynthesis; use media_queries::Device; diff --git a/components/style/stylesheets.rs b/components/style/stylesheets.rs index dbc72387853..839f002955e 100644 --- a/components/style/stylesheets.rs +++ b/components/style/stylesheets.rs @@ -12,13 +12,13 @@ use encoding::EncodingRef; use cssparser::{Parser, decode_stylesheet_bytes, QualifiedRuleParser, AtRuleParser}; use cssparser::{RuleListParser, AtRuleType}; -use string_cache::{Atom, Namespace}; -use selectors::parser::{Selector, parse_selector_list}; +use font_face::{FontFaceRule, parse_font_face_block}; +use media_queries::{Device, MediaQueryList, parse_media_query_list}; use parser::{ParserContext, log_css_error}; use properties::{PropertyDeclarationBlock, parse_property_declaration_list}; -use media_queries::{Device, MediaQueryList, parse_media_query_list}; -use font_face::{FontFaceRule, parse_font_face_block}; +use selectors::parser::{Selector, parse_selector_list}; use smallvec::SmallVec; +use string_cache::{Atom, Namespace}; use viewport::ViewportRule; @@ -216,9 +216,9 @@ pub mod rule_filter { //! Specific `CSSRule` variant iterators. use std::marker::PhantomData; - use super::{CSSRule, MediaRule, StyleRule}; use super::super::font_face::FontFaceRule; use super::super::viewport::ViewportRule; + use super::{CSSRule, MediaRule, StyleRule}; macro_rules! rule_filter { ($variant:ident -> $value:ty) => { diff --git a/components/style/values.rs b/components/style/values.rs index 134008c175b..7e5774d9262 100644 --- a/components/style/values.rs +++ b/components/style/values.rs @@ -74,18 +74,18 @@ pub type CSSFloat = f32; pub mod specified { + use cssparser::{self, Token, Parser, ToCss, CssStringWriter}; + use euclid::size::Size2D; + use parser::ParserContext; use std::ascii::AsciiExt; use std::cmp; use std::f32::consts::PI; use std::fmt; use std::fmt::Write; use std::ops::Mul; + use super::CSSFloat; use url::Url; - use cssparser::{self, Token, Parser, ToCss, CssStringWriter}; - use euclid::size::Size2D; - use parser::ParserContext; use util::geometry::Au; - use super::CSSFloat; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum AllowedNumericType { @@ -859,7 +859,7 @@ pub mod specified { pub mod computed { pub use super::specified::{Angle, BorderStyle, Time}; - use super::specified::{AngleOrCorner}; + use super::specified::AngleOrCorner; use super::{specified, CSSFloat}; pub use cssparser::Color as CSSColor; use euclid::size::Size2D; diff --git a/components/style/viewport.rs b/components/style/viewport.rs index 53de7d718ea..15dcac2eefe 100644 --- a/components/style/viewport.rs +++ b/components/style/viewport.rs @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use cssparser::{Parser, DeclarationListParser, AtRuleParser, DeclarationParser, ToCss, parse_important}; -use euclid::size::{Size2D, TypedSize2D}; use euclid::scale_factor::ScaleFactor; +use euclid::size::{Size2D, TypedSize2D}; use parser::{ParserContext, log_css_error}; use properties::longhands; use stylesheets::Origin; @@ -342,8 +342,8 @@ impl ViewportConstraints { rule: &ViewportRule) -> Option<ViewportConstraints> { - use std::cmp; use num::{Float, ToPrimitive}; + use std::cmp; if rule.declarations.is_empty() { return None diff --git a/components/util/cache.rs b/components/util/cache.rs index 86dc1c3af91..fa1e32c9ba6 100644 --- a/components/util/cache.rs +++ b/components/util/cache.rs @@ -2,14 +2,14 @@ * 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 rand; +use rand::Rng; use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::hash_state::DefaultState; -use rand::Rng; +use std::default::Default; use std::hash::{Hash, Hasher, SipHasher}; -use rand; use std::slice::Iter; -use std::default::Default; pub struct HashCache<K, V> { diff --git a/components/util/deque/mod.rs b/components/util/deque/mod.rs index 41329c60195..a1ba1b429a1 100644 --- a/components/util/deque/mod.rs +++ b/components/util/deque/mod.rs @@ -49,15 +49,15 @@ pub use self::Stolen::{Empty, Abort, Data}; -use std::sync::Arc; -use std::rt::heap::{allocate, deallocate}; use std::marker; use std::mem::{forget, align_of, size_of, transmute}; use std::ptr; +use std::rt::heap::{allocate, deallocate}; +use std::sync::Arc; use std::sync::Mutex; -use std::sync::atomic::{AtomicIsize, AtomicPtr}; use std::sync::atomic::Ordering::{Relaxed, SeqCst}; +use std::sync::atomic::{AtomicIsize, AtomicPtr}; // Once the queue is less than 1/K full, then it will be downsized. Note that // the deque requires that this number be less than 2. diff --git a/components/util/geometry.rs b/components/util/geometry.rs index 12be3a64fbc..f25b93420cc 100644 --- a/components/util/geometry.rs +++ b/components/util/geometry.rs @@ -5,14 +5,14 @@ use cssparser::ToCss; use euclid::length::Length; +use euclid::num::Zero; use euclid::point::Point2D; use euclid::rect::Rect; use euclid::size::Size2D; -use euclid::num::Zero; use std::default::Default; -use std::i32; use std::fmt; +use std::i32; use std::ops::{Add, Sub, Neg, Mul, Div, Rem}; use rustc_serialize::{Encoder, Encodable}; diff --git a/components/util/logical_geometry.rs b/components/util/logical_geometry.rs index ff316e49d34..c77f862fbbb 100644 --- a/components/util/logical_geometry.rs +++ b/components/util/logical_geometry.rs @@ -4,8 +4,8 @@ //! Geometry in flow-relative space. -use euclid::{Size2D, Point2D, SideOffsets2D, Rect}; use euclid::num::Zero; +use euclid::{Size2D, Point2D, SideOffsets2D, Rect}; use std::cmp::{min, max}; use std::fmt::{self, Debug, Formatter, Error}; use std::ops::{Add, Sub}; diff --git a/components/util/mem.rs b/components/util/mem.rs index 8619cbf2d5e..f336d22be0e 100644 --- a/components/util/mem.rs +++ b/components/util/mem.rs @@ -9,35 +9,35 @@ use std::cell::{Cell, RefCell}; use std::collections::{HashMap, LinkedList, hash_state}; use std::hash::Hash; use std::mem::{size_of, transmute}; -use std::sync::Arc; use std::rc::Rc; use std::result::Result; +use std::sync::Arc; use azure::azure_hl::Color; use cssparser::Color as CSSParserColor; use cssparser::RGBA; use cursor::Cursor; -use euclid::{Point2D, Rect, SideOffsets2D, Size2D, Matrix2D, Matrix4}; use euclid::length::Length; use euclid::scale_factor::ScaleFactor; +use euclid::{Point2D, Rect, SideOffsets2D, Size2D, Matrix2D, Matrix4}; use geometry::{PagePx, ViewportPx, Au}; use html5ever::tree_builder::QuirksMode; -use layers::geometry::DevicePixel; +use hyper::header::ContentType; +use hyper::http::RawStatus; +use hyper::method::Method; +use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value}; use js::jsapi::Heap; -use js::rust::GCMethods; use js::jsval::JSVal; +use js::rust::GCMethods; +use layers::geometry::DevicePixel; use logical_geometry::WritingMode; +use rand::OsRng; use range::Range; +use selectors::parser::{PseudoElement, Selector, CompoundSelector, SimpleSelector, Combinator}; use str::LengthOrPercentageOrAuto; use string_cache::atom::Atom; use string_cache::namespace::Namespace; use url; -use hyper::method::Method; -use hyper::http::RawStatus; -use hyper::header::ContentType; -use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value}; -use selectors::parser::{PseudoElement, Selector, CompoundSelector, SimpleSelector, Combinator}; -use rand::OsRng; extern { // Get the size of a heap block. diff --git a/components/util/opts.rs b/components/util/opts.rs index 0e11006ab4e..65b40e77b73 100644 --- a/components/util/opts.rs +++ b/components/util/opts.rs @@ -13,8 +13,8 @@ use num_cpus; use std::cmp; use std::default::Default; use std::env; -use std::io::{self, Read, Write}; use std::fs::{File, PathExt}; +use std::io::{self, Read, Write}; use std::path::Path; use std::process; use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT}; diff --git a/components/util/task.rs b/components/util/task.rs index d00f29c1c67..0da712f5d06 100644 --- a/components/util/task.rs +++ b/components/util/task.rs @@ -3,10 +3,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use std::borrow::ToOwned; -use task_state; -use std::thread; use std::sync::mpsc::Sender; +use std::thread; use std::thread::Builder; +use task_state; pub fn spawn_named<F>(name: String, f: F) where F: FnOnce() + Send + 'static diff --git a/components/util/task_state.rs b/components/util/task_state.rs index 0072fb00fb6..0f559b98b4c 100644 --- a/components/util/task_state.rs +++ b/components/util/task_state.rs @@ -49,8 +49,8 @@ task_types! { #[cfg(debug_assertions)] mod imp { - use super::{TaskState, TYPES}; use std::cell::RefCell; + use super::{TaskState, TYPES}; thread_local!(static STATE: RefCell<Option<TaskState>> = RefCell::new(None)); diff --git a/components/util/taskpool.rs b/components/util/taskpool.rs index bd67d819922..04059e00f7e 100644 --- a/components/util/taskpool.rs +++ b/components/util/taskpool.rs @@ -15,10 +15,10 @@ // The only difference is that a normal channel is used instead of a sync_channel. // -use task::spawn_named; use std::boxed::FnBox; -use std::sync::{Arc, Mutex}; use std::sync::mpsc::{channel, Sender, Receiver}; +use std::sync::{Arc, Mutex}; +use task::spawn_named; pub struct TaskPool { tx: Sender<Box<FnBox() + Send + 'static>>, diff --git a/components/util/tid.rs b/components/util/tid.rs index 9a01a19f6ce..a07508cdb2b 100644 --- a/components/util/tid.rs +++ b/components/util/tid.rs @@ -2,9 +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 std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; -use std::rc::Rc; use std::cell::RefCell; +use std::rc::Rc; +use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; static mut next_tid: AtomicUsize = ATOMIC_USIZE_INIT; diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs index 35870e2f0c7..9bb9e14eed0 100644 --- a/components/webdriver_server/lib.rs +++ b/components/webdriver_server/lib.rs @@ -19,26 +19,26 @@ extern crate rustc_serialize; extern crate uuid; extern crate ipc_channel; +use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, LoadData, FrameId, PipelineId}; use msg::constellation_msg::{NavigationDirection, WebDriverCommandMsg}; -use msg::constellation_msg::Msg as ConstellationMsg; use msg::webdriver_msg::{WebDriverFrameId, WebDriverScriptCommand, WebDriverJSError, WebDriverJSResult, LoadStatus}; +use ipc_channel::ipc::{self, IpcSender, IpcReceiver}; use url::Url; -use webdriver::command::{WebDriverMessage, WebDriverCommand}; +use util::task::spawn_named; +use uuid::Uuid; use webdriver::command::{GetParameters, JavascriptCommandParameters, LocatorParameters}; use webdriver::command::{SwitchToFrameParameters, TimeoutsParameters}; +use webdriver::command::{WebDriverMessage, WebDriverCommand}; use webdriver::common::{LocatorStrategy, WebElement}; +use webdriver::error::{WebDriverResult, WebDriverError, ErrorStatus}; use webdriver::response::{WebDriverResponse, NewSessionResponse, ValueResponse}; use webdriver::server::{self, WebDriverHandler, Session}; -use webdriver::error::{WebDriverResult, WebDriverError, ErrorStatus}; -use util::task::spawn_named; -use uuid::Uuid; -use ipc_channel::ipc::{self, IpcSender, IpcReceiver}; -use std::borrow::ToOwned; -use rustc_serialize::json::{Json, ToJson}; use rustc_serialize::base64::{Config, ToBase64, CharacterSet, Newline}; +use rustc_serialize::json::{Json, ToJson}; +use std::borrow::ToOwned; use std::collections::BTreeMap; use std::net::SocketAddr; diff --git a/ports/cef/browser_host.rs b/ports/cef/browser_host.rs index aeb7c4a9e85..1c859b184a1 100644 --- a/ports/cef/browser_host.rs +++ b/ports/cef/browser_host.rs @@ -2,12 +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 browser::{self, ServoCefBrowserExtensions}; use eutil::Downcast; use interfaces::{CefBrowser, CefBrowserHost, CefClient, cef_browser_t, cef_browser_host_t, cef_client_t}; -use types::{cef_mouse_button_type_t, cef_mouse_event, cef_rect_t, cef_key_event, cef_window_handle_t}; -use types::cef_key_event_type_t::{KEYEVENT_CHAR, KEYEVENT_KEYDOWN, KEYEVENT_KEYUP, KEYEVENT_RAWKEYDOWN}; use types::cef_event_flags_t::{EVENTFLAG_ALT_DOWN, EVENTFLAG_CONTROL_DOWN, EVENTFLAG_SHIFT_DOWN}; -use browser::{self, ServoCefBrowserExtensions}; +use types::cef_key_event_type_t::{KEYEVENT_CHAR, KEYEVENT_KEYDOWN, KEYEVENT_KEYUP, KEYEVENT_RAWKEYDOWN}; +use types::{cef_mouse_button_type_t, cef_mouse_event, cef_rect_t, cef_key_event, cef_window_handle_t}; use wrappers::CefWrap; use compositing::windowing::{WindowEvent, MouseWindowEvent}; @@ -17,8 +17,8 @@ use libc::{c_double, c_int}; use msg::constellation_msg::{self, KeyModifiers, KeyState}; use script_traits::MouseButton; use std::cell::{Cell, RefCell}; -use std::mem::transmute; use std::intrinsics; +use std::mem::transmute; pub struct ServoCefBrowserHost { /// A reference to the browser. diff --git a/ports/cef/core.rs b/ports/cef/core.rs index 786bfa4439c..5df87bd0c6f 100644 --- a/ports/cef/core.rs +++ b/ports/cef/core.rs @@ -7,11 +7,11 @@ use interfaces::cef_app_t; use types::{cef_main_args_t, cef_settings_t}; use window::init_window; +use browser; use libc::{c_char, c_int, c_void}; -use util::opts; use std::ffi; use std::str; -use browser; +use util::opts; const MAX_RENDERING_THREADS: usize = 128; diff --git a/ports/cef/frame.rs b/ports/cef/frame.rs index e6a166be121..0eea329f239 100644 --- a/ports/cef/frame.rs +++ b/ports/cef/frame.rs @@ -2,10 +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 browser::ServoCefBrowserExtensions; use eutil::Downcast; use interfaces::{CefBrowser, CefFrame, CefStringVisitor, cef_frame_t, cef_string_visitor_t}; use types::{cef_string_t, cef_string_userfree_t}; -use browser::ServoCefBrowserExtensions; use compositing::windowing::WindowEvent; use std::cell::RefCell; diff --git a/ports/cef/interfaces/cef_origin_whitelist.rs b/ports/cef/interfaces/cef_origin_whitelist.rs index c396bf66e02..7722a83754f 100644 --- a/ports/cef/interfaces/cef_origin_whitelist.rs +++ b/ports/cef/interfaces/cef_origin_whitelist.rs @@ -41,7 +41,3 @@ use interfaces; use types; use wrappers::CefWrap; -use libc; -use std::collections::HashMap; -use std::mem; -use std::ptr; diff --git a/ports/cef/interfaces/cef_parser.rs b/ports/cef/interfaces/cef_parser.rs index c396bf66e02..7722a83754f 100644 --- a/ports/cef/interfaces/cef_parser.rs +++ b/ports/cef/interfaces/cef_parser.rs @@ -41,7 +41,3 @@ use interfaces; use types; use wrappers::CefWrap; -use libc; -use std::collections::HashMap; -use std::mem; -use std::ptr; diff --git a/ports/cef/interfaces/cef_path_util.rs b/ports/cef/interfaces/cef_path_util.rs index c396bf66e02..7722a83754f 100644 --- a/ports/cef/interfaces/cef_path_util.rs +++ b/ports/cef/interfaces/cef_path_util.rs @@ -41,7 +41,3 @@ use interfaces; use types; use wrappers::CefWrap; -use libc; -use std::collections::HashMap; -use std::mem; -use std::ptr; diff --git a/ports/cef/interfaces/cef_process_util.rs b/ports/cef/interfaces/cef_process_util.rs index c396bf66e02..7722a83754f 100644 --- a/ports/cef/interfaces/cef_process_util.rs +++ b/ports/cef/interfaces/cef_process_util.rs @@ -41,7 +41,3 @@ use interfaces; use types; use wrappers::CefWrap; -use libc; -use std::collections::HashMap; -use std::mem; -use std::ptr; diff --git a/ports/cef/string.rs b/ports/cef/string.rs index 6e5324d3f7c..8a1b0df6793 100644 --- a/ports/cef/string.rs +++ b/ports/cef/string.rs @@ -4,16 +4,16 @@ use eutil::slice_to_str; -use libc::{self, size_t, c_int, c_ushort, c_void}; use libc::types::os::arch::c95::wchar_t; +use libc::{self, size_t, c_int, c_ushort, c_void}; use std::char; use std::cmp::Ordering; use std::mem; use std::ptr; use std::slice; use std::string; -use types::{cef_string_utf16_t, cef_string_utf8_t, cef_string_wide_t}; use types::{cef_string_userfree_utf16_t, cef_string_userfree_utf8_t, cef_string_userfree_wide_t}; +use types::{cef_string_utf16_t, cef_string_utf8_t, cef_string_wide_t}; //cef_string diff --git a/ports/cef/window.rs b/ports/cef/window.rs index bc2dde520c3..55b329ea202 100644 --- a/ports/cef/window.rs +++ b/ports/cef/window.rs @@ -28,14 +28,14 @@ use layers::platform::surface::NativeDisplay; use libc::{c_char, c_void}; use msg::constellation_msg::{Key, KeyModifiers}; use net_traits::net_error_list::NetError; -use std::ptr; -use std_url::Url; -use util::cursor::Cursor; -use util::geometry::ScreenPx; use std::cell::RefCell; use std::ffi::CString; +use std::ptr; use std::rc::Rc; use std::sync::mpsc::{Sender, channel}; +use std_url::Url; +use util::cursor::Cursor; +use util::geometry::ScreenPx; #[cfg(target_os="linux")] extern crate x11; #[cfg(target_os="linux")] diff --git a/ports/cef/wrappers.rs b/ports/cef/wrappers.rs index e7fa79b48ad..5c036c99787 100644 --- a/ports/cef/wrappers.rs +++ b/ports/cef/wrappers.rs @@ -2,12 +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 interfaces::{cef_app_t, CefApp, cef_drag_data_t, cef_post_data_element_t, cef_v8value_t, CefPostDataElement}; use interfaces::{CefV8Value}; -use interfaces::{cef_download_handler_t, cef_drag_handler_t, cef_context_menu_handler_t}; +use interfaces::{cef_app_t, CefApp, cef_drag_data_t, cef_post_data_element_t, cef_v8value_t, CefPostDataElement}; use interfaces::{cef_dialog_handler_t, cef_focus_handler_t}; -use interfaces::{cef_load_handler_t, cef_request_handler_t}; +use interfaces::{cef_download_handler_t, cef_drag_handler_t, cef_context_menu_handler_t}; use interfaces::{cef_geolocation_handler_t, cef_jsdialog_handler_t, cef_keyboard_handler_t}; +use interfaces::{cef_load_handler_t, cef_request_handler_t}; use rustc_unicode::str::Utf16Encoder; use types::{cef_base_t, cef_browser_settings_t, CefBrowserSettings, cef_color_model_t}; use types::{cef_context_menu_edit_state_flags_t}; diff --git a/ports/glutin/lib.rs b/ports/glutin/lib.rs index 3aefb344456..00ebba7d517 100644 --- a/ports/glutin/lib.rs +++ b/ports/glutin/lib.rs @@ -26,8 +26,8 @@ extern crate url; use compositing::windowing::WindowEvent; use euclid::scale_factor::ScaleFactor; use std::rc::Rc; -use window::Window; use util::opts; +use window::Window; pub mod window; diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index 5db74cf17f6..9841da934a1 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -12,8 +12,7 @@ use gleam::gl; use glutin; use layers::geometry::DevicePixel; use layers::platform::surface::NativeDisplay; -use msg::constellation_msg; -use msg::constellation_msg::Key; +use msg::constellation_msg::{self, Key}; use net_traits::net_error_list::NetError; use std::rc::Rc; use std::sync::mpsc::{channel, Sender}; diff --git a/ports/gonk/src/input.rs b/ports/gonk/src/input.rs index cbaa1da3aaf..81c6a70c3ed 100644 --- a/ports/gonk/src/input.rs +++ b/ports/gonk/src/input.rs @@ -4,25 +4,20 @@ use script_traits::MouseButton; -use std::path::Path; -use std::mem::size_of; -use std::mem::transmute; -use std::mem::zeroed; -use std::os::unix::io::AsRawFd; use std::fs::File; -use std::thread; -use std::sync::mpsc::Sender; use std::io::Read; +use std::mem::{size_of, transmute, zeroed}; +use std::os::unix::io::AsRawFd; +use std::path::Path; +use std::sync::mpsc::Sender; +use std::thread; use euclid::point::Point2D; use errno::errno; -use libc::c_int; -use libc::c_long; -use libc::time_t; +use libc::{c_int, c_long, time_t}; -use compositing::windowing::WindowEvent; -use compositing::windowing::MouseWindowEvent; +use compositing::windowing::{WindowEvent, MouseWindowEvent}; extern { diff --git a/ports/gonk/src/main.rs b/ports/gonk/src/main.rs index b8306f3a371..8c6053dffab 100644 --- a/ports/gonk/src/main.rs +++ b/ports/gonk/src/main.rs @@ -44,10 +44,10 @@ extern crate env_logger; #[link(name = "stlport")] extern {} -use util::opts; +use compositing::windowing::WindowEvent; use net_traits::hosts; use servo::Browser; -use compositing::windowing::WindowEvent; +use util::opts; use std::env; diff --git a/ports/gonk/src/window.rs b/ports/gonk/src/window.rs index aa1bbfbab69..08589787b90 100644 --- a/ports/gonk/src/window.rs +++ b/ports/gonk/src/window.rs @@ -8,34 +8,32 @@ use compositing::compositor_task::{self, CompositorProxy, CompositorReceiver}; use compositing::windowing::{WindowEvent, WindowMethods}; use euclid::scale_factor::ScaleFactor; use euclid::size::{Size2D, TypedSize2D}; +use gleam::gl; use layers::geometry::DevicePixel; use layers::platform::surface::NativeDisplay; use libc::c_int; use msg::constellation_msg::{Key, KeyModifiers}; use net_traits::net_error_list::NetError; -use std::sync::mpsc::{channel, Sender, Receiver}; -use std::rc::Rc; -use std::mem::transmute; -use std::mem::size_of; -use std::mem::zeroed; -use std::ptr; use std::ffi::CString; +use std::mem::{transmute, size_of, zeroed}; +use std::ptr; +use std::rc::Rc; +use std::sync::mpsc::{channel, Sender, Receiver}; use url::Url; use util::cursor::Cursor; use util::geometry::ScreenPx; -use gleam::gl; +use egl::egl; use egl::egl::EGLConfig; -use egl::egl::EGLDisplay; use egl::egl::EGLContext; +use egl::egl::EGLDisplay; use egl::egl::EGLSurface; use egl::egl::EGLint; -use egl::egl; -use libc::size_t; -use libc::c_void; use libc::c_char; +use libc::c_void; use libc::close; +use libc::size_t; const GRALLOC_USAGE_HW_TEXTURE: c_int = 0x00000100; const GRALLOC_USAGE_HW_RENDER: c_int = 0x00000200; diff --git a/tests/reftest.rs b/tests/reftest.rs index 832868df337..171749ffcd9 100644 --- a/tests/reftest.rs +++ b/tests/reftest.rs @@ -26,8 +26,8 @@ use std::fs::{PathExt, File, walk_dir}; use std::io::{self, Read, Result}; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; -use test::{AutoColor, DynTestName, DynTestFn, TestDesc, TestOpts, TestDescAndFn, ShouldPanic}; use test::run_tests_console; +use test::{AutoColor, DynTestName, DynTestFn, TestDesc, TestOpts, TestDescAndFn, ShouldPanic}; use url::Url; bitflags!( diff --git a/tests/unit/net/data_loader.rs b/tests/unit/net/data_loader.rs index 702083798a5..2c9412f0af4 100644 --- a/tests/unit/net/data_loader.rs +++ b/tests/unit/net/data_loader.rs @@ -16,9 +16,9 @@ fn assert_parse(url: &'static str, content_type: Option<ContentType>, charset: Option<String>, data: Option<Vec<u8>>) { + use net::data_loader::load; use std::sync::mpsc::channel; use url::Url; - use net::data_loader::load; let (start_chan, start_port) = ipc::channel().unwrap(); load(LoadData::new(Url::parse(url).unwrap(), None), Channel(start_chan)); diff --git a/tests/unit/net/hsts.rs b/tests/unit/net/hsts.rs index 561c0b8f448..28dbaf811f4 100644 --- a/tests/unit/net/hsts.rs +++ b/tests/unit/net/hsts.rs @@ -2,15 +2,14 @@ * 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 net::hsts::HSTSList; -use net::hsts::HSTSEntry; -use net_traits::IncludeSubdomains; +use ipc_channel::ipc; +use net::hsts::{HSTSList, HSTSEntry}; use net::hsts::{secure_url, preload_hsts_domains}; use net::resource_task::ResourceManager; -use ipc_channel::ipc; +use net_traits::IncludeSubdomains; use std::sync::mpsc::channel; -use url::Url; use time; +use url::Url; #[test] fn test_add_hsts_entry_to_resource_manager_adds_an_hsts_entry() { diff --git a/tests/unit/net/mime_classifier.rs b/tests/unit/net/mime_classifier.rs index 1772a7eea72..b2e48926901 100644 --- a/tests/unit/net/mime_classifier.rs +++ b/tests/unit/net/mime_classifier.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 net::mime_classifier::as_string_option; +use net::mime_classifier::{Mp4Matcher, MIMEClassifier}; +use std::env; use std::fs::File; use std::io::{self, Read}; -use std::env; use std::path::{self, PathBuf}; -use net::mime_classifier::Mp4Matcher; -use net::mime_classifier::MIMEClassifier; -use net::mime_classifier::as_string_option; fn read_file(path: &path::Path) -> io::Result<Vec<u8>> { let mut file = try!(File::open(path)); diff --git a/tests/unit/net/resource_task.rs b/tests/unit/net/resource_task.rs index 8850f38cff9..0e8e551fe5d 100644 --- a/tests/unit/net/resource_task.rs +++ b/tests/unit/net/resource_task.rs @@ -4,9 +4,8 @@ use ipc_channel::ipc; use net::resource_task::new_resource_task; -use net_traits::{ControlMsg, LoadData, LoadConsumer}; use net_traits::hosts::{parse_hostsfile, host_replacement}; -use net_traits::ProgressMsg; +use net_traits::{ControlMsg, LoadData, LoadConsumer, ProgressMsg}; use std::borrow::ToOwned; use std::collections::HashMap; use std::sync::mpsc::channel; diff --git a/tests/unit/script/textinput.rs b/tests/unit/script/textinput.rs index 4d59ebf2869..aea84946427 100644 --- a/tests/unit/script/textinput.rs +++ b/tests/unit/script/textinput.rs @@ -14,8 +14,8 @@ use msg::constellation_msg::SUPER; #[cfg(not(target_os="macos"))] use msg::constellation_msg::CONTROL; -use script::textinput::{TextInput, Selection, Lines, DeleteDir}; use script::clipboard_provider::DummyClipboardContext; +use script::textinput::{TextInput, Selection, Lines, DeleteDir}; use std::borrow::ToOwned; #[test] diff --git a/tests/unit/style/lib.rs b/tests/unit/style/lib.rs index 7b6c48814bd..7744c802d98 100644 --- a/tests/unit/style/lib.rs +++ b/tests/unit/style/lib.rs @@ -19,8 +19,8 @@ extern crate util; #[cfg(test)] mod viewport; #[cfg(test)] mod writing_modes { - use util::logical_geometry::WritingMode; use style::properties::{INITIAL_VALUES, get_writing_mode}; + use util::logical_geometry::WritingMode; #[test] fn initial_writing_mode_is_empty() { diff --git a/tests/unit/style/media_queries.rs b/tests/unit/style/media_queries.rs index 2f1dd734a7f..5db734362c4 100644 --- a/tests/unit/style/media_queries.rs +++ b/tests/unit/style/media_queries.rs @@ -3,11 +3,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use euclid::size::Size2D; -use style::stylesheets::{Stylesheet, CSSRuleIteratorExt}; -use style::stylesheets::Origin; +use std::borrow::ToOwned; use style::media_queries::*; +use style::stylesheets::{Origin, Stylesheet, CSSRuleIteratorExt}; use style::values::specified; -use std::borrow::ToOwned; use url::Url; use util::geometry::Au; diff --git a/tests/unit/style/stylesheets.rs b/tests/unit/style/stylesheets.rs index 0ea58142fc6..2f1cc1fc3be 100644 --- a/tests/unit/style/stylesheets.rs +++ b/tests/unit/style/stylesheets.rs @@ -2,10 +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 std::sync::Arc; use cssparser; use selectors::parser::*; +use std::borrow::ToOwned; +use std::sync::Arc; use string_cache::Atom; use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, DeclaredValue, longhands}; use style::stylesheets::{CSSRule, StyleRule, Origin, Stylesheet}; diff --git a/tests/unit/style/viewport.rs b/tests/unit/style/viewport.rs index 35a0ac432c3..5cb8cb6c64d 100644 --- a/tests/unit/style/viewport.rs +++ b/tests/unit/style/viewport.rs @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use cssparser::Parser; -use euclid::size::Size2D; use euclid::scale_factor::ScaleFactor; +use euclid::size::Size2D; use style::media_queries::{Device, MediaType}; use style::parser::ParserContext; use style::stylesheets::{Origin, Stylesheet, CSSRuleIteratorExt}; diff --git a/tests/unit/util/logical_geometry.rs b/tests/unit/util/logical_geometry.rs index f27503e2b1b..418e08faf8c 100644 --- a/tests/unit/util/logical_geometry.rs +++ b/tests/unit/util/logical_geometry.rs @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use euclid::{Size2D, Point2D, SideOffsets2D, Rect}; -use util::logical_geometry::{WritingMode, LogicalSize, LogicalPoint, LogicalMargin, LogicalRect}; use util::logical_geometry::{FLAG_RTL, FLAG_VERTICAL, FLAG_VERTICAL_LR, FLAG_SIDEWAYS_LEFT}; +use util::logical_geometry::{WritingMode, LogicalSize, LogicalPoint, LogicalMargin, LogicalRect}; #[cfg(test)] fn modes() -> [WritingMode; 10] { |