diff options
author | UK992 <urbankrajnc92@gmail.com> | 2016-09-08 17:47:32 +0200 |
---|---|---|
committer | UK992 <urbankrajnc92@gmail.com> | 2016-09-09 04:55:19 +0200 |
commit | 93a103ba7306b578841b73a0ecfbccaad8fc78c1 (patch) | |
tree | a8855004b4309212182505b0cf72f116d846c4cb | |
parent | 875981ece592b03bcf06f16b6613ddabfa11133f (diff) | |
download | servo-93a103ba7306b578841b73a0ecfbccaad8fc78c1.tar.gz servo-93a103ba7306b578841b73a0ecfbccaad8fc78c1.zip |
Reorder `use` statements
135 files changed, 400 insertions, 399 deletions
diff --git a/components/canvas/canvas_paint_thread.rs b/components/canvas/canvas_paint_thread.rs index e6093fedb3c..ef084dde9d9 100644 --- a/components/canvas/canvas_paint_thread.rs +++ b/components/canvas/canvas_paint_thread.rs @@ -12,8 +12,8 @@ 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::ipc::IpcSharedMemory; use num_traits::ToPrimitive; use std::borrow::ToOwned; use std::mem; diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 6fc85cb63cb..905d416f99f 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -9,14 +9,14 @@ use compositor_layer::{CompositorData, CompositorLayer, RcCompositorLayer, Wants use compositor_thread::{CompositorProxy, CompositorReceiver}; use compositor_thread::{InitialCompositorState, Msg, RenderListener}; use delayed_composition::DelayedCompositionTimerProxy; +use euclid::{Matrix4D, Point2D, Rect, Size2D}; use euclid::point::TypedPoint2D; use euclid::rect::TypedRect; use euclid::scale_factor::ScaleFactor; use euclid::size::TypedSize2D; -use euclid::{Matrix4D, Point2D, Rect, Size2D}; -use gfx_traits::print_tree::PrintTree; use gfx_traits::{ChromeToPaintMsg, PaintRequest, ScrollPolicy, StackingContextId}; use gfx_traits::{color, Epoch, FrameTreeId, FragmentType, LayerId, LayerKind, LayerProperties}; +use gfx_traits::print_tree::PrintTree; use gleam::gl; use gleam::gl::types::{GLint, GLsizei}; use image::{DynamicImage, ImageFormat, RgbImage}; @@ -33,19 +33,19 @@ use msg::constellation_msg::{LoadData, TraversalDirection, PipelineId}; use msg::constellation_msg::{PipelineIndex, PipelineNamespaceId, WindowSizeType}; use profile_traits::mem::{self, ReportKind, Reporter, ReporterRequest}; use profile_traits::time::{self, ProfilerCategory, profile}; -use script_traits::CompositorEvent::{MouseMoveEvent, MouseButtonEvent, TouchEvent}; use script_traits::{AnimationState, AnimationTickType, ConstellationControlMsg}; use script_traits::{ConstellationMsg, LayoutControlMsg, MouseButton, MouseEventType}; use script_traits::{StackingContextScrollState, TouchpadPressurePhase, TouchEventType}; use script_traits::{TouchId, WindowSizeData}; -use std::collections::hash_map::Entry::{Occupied, Vacant}; +use script_traits::CompositorEvent::{MouseMoveEvent, MouseButtonEvent, TouchEvent}; use std::collections::{HashMap, HashSet}; +use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::fs::File; use std::mem as std_mem; use std::rc::Rc; use std::sync::mpsc::Sender; -use style_traits::viewport::ViewportConstraints; use style_traits::{PagePx, ViewportPx}; +use style_traits::viewport::ViewportConstraints; use surface_map::SurfaceMap; use time::{precise_time_ns, precise_time_s}; use touch::{TouchHandler, TouchAction}; diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index dc0465962ce..85b03dd7e9a 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -5,15 +5,15 @@ //! Abstract windowing methods. The concrete implementations of these can be found in `platform/`. use compositor_thread::{CompositorProxy, CompositorReceiver}; +use euclid::{Point2D, Size2D}; use euclid::point::TypedPoint2D; use euclid::scale_factor::ScaleFactor; use euclid::size::TypedSize2D; -use euclid::{Point2D, Size2D}; use layers::geometry::DevicePixel; use layers::platform::surface::NativeDisplay; use msg::constellation_msg::{Key, KeyModifiers, KeyState}; use net_traits::net_error_list::NetError; -use script_traits::{MouseButton, TouchpadPressurePhase, TouchEventType, TouchId}; +use script_traits::{MouseButton, TouchEventType, TouchId, TouchpadPressurePhase}; use std::fmt::{Debug, Error, Formatter}; use style_traits::cursor::Cursor; use url::Url; @@ -147,8 +147,7 @@ pub trait WindowMethods { /// /// This is part of the windowing system because its implementation often involves OS-specific /// magic to wake the up window's event loop. - fn create_compositor_channel(&self) - -> (Box<CompositorProxy + Send>, Box<CompositorReceiver>); + fn create_compositor_channel(&self) -> (Box<CompositorProxy + Send>, Box<CompositorReceiver>); /// Requests that the window system prepare a composite. Typically this will involve making /// some type of platform-specific graphics context current. Returns true if the composite may diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index db54290bf83..372aa526688 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -29,23 +29,23 @@ use msg::constellation_msg::{FrameId, FrameType, PipelineId}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData}; use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId, TraversalDirection}; use msg::constellation_msg::{SubpageId, WindowSizeType}; +use net_traits::{self, IpcSend, ResourceThreads}; use net_traits::bluetooth_thread::BluetoothMethodMsg; use net_traits::image_cache_thread::ImageCacheThread; use net_traits::storage_thread::StorageThreadMsg; -use net_traits::{self, ResourceThreads, IpcSend}; use offscreen_gl_context::{GLContextAttributes, GLLimits}; use pipeline::{ChildProcess, InitialPipelineState, Pipeline}; use profile_traits::mem; use profile_traits::time; -use rand::{random, Rng, SeedableRng, StdRng}; +use rand::{Rng, SeedableRng, StdRng, random}; use script_traits::{AnimationState, AnimationTickType, CompositorEvent}; use script_traits::{ConstellationControlMsg, ConstellationMsg as FromCompositorMsg}; use script_traits::{DocumentState, LayoutControlMsg}; use script_traits::{IFrameLoadInfo, IFrameSandboxState, TimerEventRequest}; use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory}; -use script_traits::{MozBrowserEvent, MozBrowserErrorType, WebDriverCommandMsg, WindowSizeData}; -use script_traits::{ScopeThings, SWManagerMsg}; -use script_traits::{webdriver_msg, LogEntry, ServiceWorkerMsg}; +use script_traits::{LogEntry, ServiceWorkerMsg, webdriver_msg}; +use script_traits::{MozBrowserErrorType, MozBrowserEvent, WebDriverCommandMsg, WindowSizeData}; +use script_traits::{SWManagerMsg, ScopeThings}; use std::borrow::ToOwned; use std::collections::{HashMap, VecDeque}; use std::io::Error as IOError; @@ -54,7 +54,7 @@ use std::marker::PhantomData; use std::mem::replace; use std::process; use std::sync::Arc; -use std::sync::mpsc::{Sender, channel, Receiver}; +use std::sync::mpsc::{Receiver, Sender, channel}; use std::thread; use std::time::Instant; use style_traits::PagePx; diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index 4725955c3ab..706b918fd62 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -19,13 +19,13 @@ use layers::geometry::DevicePixel; use layout_traits::LayoutThreadFactory; use msg::constellation_msg::{FrameId, FrameType, LoadData, PipelineId}; use msg::constellation_msg::{PipelineNamespaceId, SubpageId}; +use net_traits::{IpcSend, ResourceThreads}; use net_traits::bluetooth_thread::BluetoothMethodMsg; use net_traits::image_cache_thread::ImageCacheThread; -use net_traits::{ResourceThreads, IpcSend}; use profile_traits::mem as profile_mem; use profile_traits::time; use script_traits::{ConstellationControlMsg, InitialScriptState, MozBrowserEvent}; -use script_traits::{LayoutControlMsg, LayoutMsg, NewLayoutInfo, ScriptMsg, SWManagerMsg, SWManagerSenders}; +use script_traits::{LayoutControlMsg, LayoutMsg, NewLayoutInfo, SWManagerMsg, SWManagerSenders, ScriptMsg}; use script_traits::{ScriptThreadFactory, TimerEventRequest, WindowSizeData}; use std::collections::HashMap; use std::env; diff --git a/components/devtools/actors/console.rs b/components/devtools/actors/console.rs index 67eea6f6714..99dd0d62811 100644 --- a/components/devtools/actors/console.rs +++ b/components/devtools/actors/console.rs @@ -9,10 +9,10 @@ use actor::{Actor, ActorMessageStatus, ActorRegistry}; use actors::object::ObjectActor; +use devtools_traits::{CONSOLE_API, CachedConsoleMessageTypes, DevtoolScriptControlMsg, PAGE_ERROR}; use devtools_traits::CachedConsoleMessage; use devtools_traits::EvaluateJSReply::{ActorValue, BooleanValue, StringValue}; use devtools_traits::EvaluateJSReply::{NullValue, NumberValue, VoidValue}; -use devtools_traits::{CONSOLE_API, CachedConsoleMessageTypes, DevtoolScriptControlMsg, PAGE_ERROR}; use ipc_channel::ipc::{self, IpcSender}; use msg::constellation_msg::PipelineId; use protocol::JsonPacketStream; diff --git a/components/devtools/actors/inspector.rs b/components/devtools/actors/inspector.rs index 5e0d4455cc3..aa500699686 100644 --- a/components/devtools/actors/inspector.rs +++ b/components/devtools/actors/inspector.rs @@ -6,9 +6,9 @@ //! (http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/inspector.js). use actor::{Actor, ActorMessageStatus, ActorRegistry}; +use devtools_traits::{ComputedNodeLayout, DevtoolScriptControlMsg, NodeInfo}; use devtools_traits::DevtoolScriptControlMsg::{GetChildren, GetDocumentElement, GetRootNode}; use devtools_traits::DevtoolScriptControlMsg::{GetLayout, ModifyAttribute}; -use devtools_traits::{ComputedNodeLayout, DevtoolScriptControlMsg, NodeInfo}; use ipc_channel::ipc::{self, IpcSender}; use msg::constellation_msg::PipelineId; use protocol::JsonPacketStream; diff --git a/components/devtools/actors/network_event.rs b/components/devtools/actors/network_event.rs index 9281356f7e5..1383a5b24d8 100644 --- a/components/devtools/actors/network_event.rs +++ b/components/devtools/actors/network_event.rs @@ -13,8 +13,8 @@ use devtools_traits::HttpRequest as DevtoolsHttpRequest; use devtools_traits::HttpResponse as DevtoolsHttpResponse; use encoding::all::UTF_8; use encoding::types::{DecoderTrap, Encoding}; -use hyper::header::Headers; use hyper::header::{ContentType, Cookie}; +use hyper::header::Headers; use hyper::http::RawStatus; use hyper::method::Method; use protocol::JsonPacketStream; diff --git a/components/devtools/actors/timeline.rs b/components/devtools/actors/timeline.rs index 5a2297407ca..d52437edbaf 100644 --- a/components/devtools/actors/timeline.rs +++ b/components/devtools/actors/timeline.rs @@ -5,9 +5,9 @@ use actor::{Actor, ActorMessageStatus, ActorRegistry}; use actors::framerate::FramerateActor; use actors::memory::{MemoryActor, TimelineMemoryReply}; +use devtools_traits::{PreciseTime, TimelineMarker, TimelineMarkerType}; use devtools_traits::DevtoolScriptControlMsg; use devtools_traits::DevtoolScriptControlMsg::{DropTimelineMarkers, SetTimelineMarkers}; -use devtools_traits::{PreciseTime, TimelineMarker, TimelineMarkerType}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use msg::constellation_msg::PipelineId; use protocol::JsonPacketStream; diff --git a/components/devtools/lib.rs b/components/devtools/lib.rs index 0ec2a713cde..9917d15d2d5 100644 --- a/components/devtools/lib.rs +++ b/components/devtools/lib.rs @@ -55,8 +55,8 @@ use std::cell::RefCell; use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::net::{Shutdown, TcpListener, TcpStream}; -use std::sync::mpsc::{Receiver, Sender, channel}; use std::sync::{Arc, Mutex}; +use std::sync::mpsc::{Receiver, Sender, channel}; use time::precise_time_ns; use util::thread::spawn_named; diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index 271dca17f1a..0c2cd16b001 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -17,14 +17,14 @@ use app_units::Au; use azure::azure::AzFloat; use azure::azure_hl::Color; +use euclid::{Matrix4D, Point2D, Rect, Size2D}; use euclid::approxeq::ApproxEq; use euclid::num::{One, Zero}; use euclid::rect::TypedRect; use euclid::side_offsets::SideOffsets2D; -use euclid::{Matrix4D, Point2D, Rect, Size2D}; use fnv::FnvHasher; -use gfx_traits::print_tree::PrintTree; use gfx_traits::{LayerId, ScrollPolicy, StackingContextId}; +use gfx_traits::print_tree::PrintTree; use ipc_channel::ipc::IpcSharedMemory; use msg::constellation_msg::PipelineId; use net_traits::image::base::{Image, PixelFormat}; @@ -44,7 +44,7 @@ use style::computed_values::{border_style, filter, image_rendering, mix_blend_mo use style_traits::cursor::Cursor; use text::TextRun; use text::glyph::ByteIndex; -use util::geometry::{self, max_rect, ScreenPx}; +use util::geometry::{self, ScreenPx, max_rect}; use webrender_traits::{self, WebGLContextId}; pub use style::dom::OpaqueNode; diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index 09ccc2e6345..54a85c00376 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -5,6 +5,8 @@ //! Painting of display lists using Moz2D/Azure. use app_units::Au; +use azure::{AzDrawTargetFillGlyphs, struct__AzGlyphBuffer, struct__AzPoint}; +use azure::{AzFloat, struct__AzDrawOptions, struct__AzGlyph}; use azure::azure::AzIntSize; use azure::azure_hl::{AntialiasMode, Color, ColorPattern, CompositionOp}; use azure::azure_hl::{CapStyle, JoinStyle}; @@ -13,11 +15,9 @@ use azure::azure_hl::{Filter, FilterNode, GaussianBlurInput, GradientStop, Linea use azure::azure_hl::{GaussianBlurAttribute, StrokeOptions, SurfaceFormat}; use azure::azure_hl::{Path, PathBuilder, Pattern, PatternRef, SurfacePattern}; use azure::scaled_font::ScaledFont; -use azure::{AzDrawTargetFillGlyphs, struct__AzGlyphBuffer, struct__AzPoint}; -use azure::{AzFloat, struct__AzDrawOptions, struct__AzGlyph}; -use display_list::TextOrientation::{SidewaysLeft, SidewaysRight, Upright}; use display_list::{BLUR_INFLATION_FACTOR, BorderRadii, BoxShadowClipMode, ClippingRegion}; use display_list::{TextDisplayItem, WebRenderImageInfo}; +use display_list::TextOrientation::{SidewaysLeft, SidewaysRight, Upright}; use euclid::matrix2d::Matrix2D; use euclid::point::Point2D; use euclid::rect::{Rect, TypedRect}; @@ -26,16 +26,16 @@ use euclid::side_offsets::SideOffsets2D; use euclid::size::Size2D; use filters; use font_context::FontContext; -use gfx_traits::{color, LayerKind}; +use gfx_traits::{LayerKind, color}; use net_traits::image::base::PixelFormat; use range::Range; -use std::default::Default; use std::{f32, mem, ptr}; +use std::default::Default; use style::computed_values::{border_style, filter, image_rendering, mix_blend_mode}; use style_traits::PagePx; use text::TextRun; use text::glyph::ByteIndex; -use util::geometry::{self, max_rect, ScreenPx}; +use util::geometry::{self, ScreenPx, max_rect}; use util::opts; pub struct PaintContext<'a> { diff --git a/components/gfx/platform/freetype/font.rs b/components/gfx/platform/freetype/font.rs index a51741a6b87..7368ffd8279 100644 --- a/components/gfx/platform/freetype/font.rs +++ b/components/gfx/platform/freetype/font.rs @@ -7,7 +7,6 @@ extern crate freetype; use app_units::Au; use font::{FontHandleMethods, FontMetrics, FontTableMethods}; use font::{FontTableTag, FractionalPixel, GPOS, GSUB, KERN}; -use freetype::freetype::ft_sfnt_os2; use freetype::freetype::{FTErrorMethods, FT_F26Dot6, FT_Face, FT_FaceRec}; use freetype::freetype::{FT_Done_Face, FT_New_Memory_Face}; use freetype::freetype::{FT_Get_Char_Index, FT_Get_Postscript_Name}; @@ -16,12 +15,13 @@ use freetype::freetype::{FT_GlyphSlot, FT_Library, FT_Long, FT_ULong}; use freetype::freetype::{FT_KERNING_DEFAULT, FT_STYLE_FLAG_BOLD, FT_STYLE_FLAG_ITALIC}; use freetype::freetype::{FT_Load_Glyph, FT_Set_Char_Size}; use freetype::freetype::{FT_SizeRec, FT_Size_Metrics, FT_UInt, struct_FT_Vector_}; +use freetype::freetype::ft_sfnt_os2; use freetype::tt_os2::TT_OS2; use libc::c_char; use platform::font_context::FontContextHandle; use platform::font_template::FontTemplateData; -use std::sync::Arc; use std::{mem, ptr}; +use std::sync::Arc; use style::computed_values::{font_stretch, font_weight}; use super::c_str_to_string; use text::glyph::GlyphId; diff --git a/components/gfx/platform/macos/font.rs b/components/gfx/platform/macos/font.rs index 35f6e903103..97def364161 100644 --- a/components/gfx/platform/macos/font.rs +++ b/components/gfx/platform/macos/font.rs @@ -16,15 +16,15 @@ use core_foundation::string::UniChar; use core_graphics::font::CGGlyph; use core_graphics::geometry::CGRect; use core_text::font::CTFont; -use core_text::font_descriptor::kCTFontDefaultOrientation; use core_text::font_descriptor::{SymbolicTraitAccessors, TraitAccessors}; -use font::{FontHandleMethods, FontMetrics, FontTableTag, FontTableMethods, FractionalPixel}; +use core_text::font_descriptor::kCTFontDefaultOrientation; +use font::{FontHandleMethods, FontMetrics, FontTableMethods, FontTableTag, FractionalPixel}; use font::{GPOS, GSUB, KERN}; use platform::font_template::FontTemplateData; use platform::macos::font_context::FontContextHandle; +use std::{fmt, ptr}; use std::ops::Range; use std::sync::Arc; -use std::{fmt, ptr}; use style::computed_values::{font_stretch, font_weight}; use text::glyph::GlyphId; diff --git a/components/gfx/platform/macos/font_template.rs b/components/gfx/platform/macos/font_template.rs index a36b49eebe3..821b8ae5ee0 100644 --- a/components/gfx/platform/macos/font_template.rs +++ b/components/gfx/platform/macos/font_template.rs @@ -7,8 +7,8 @@ use core_graphics::data_provider::CGDataProvider; use core_graphics::font::CGFont; use core_text; use core_text::font::CTFont; -use serde::de::{Error, Visitor}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use serde::de::{Error, Visitor}; use std::borrow::ToOwned; use std::collections::HashMap; use std::fs::File; @@ -144,4 +144,3 @@ impl Deserialize for CachedCTFont { deserializer.deserialize_option(NoneOptionVisitor) } } - diff --git a/components/gfx/text/glyph.rs b/components/gfx/text/glyph.rs index 26b5a5a0ed2..5628547a417 100644 --- a/components/gfx/text/glyph.rs +++ b/components/gfx/text/glyph.rs @@ -7,9 +7,9 @@ use euclid::point::Point2D; use range::{self, EachIndex, Range, RangeIndex}; #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] use simd::u32x4; +use std::{fmt, mem, u16}; use std::cmp::{Ordering, PartialOrd}; use std::vec::Vec; -use std::{fmt, mem, u16}; pub use gfx_traits::ByteIndex; diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs index ba5f281c04d..9f9f1e16751 100644 --- a/components/gfx/text/shaping/harfbuzz.rs +++ b/components/gfx/text/shaping/harfbuzz.rs @@ -8,6 +8,14 @@ use app_units::Au; use euclid::Point2D; use font::{DISABLE_KERNING_SHAPING_FLAG, Font, FontTableMethods, FontTableTag}; use font::{IGNORE_LIGATURES_SHAPING_FLAG, KERN, RTL_FLAG, ShapingOptions}; +use harfbuzz::{HB_DIRECTION_LTR, HB_DIRECTION_RTL, HB_MEMORY_MODE_READONLY}; +use harfbuzz::{hb_blob_create, hb_face_create_for_tables}; +use harfbuzz::{hb_buffer_create, hb_font_destroy}; +use harfbuzz::{hb_buffer_get_glyph_infos, hb_shape}; +use harfbuzz::{hb_buffer_set_direction, hb_buffer_set_script}; +use harfbuzz::{hb_buffer_t, hb_codepoint_t, hb_font_funcs_t}; +use harfbuzz::{hb_face_t, hb_font_t}; +use harfbuzz::{hb_position_t, hb_tag_t}; use harfbuzz::hb_blob_t; use harfbuzz::hb_bool_t; use harfbuzz::hb_buffer_add_utf8; @@ -26,14 +34,6 @@ use harfbuzz::hb_font_set_ppem; use harfbuzz::hb_font_set_scale; use harfbuzz::hb_glyph_info_t; use harfbuzz::hb_glyph_position_t; -use harfbuzz::{HB_DIRECTION_LTR, HB_DIRECTION_RTL, HB_MEMORY_MODE_READONLY}; -use harfbuzz::{hb_blob_create, hb_face_create_for_tables}; -use harfbuzz::{hb_buffer_create, hb_font_destroy}; -use harfbuzz::{hb_buffer_get_glyph_infos, hb_shape}; -use harfbuzz::{hb_buffer_set_direction, hb_buffer_set_script}; -use harfbuzz::{hb_buffer_t, hb_codepoint_t, hb_font_funcs_t}; -use harfbuzz::{hb_face_t, hb_font_t}; -use harfbuzz::{hb_position_t, hb_tag_t}; use libc::{c_char, c_int, c_uint, c_void}; use platform::font::FontTable; use std::{char, cmp, ptr}; diff --git a/components/gfx/text/text_run.rs b/components/gfx/text/text_run.rs index 390f8b5c3d3..a431a124239 100644 --- a/components/gfx/text/text_run.rs +++ b/components/gfx/text/text_run.rs @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use app_units::Au; -use font::ShapingOptions; use font::{Font, FontHandleMethods, FontMetrics, IS_WHITESPACE_SHAPING_FLAG, RunMetrics}; +use font::ShapingOptions; use platform::font_template::FontTemplateData; use range::Range; use std::cell::Cell; diff --git a/components/layout/block.rs b/components/layout/block.rs index 08c30c27aee..2b7f17729df 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -29,26 +29,26 @@ use app_units::{Au, MAX_AU}; use context::{LayoutContext, SharedLayoutContext}; -use display_list_builder::BlockFlowDisplayListBuilding; use display_list_builder::{BorderPaintingMode, DisplayListBuildState, FragmentDisplayListBuilding}; +use display_list_builder::BlockFlowDisplayListBuilding; use euclid::{Point2D, Rect, Size2D}; use floats::{ClearType, FloatKind, Floats, PlacementInfo}; -use flow::IS_ABSOLUTELY_POSITIONED; +use flow::{self, BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonfloatedFlag}; use flow::{BLOCK_POSITION_IS_STATIC, CLEARS_LEFT, CLEARS_RIGHT}; use flow::{CONTAINS_TEXT_OR_REPLACED_FRAGMENTS, INLINE_POSITION_IS_STATIC}; +use flow::{FragmentationContext, NEEDS_LAYER, PreorderFlowTraversal}; use flow::{ImmutableFlowUtils, LateAbsolutePositionInfo, MutableFlowUtils, OpaqueFlow}; -use flow::{NEEDS_LAYER, PreorderFlowTraversal, FragmentationContext}; -use flow::{self, BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonfloatedFlag}; +use flow::IS_ABSOLUTELY_POSITIONED; use flow_list::FlowList; use flow_ref::FlowRef; -use fragment::SpecificFragmentInfo; use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, HAS_LAYER, Overflow}; +use fragment::SpecificFragmentInfo; use gfx::display_list::{ClippingRegion, StackingContext}; -use gfx_traits::print_tree::PrintTree; use gfx_traits::{LayerId, StackingContextId}; +use gfx_traits::print_tree::PrintTree; use layout_debug; -use model::{CollapsibleMargins, MaybeAuto, specified, specified_or_none}; use model::{self, IntrinsicISizes, MarginCollapseInfo}; +use model::{CollapsibleMargins, MaybeAuto, specified, specified_or_none}; use rustc_serialize::{Encodable, Encoder}; use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW}; use std::cmp::{max, min}; diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 55f37bb5f2f..c89d45c966c 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -19,33 +19,33 @@ use context::LayoutContext; use data::{HAS_NEWLY_CONSTRUCTED_FLOW, PrivateLayoutData}; use flex::FlexFlow; use floats::FloatKind; -use flow::{MutableFlowUtils, MutableOwnedFlowUtils, CAN_BE_FRAGMENTED}; use flow::{self, AbsoluteDescendants, IS_ABSOLUTELY_POSITIONED, ImmutableFlowUtils}; +use flow::{CAN_BE_FRAGMENTED, MutableFlowUtils, MutableOwnedFlowUtils}; use flow_ref::{self, FlowRef}; -use fragment::WhitespaceStrippingResult; use fragment::{CanvasFragmentInfo, ImageFragmentInfo, InlineAbsoluteFragmentInfo}; use fragment::{Fragment, GeneratedContentInfo, IframeFragmentInfo}; use fragment::{InlineAbsoluteHypotheticalFragmentInfo, TableColumnFragmentInfo}; use fragment::{InlineBlockFragmentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo}; +use fragment::WhitespaceStrippingResult; use gfx::display_list::OpaqueNode; use inline::{FIRST_FRAGMENT_OF_ELEMENT, InlineFlow, InlineFragmentNodeFlags}; use inline::{InlineFragmentNodeInfo, LAST_FRAGMENT_OF_ELEMENT}; use linked_list::prepend_from; use list_item::{ListItemFlow, ListStyleTypeContent}; -use multicol::{MulticolFlow, MulticolColumnFlow}; +use multicol::{MulticolColumnFlow, MulticolFlow}; use parallel; +use script_layout_interface::{LayoutElementType, LayoutNodeType, is_image_data}; use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, RECONSTRUCT_FLOW, RestyleDamage}; -use script_layout_interface::wrapper_traits::{ThreadSafeLayoutNode, PseudoElementType, ThreadSafeLayoutElement}; -use script_layout_interface::{LayoutNodeType, LayoutElementType, is_image_data}; +use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode}; use std::borrow::ToOwned; use std::collections::LinkedList; use std::marker::PhantomData; use std::mem; use std::sync::Arc; use std::sync::atomic::Ordering; +use style::computed_values::{caption_side, display, empty_cells, float, list_style_position}; use style::computed_values::content::ContentItem; use style::computed_values::position; -use style::computed_values::{caption_side, display, empty_cells, float, list_style_position}; use style::context::SharedStyleContext; use style::properties::{self, ServoComputedValues}; use table::TableFlow; diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index de342475c7f..5c500b1fd48 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -10,26 +10,26 @@ #![deny(unsafe_code)] -use app_units::{Au, AU_PER_PX}; +use app_units::{AU_PER_PX, Au}; use azure::azure_hl::Color; use block::{BlockFlow, BlockStackingContextType}; -use canvas_traits::{CanvasMsg, CanvasData, FromLayoutMsg}; +use canvas_traits::{CanvasData, CanvasMsg, FromLayoutMsg}; use context::SharedLayoutContext; use euclid::{Matrix4D, Point2D, Point3D, Radians, Rect, SideOffsets2D, Size2D}; use flex::FlexFlow; use flow::{BaseFlow, Flow, IS_ABSOLUTELY_POSITIONED}; use flow_ref; -use fragment::SpecificFragmentInfo; use fragment::{CoordinateSystem, Fragment, HAS_LAYER, ImageFragmentInfo, ScannedTextFragmentInfo}; +use fragment::SpecificFragmentInfo; use gfx::display_list::{BLUR_INFLATION_FACTOR, BaseDisplayItem, BorderDisplayItem}; use gfx::display_list::{BorderRadii, BoxShadowClipMode, BoxShadowDisplayItem, ClippingRegion}; use gfx::display_list::{DisplayItem, DisplayItemMetadata, DisplayListSection, GradientDisplayItem}; use gfx::display_list::{GradientStop, IframeDisplayItem, ImageDisplayItem, WebGLDisplayItem}; -use gfx::display_list::{LayeredItem, LayerInfo, LineDisplayItem, OpaqueNode}; +use gfx::display_list::{LayerInfo, LayeredItem, LineDisplayItem, OpaqueNode}; use gfx::display_list::{SolidColorDisplayItem, StackingContext, StackingContextType}; use gfx::display_list::{TextDisplayItem, TextOrientation, WebRenderImageInfo}; use gfx::paint_thread::THREAD_TINT_COLORS; -use gfx_traits::{color, ScrollPolicy, StackingContextId}; +use gfx_traits::{ScrollPolicy, StackingContextId, color}; use inline::{FIRST_FRAGMENT_OF_ELEMENT, InlineFlow, LAST_FRAGMENT_OF_ELEMENT}; use ipc_channel::ipc; use list_item::ListItemFlow; @@ -38,19 +38,19 @@ use net_traits::image::base::PixelFormat; use net_traits::image_cache_thread::UsePlaceholder; use range::Range; use script_layout_interface::restyle_damage::REPAINT; +use std::{cmp, f32}; use std::default::Default; use std::sync::Arc; -use std::{cmp, f32}; -use style::computed_values::filter::Filter; -use style::computed_values::text_shadow::TextShadow; -use style::computed_values::{_servo_overflow_clip_box as overflow_clip_box}; use style::computed_values::{background_attachment, background_clip, background_origin}; use style::computed_values::{background_repeat, background_size, border_style}; use style::computed_values::{cursor, image_rendering, overflow_x, pointer_events, position}; use style::computed_values::{transform, transform_style, visibility}; +use style::computed_values::_servo_overflow_clip_box as overflow_clip_box; +use style::computed_values::filter::Filter; +use style::computed_values::text_shadow::TextShadow; use style::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode}; -use style::properties::style_structs; use style::properties::{self, ServoComputedValues}; +use style::properties::style_structs; use style::values::RGBA; use style::values::computed; use style::values::computed::{LengthOrNone, LengthOrPercentage, LengthOrPercentageOrAuto, LinearGradient}; diff --git a/components/layout/flex.rs b/components/layout/flex.rs index a255b5f1e7d..8ad36bf8d14 100644 --- a/components/layout/flex.rs +++ b/components/layout/flex.rs @@ -26,8 +26,8 @@ use script_layout_interface::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW}; use std::cmp::{max, min}; use std::ops::Range; use std::sync::Arc; -use style::computed_values::border_collapse; use style::computed_values::{align_content, align_self, flex_direction, flex_wrap, justify_content}; +use style::computed_values::border_collapse; use style::context::{SharedStyleContext, StyleContext}; use style::logical_geometry::LogicalSize; use style::properties::ServoComputedValues; diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 1da53b4bd5a..2476e2431da 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -35,8 +35,8 @@ use flow_list::{FlowList, MutFlowListIterator}; use flow_ref::{self, FlowRef, WeakFlowRef}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow, SpecificFragmentInfo}; use gfx::display_list::{ClippingRegion, StackingContext}; -use gfx_traits::print_tree::PrintTree; use gfx_traits::{LayerId, LayerType, StackingContextId}; +use gfx_traits::print_tree::PrintTree; use inline::InlineFlow; use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo}; use multicol::MulticolFlow; @@ -44,12 +44,12 @@ use parallel::FlowParallelInfo; use rustc_serialize::{Encodable, Encoder}; use script_layout_interface::restyle_damage::{RECONSTRUCT_FLOW, REFLOW, REFLOW_OUT_OF_FLOW, REPAINT, RestyleDamage}; use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutNode}; +use std::{fmt, mem, raw}; use std::iter::Zip; use std::slice::IterMut; use std::sync::Arc; use std::sync::atomic::Ordering; -use std::{fmt, mem, raw}; -use style::computed_values::{clear, display, empty_cells, float, position, overflow_x, text_align}; +use style::computed_values::{clear, display, empty_cells, float, overflow_x, position, text_align}; use style::context::SharedStyleContext; use style::dom::TRestyleDamage; use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode}; diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index cbb5dd251b4..0dcdd2930d7 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -38,17 +38,17 @@ use std::collections::LinkedList; use std::fmt; use std::sync::{Arc, Mutex}; use style::arc_ptr_eq; -use style::computed_values::content::ContentItem; use style::computed_values::{border_collapse, box_sizing, clear, color, display, mix_blend_mode}; use style::computed_values::{overflow_wrap, overflow_x, position, text_decoration}; use style::computed_values::{transform_style, vertical_align, white_space, word_break, z_index}; +use style::computed_values::content::ContentItem; use style::context::SharedStyleContext; use style::dom::TRestyleDamage; use style::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode}; use style::properties::ServoComputedValues; use style::str::char_is_whitespace; -use style::values::computed::LengthOrPercentageOrNone; use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto}; +use style::values::computed::LengthOrPercentageOrNone; use text; use text::TextRunScanner; use url::Url; diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs index cb60fe70100..a4c7f4e06fa 100644 --- a/components/layout/generated_content.rs +++ b/components/layout/generated_content.rs @@ -9,8 +9,8 @@ //! as possible. use context::LayoutContext; -use flow::InorderFlowTraversal; use flow::{self, AFFECTS_COUNTERS, Flow, HAS_COUNTER_AFFECTING_CHILDREN, ImmutableFlowUtils}; +use flow::InorderFlowTraversal; use fragment::{Fragment, GeneratedContentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo}; use gfx::display_list::OpaqueNode; use script_layout_interface::restyle_damage::{RESOLVE_GENERATED_CONTENT, RestyleDamage}; @@ -18,8 +18,8 @@ use script_layout_interface::wrapper_traits::PseudoElementType; use smallvec::SmallVec; use std::collections::{HashMap, LinkedList}; use std::sync::Arc; -use style::computed_values::content::ContentItem; use style::computed_values::{display, list_style_type}; +use style::computed_values::content::ContentItem; use style::dom::TRestyleDamage; use style::properties::ServoComputedValues; use text::TextRunScanner; diff --git a/components/layout/inline.rs b/components/layout/inline.rs index ae3de177243..d1d50b22fe4 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -7,16 +7,16 @@ use app_units::Au; use block::AbsoluteAssignBSizesTraversal; use context::{LayoutContext, SharedLayoutContext}; -use display_list_builder::DisplayListBuildState; use display_list_builder::{FragmentDisplayListBuilding, InlineFlowDisplayListBuilding}; +use display_list_builder::DisplayListBuildState; use euclid::{Point2D, Size2D}; use floats::{FloatKind, Floats, PlacementInfo}; -use flow::OpaqueFlow; -use flow::{CONTAINS_TEXT_OR_REPLACED_FRAGMENTS, EarlyAbsolutePositionInfo, MutableFlowUtils}; use flow::{self, BaseFlow, Flow, FlowClass, ForceNonfloatedFlag, IS_ABSOLUTELY_POSITIONED}; +use flow::{CONTAINS_TEXT_OR_REPLACED_FRAGMENTS, EarlyAbsolutePositionInfo, MutableFlowUtils}; +use flow::OpaqueFlow; use flow_ref; -use fragment::SpecificFragmentInfo; use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow}; +use fragment::SpecificFragmentInfo; use gfx::display_list::{OpaqueNode, StackingContext}; use gfx::font::FontMetrics; use gfx::font_context::FontContext; @@ -28,10 +28,10 @@ use range::{Range, RangeIndex}; use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW}; use script_layout_interface::restyle_damage::{REFLOW_OUT_OF_FLOW, RESOLVE_GENERATED_CONTENT}; use script_layout_interface::wrapper_traits::PseudoElementType; +use std::{fmt, i32, isize, mem}; use std::cmp::max; use std::collections::VecDeque; use std::sync::Arc; -use std::{fmt, i32, isize, mem}; use style::arc_ptr_eq; use style::computed_values::{display, overflow_x, position, text_align, text_justify}; use style::computed_values::{text_overflow, vertical_align, white_space}; diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs index f51f56dea31..4616c22ae7a 100644 --- a/components/layout/list_item.rs +++ b/components/layout/list_item.rs @@ -14,8 +14,8 @@ use display_list_builder::{DisplayListBuildState, ListItemFlowDisplayListBuildin use euclid::Point2D; use floats::FloatKind; use flow::{Flow, FlowClass, OpaqueFlow}; -use fragment::Overflow; use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, GeneratedContentInfo}; +use fragment::Overflow; use generated_content; use gfx::display_list::StackingContext; use gfx_traits::StackingContextId; diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs index fcef3b54f98..29e53bf9077 100644 --- a/components/layout/parallel.rs +++ b/components/layout/parallel.rs @@ -15,11 +15,11 @@ use profile_traits::time::{self, TimerMetadata, profile}; use std::mem; use std::sync::atomic::{AtomicIsize, Ordering}; use style::dom::UnsafeNode; -use style::parallel::run_queue_with_custom_work_data_type; use style::parallel::{CHUNK_SIZE, WorkQueueData}; +use style::parallel::run_queue_with_custom_work_data_type; use style::workqueue::{WorkQueue, WorkUnit, WorkerProxy}; -use traversal::AssignBSizes; use traversal::{AssignISizes, BubbleISizes}; +use traversal::AssignBSizes; use util::opts; pub use style::parallel::traverse_dom; diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs index f75768fefe9..2479731c69f 100644 --- a/components/layout/sequential.rs +++ b/components/layout/sequential.rs @@ -9,9 +9,9 @@ use context::{LayoutContext, SharedLayoutContext}; use display_list_builder::DisplayListBuildState; use euclid::point::Point2D; use floats::SpeculatedFloatPlacement; -use flow::IS_ABSOLUTELY_POSITIONED; -use flow::{PostorderFlowTraversal, PreorderFlowTraversal}; use flow::{self, Flow, ImmutableFlowUtils, InorderFlowTraversal, MutableFlowUtils}; +use flow::{PostorderFlowTraversal, PreorderFlowTraversal}; +use flow::IS_ABSOLUTELY_POSITIONED; use fragment::FragmentBorderBoxIterator; use generated_content::ResolveGeneratedContent; use gfx::display_list::{DisplayItem, StackingContext}; diff --git a/components/layout/table.rs b/components/layout/table.rs index a67312d1bc3..7db800c5042 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -31,8 +31,8 @@ use style::logical_geometry::LogicalSize; use style::properties::ServoComputedValues; use style::values::CSSFloat; use style::values::computed::LengthOrPercentageOrAuto; -use table_row::TableRowFlow; use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance}; +use table_row::TableRowFlow; use table_wrapper::TableLayout; /// A table flow corresponded to the table's internal table fragment under a table wrapper flow. diff --git a/components/layout/text.rs b/components/layout/text.rs index 1cfbe0de13d..18d2cbf3c08 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -8,7 +8,7 @@ use app_units::Au; use fragment::{Fragment, REQUIRES_LINE_BREAK_AFTERWARD_IF_WRAPPING_ON_NEWLINES, ScannedTextFlags}; -use fragment::{ScannedTextFragmentInfo, SELECTED, SpecificFragmentInfo, UnscannedTextFragmentInfo}; +use fragment::{SELECTED, ScannedTextFragmentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo}; use gfx::font::{DISABLE_KERNING_SHAPING_FLAG, FontMetrics, IGNORE_LIGATURES_SHAPING_FLAG}; use gfx::font::{RTL_FLAG, RunMetrics, ShapingFlags, ShapingOptions}; use gfx::font_context::FontContext; @@ -23,13 +23,13 @@ use std::borrow::ToOwned; use std::collections::LinkedList; use std::mem; use std::sync::Arc; -use style::computed_values::white_space; use style::computed_values::{line_height, text_orientation, text_rendering, text_transform}; +use style::computed_values::white_space; use style::logical_geometry::{LogicalSize, WritingMode}; use style::properties::ServoComputedValues; use style::properties::style_structs; use unicode_bidi::{is_rtl, process_text}; -use unicode_script::{get_script, Script}; +use unicode_script::{Script, get_script}; /// Returns the concatenated text of a list of unscanned text fragments. fn text(fragments: &LinkedList<Fragment>) -> String { diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index ca35419bc46..f41eeb22011 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -7,8 +7,8 @@ use construct::FlowConstructor; use context::{LayoutContext, SharedLayoutContext}; use display_list_builder::DisplayListBuildState; +use flow::{self, PreorderFlowTraversal}; use flow::{CAN_BE_FRAGMENTED, Flow, ImmutableFlowUtils, PostorderFlowTraversal}; -use flow::{PreorderFlowTraversal, self}; use gfx::display_list::OpaqueNode; use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, REPAINT, RestyleDamage}; use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode}; @@ -16,8 +16,8 @@ use std::mem; use style::context::{LocalStyleContext, SharedStyleContext, StyleContext}; use style::dom::TNode; use style::selector_impl::ServoSelectorImpl; +use style::traversal::{DomTraversalContext, recalc_style_at, remove_from_bloom_filter}; use style::traversal::RestyleResult; -use style::traversal::{DomTraversalContext, remove_from_bloom_filter, recalc_style_at}; use util::opts; use wrapper::{LayoutNodeLayoutData, ThreadSafeLayoutNodeHelpers}; diff --git a/components/layout/webrender_helpers.rs b/components/layout/webrender_helpers.rs index 0c95499f880..c6da8f2d105 100644 --- a/components/layout/webrender_helpers.rs +++ b/components/layout/webrender_helpers.rs @@ -14,8 +14,8 @@ use gfx::display_list::{BorderRadii, BoxShadowClipMode, ClippingRegion}; use gfx::display_list::{DisplayItem, DisplayList, DisplayListTraversal}; use gfx::display_list::{GradientStop, StackingContext, StackingContextType}; use gfx_traits::{FragmentType, ScrollPolicy, StackingContextId}; -use style::computed_values::filter::{self, Filter}; use style::computed_values::{image_rendering, mix_blend_mode}; +use style::computed_values::filter::{self, Filter}; use style::values::computed::BorderStyle; use webrender_traits::{self, AuxiliaryListsBuilder, DisplayListId, PipelineId}; @@ -593,4 +593,3 @@ impl WebRenderFragmentTypeConverter for FragmentType { } } } - diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index bab6d1d8e20..bc90055387e 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -32,8 +32,8 @@ use core::nonzero::NonZero; use data::{LayoutDataFlags, PrivateLayoutData}; -use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode}; use script_layout_interface::{OpaqueStyleAndLayoutData, PartialStyleAndLayoutData}; +use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode}; use style::computed_values::content::{self, ContentItem}; use style::refcell::{Ref, RefCell, RefMut}; diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index d3be538e2b3..fcda0242657 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -57,7 +57,7 @@ use gfx::font; use gfx::font_cache_thread::FontCacheThread; use gfx::font_context; use gfx::paint_thread::LayoutToPaintMsg; -use gfx_traits::{color, Epoch, FragmentType, LayerId, ScrollPolicy, StackingContextId}; +use gfx_traits::{Epoch, FragmentType, LayerId, ScrollPolicy, StackingContextId, color}; use heapsize::HeapSizeOf; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; @@ -70,28 +70,28 @@ use layout::flow_ref::{self, FlowRef}; use layout::incremental::{LayoutDamageComputation, REFLOW_ENTIRE_DOCUMENT}; use layout::layout_debug; use layout::parallel; -use layout::query::process_offset_parent_query; use layout::query::{LayoutRPCImpl, LayoutThreadData, process_content_box_request, process_content_boxes_request}; +use layout::query::{process_margin_style_query, process_node_overflow_request, process_resolved_style_request}; use layout::query::{process_node_geometry_request, process_node_layer_id_request, process_node_scroll_area_request}; -use layout::query::{process_node_overflow_request, process_resolved_style_request, process_margin_style_query}; +use layout::query::process_offset_parent_query; use layout::sequential; use layout::traversal::RecalcStyleAndConstructFlows; use layout::webrender_helpers::{WebRenderDisplayListConverter, WebRenderFrameBuilder}; use layout::wrapper::{LayoutNodeLayoutData, NonOpaqueStyleAndLayoutData}; use layout_traits::LayoutThreadFactory; use msg::constellation_msg::PipelineId; -use net_traits::image_cache_thread::UsePlaceholder; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheResult, ImageCacheThread}; +use net_traits::image_cache_thread::UsePlaceholder; use profile_traits::mem::{self, Report, ReportKind, ReportsChan}; -use profile_traits::time::{TimerMetadataFrameType, TimerMetadataReflowType}; use profile_traits::time::{self, TimerMetadata, profile}; +use profile_traits::time::{TimerMetadataFrameType, TimerMetadataReflowType}; use script::layout_wrapper::{ServoLayoutDocument, ServoLayoutNode}; +use script_layout_interface::{OpaqueStyleAndLayoutData, PartialStyleAndLayoutData}; use script_layout_interface::message::{Msg, NewLayoutThreadInfo, Reflow, ReflowQueryType, ScriptReflow}; use script_layout_interface::reporter::CSSErrorReporter; -use script_layout_interface::restyle_damage::{REPAINT, STORE_OVERFLOW, REFLOW_OUT_OF_FLOW, REFLOW}; +use script_layout_interface::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW, REPAINT, STORE_OVERFLOW}; use script_layout_interface::rpc::{LayoutRPC, MarginStyleResponse, NodeOverflowResponse, OffsetParentResponse}; use script_layout_interface::wrapper_traits::LayoutNode; -use script_layout_interface::{OpaqueStyleAndLayoutData, PartialStyleAndLayoutData}; use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg}; use script_traits::{StackingContextScrollState, UntrustedNodeAddress}; use std::borrow::ToOwned; @@ -99,12 +99,12 @@ use std::collections::HashMap; use std::hash::BuildHasherDefault; use std::ops::{Deref, DerefMut}; use std::process; -use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::mpsc::{channel, Sender, Receiver}; use std::sync::{Arc, Mutex, MutexGuard, RwLock}; +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::mpsc::{Receiver, Sender, channel}; use style::animation::Animation; use style::computed_values::{filter, mix_blend_mode}; -use style::context::{ReflowGoal, LocalStyleContextCreationInfo, SharedStyleContext}; +use style::context::{LocalStyleContextCreationInfo, ReflowGoal, SharedStyleContext}; use style::dom::{TDocument, TElement, TNode}; use style::error_reporting::{ParseErrorReporter, StdoutErrorReporter}; use style::logical_geometry::LogicalPoint; @@ -113,7 +113,7 @@ use style::parallel::WorkQueueData; use style::parser::ParserContextExtraData; use style::refcell::RefCell; use style::selector_matching::Stylist; -use style::stylesheets::{Stylesheet, UserAgentStylesheets, CSSRuleIteratorExt, Origin}; +use style::stylesheets::{CSSRuleIteratorExt, Origin, Stylesheet, UserAgentStylesheets}; use style::thread_state; use style::timer::Timer; use style::workqueue::WorkQueue; diff --git a/components/layout_traits/lib.rs b/components/layout_traits/lib.rs index 5f9fc0d472b..7f8f0f2e64c 100644 --- a/components/layout_traits/lib.rs +++ b/components/layout_traits/lib.rs @@ -25,9 +25,9 @@ use ipc_channel::ipc::{IpcReceiver, IpcSender}; use msg::constellation_msg::PipelineId; use net_traits::image_cache_thread::ImageCacheThread; use profile_traits::{mem, time}; +use script_traits::{ConstellationControlMsg, LayoutControlMsg}; use script_traits::LayoutMsg as ConstellationMsg; -use script_traits::{LayoutControlMsg, ConstellationControlMsg}; -use std::sync::mpsc::{Sender, Receiver}; +use std::sync::mpsc::{Receiver, Sender}; use url::Url; use util::ipc::OptionalIpcSender; diff --git a/components/net/about_loader.rs b/components/net/about_loader.rs index 26ec34d2e6c..21641707a50 100644 --- a/components/net/about_loader.rs +++ b/components/net/about_loader.rs @@ -7,9 +7,9 @@ use hyper::header::ContentType; use hyper::mime::{Mime, SubLevel, TopLevel}; use hyper_serde::Serde; use mime_classifier::MimeClassifier; +use net_traits::{LoadConsumer, LoadData, Metadata, NetworkError}; use net_traits::ProgressMsg::Done; use net_traits::response::HttpsState; -use net_traits::{LoadConsumer, LoadData, Metadata, NetworkError}; use resource_thread::{CancellationListener, send_error, start_sending_sniffed_opt}; use std::io; use std::sync::Arc; diff --git a/components/net/blob_loader.rs b/components/net/blob_loader.rs index 1fe15d9a4a5..1bf931dac32 100644 --- a/components/net/blob_loader.rs +++ b/components/net/blob_loader.rs @@ -3,19 +3,19 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use filemanager_thread::{FileManager, UIProvider}; -use hyper::header::{DispositionType, ContentDisposition, DispositionParam}; -use hyper::header::{Headers, ContentType, ContentLength, Charset}; +use hyper::header::{Charset, ContentLength, ContentType, Headers}; +use hyper::header::{ContentDisposition, DispositionParam, DispositionType}; use hyper_serde::Serde; use ipc_channel::ipc; -use mime::{Mime, Attr}; +use mime::{Attr, Mime}; use mime_classifier::MimeClassifier; -use net_traits::ProgressMsg::{Payload, Done}; +use net_traits::{LoadConsumer, LoadData, Metadata, NetworkError}; +use net_traits::ProgressMsg::{Done, Payload}; use net_traits::blob_url_store::parse_blob_url; use net_traits::filemanager_thread::{FileManagerThreadMsg, ReadFileProgress}; use net_traits::response::HttpsState; -use net_traits::{LoadConsumer, LoadData, Metadata, NetworkError}; +use resource_thread::{send_error, start_sending_sniffed_opt}; use resource_thread::CancellationListener; -use resource_thread::{start_sending_sniffed_opt, send_error}; use std::boxed::FnBox; use std::sync::Arc; use util::thread::spawn_named; diff --git a/components/net/data_loader.rs b/components/net/data_loader.rs index d81cec9a7e0..5380a87f828 100644 --- a/components/net/data_loader.rs +++ b/components/net/data_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 hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use hyper::mime::{Attr, Mime, SubLevel, TopLevel, Value}; use mime_classifier::MimeClassifier; -use net_traits::LoadConsumer; -use net_traits::ProgressMsg::{Payload, Done}; use net_traits::{LoadData, Metadata, NetworkError}; +use net_traits::LoadConsumer; +use net_traits::ProgressMsg::{Done, Payload}; use resource_thread::{CancellationListener, send_error, start_sending_sniffed_opt}; use rustc_serialize::base64::FromBase64; use std::sync::Arc; -use url::percent_encoding::percent_decode; use url::{Position, Url}; +use url::percent_encoding::percent_decode; pub fn factory(load_data: LoadData, senders: LoadConsumer, diff --git a/components/net/file_loader.rs b/components/net/file_loader.rs index 2edc9dfa15d..b9b4c09fffb 100644 --- a/components/net/file_loader.rs +++ b/components/net/file_loader.rs @@ -6,8 +6,8 @@ use about_loader; use mime_classifier::MimeClassifier; use mime_guess::guess_mime_type; use msg::constellation_msg::{PipelineId, ReferrerPolicy}; +use net_traits::{LoadConsumer, LoadData, LoadOrigin, Metadata, NetworkError}; use net_traits::ProgressMsg::{Done, Payload}; -use net_traits::{LoadConsumer, LoadData, Metadata, NetworkError, LoadOrigin}; use resource_thread::{CancellationListener, ProgressSender}; use resource_thread::{send_error, start_sending_sniffed_opt}; use std::borrow::ToOwned; diff --git a/components/net/filemanager_thread.rs b/components/net/filemanager_thread.rs index 8e224d313b2..ac8ad70d1bc 100644 --- a/components/net/filemanager_thread.rs +++ b/components/net/filemanager_thread.rs @@ -5,16 +5,16 @@ use ipc_channel::ipc::IpcSender; use mime_guess::guess_mime_type_opt; use net_traits::blob_url_store::{BlobBuf, BlobURLStoreError}; -use net_traits::filemanager_thread::{FileManagerThreadMsg, FileManagerResult, FilterPattern, FileOrigin}; -use net_traits::filemanager_thread::{SelectedFile, RelativePos, FileManagerThreadError, ReadFileProgress}; +use net_traits::filemanager_thread::{FileManagerResult, FileManagerThreadMsg, FileOrigin, FilterPattern}; +use net_traits::filemanager_thread::{FileManagerThreadError, ReadFileProgress, RelativePos, SelectedFile}; use resource_thread::CancellationListener; use std::collections::HashMap; use std::fs::File; use std::io::{Read, Seek, SeekFrom}; use std::ops::Index; use std::path::{Path, PathBuf}; -use std::sync::atomic::{self, AtomicUsize, AtomicBool, Ordering}; use std::sync::{Arc, RwLock}; +use std::sync::atomic::{self, AtomicBool, AtomicUsize, Ordering}; #[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))] use tinyfiledialogs; use url::Url; diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index a2fd9f87f48..d104521c48b 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -15,8 +15,8 @@ use hsts::{HstsEntry, HstsList, secure_url}; use hyper::Error as HttpError; use hyper::LanguageTag; use hyper::client::{Pool, Request, Response}; -use hyper::header::{Accept, AcceptEncoding, ContentLength, ContentEncoding, ContentType, Host, Referer}; -use hyper::header::{Authorization, AcceptLanguage, Basic}; +use hyper::header::{Accept, AcceptEncoding, ContentEncoding, ContentLength, ContentType, Host, Referer}; +use hyper::header::{AcceptLanguage, Authorization, Basic}; use hyper::header::{Encoding, Header, Headers, Quality, QualityItem}; use hyper::header::{Location, SetCookie, StrictTransportSecurity, UserAgent, qitem}; use hyper::http::RawStatus; @@ -29,16 +29,16 @@ use ipc_channel::ipc::{self, IpcSender}; use log; use mime_classifier::MimeClassifier; use msg::constellation_msg::{PipelineId, ReferrerPolicy}; +use net_traits::{CookieSource, IncludeSubdomains, LoadConsumer, LoadContext, LoadData}; +use net_traits::{CustomResponse, CustomResponseMediator, Metadata, NetworkError}; use net_traits::ProgressMsg::{Done, Payload}; use net_traits::hosts::replace_hosts; use net_traits::response::HttpsState; -use net_traits::{CookieSource, IncludeSubdomains, LoadConsumer, LoadContext, LoadData}; -use net_traits::{Metadata, NetworkError, CustomResponse, CustomResponseMediator}; use openssl; -use openssl::ssl::error::{SslError, OpensslError}; -use profile_traits::time::{ProfilerCategory, profile, ProfilerChan, TimerMetadata}; -use profile_traits::time::{TimerMetadataReflowType, TimerMetadataFrameType}; -use resource_thread::{CancellationListener, send_error, start_sending_sniffed_opt, AuthCache, AuthCacheEntry}; +use openssl::ssl::error::{OpensslError, SslError}; +use profile_traits::time::{ProfilerCategory, ProfilerChan, TimerMetadata, profile}; +use profile_traits::time::{TimerMetadataFrameType, TimerMetadataReflowType}; +use resource_thread::{AuthCache, AuthCacheEntry, CancellationListener, send_error, start_sending_sniffed_opt}; use std::borrow::ToOwned; use std::boxed::FnBox; use std::collections::HashSet; @@ -46,13 +46,13 @@ use std::error::Error; use std::fmt; use std::io::{self, Cursor, Read, Write}; use std::ops::Deref; -use std::sync::mpsc::Sender; use std::sync::{Arc, RwLock}; +use std::sync::mpsc::Sender; use time; use time::Tm; #[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))] use tinyfiledialogs; -use url::{Url, Position}; +use url::{Position, Url}; use util::prefs::PREFS; use util::thread::spawn_named; use uuid; diff --git a/components/net/image_cache_thread.rs b/components/net/image_cache_thread.rs index b18cc22dc01..92c0aa0fd83 100644 --- a/components/net/image_cache_thread.rs +++ b/components/net/image_cache_thread.rs @@ -3,15 +3,15 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use immeta::load_from_buf; -use ipc_channel::ipc::{self, IpcSender, IpcReceiver}; +use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use msg::constellation_msg::{PipelineId, ReferrerPolicy}; -use net_traits::image::base::{Image, ImageMetadata, load_from_memory, PixelFormat}; -use net_traits::image_cache_thread::ImageResponder; +use net_traits::{AsyncResponseTarget, CoreResourceMsg, CoreResourceThread, LoadConsumer, LoadData, LoadOrigin}; +use net_traits::{LoadContext, NetworkError, ResponseAction}; +use net_traits::image::base::{Image, ImageMetadata, PixelFormat, load_from_memory}; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheCommand, ImageCacheThread, ImageState}; use net_traits::image_cache_thread::{ImageCacheResult, ImageOrMetadataAvailable, ImageResponse, UsePlaceholder}; -use net_traits::{AsyncResponseTarget, CoreResourceMsg, LoadConsumer, LoadData, CoreResourceThread, LoadOrigin}; -use net_traits::{ResponseAction, LoadContext, NetworkError}; +use net_traits::image_cache_thread::ImageResponder; use std::borrow::ToOwned; use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; @@ -19,7 +19,7 @@ use std::fs::File; use std::io::{self, Read}; use std::mem; use std::sync::Arc; -use std::sync::mpsc::{Sender, Receiver, channel}; +use std::sync::mpsc::{Receiver, Sender, channel}; use threadpool::ThreadPool; use url::Url; use util::resource_files::resources_dir_path; diff --git a/components/net/resource_thread.rs b/components/net/resource_thread.rs index 89bc5628a66..d04e4d9b4c0 100644 --- a/components/net/resource_thread.rs +++ b/components/net/resource_thread.rs @@ -13,7 +13,7 @@ use cookie_rs; use cookie_storage::CookieStorage; use data_loader; use devtools_traits::DevtoolsControlMsg; -use fetch::methods::{fetch, FetchContext}; +use fetch::methods::{FetchContext, fetch}; use file_loader; use filemanager_thread::{FileManager, TFDProvider}; use hsts::HstsList; @@ -22,19 +22,19 @@ use hyper::client::pool::Pool; use hyper::header::{ContentType, Header, SetCookie}; use hyper::mime::{Mime, SubLevel, TopLevel}; use hyper_serde::Serde; -use ipc_channel::ipc::{self, IpcReceiver, IpcSender, IpcReceiverSet}; +use ipc_channel::ipc::{self, IpcReceiver, IpcReceiverSet, IpcSender}; use mime_classifier::{ApacheBugFlag, MimeClassifier, NoSniffFlag}; +use net_traits::{AsyncResponseTarget, CoreResourceThread, Metadata, ProgressMsg, ResponseAction}; +use net_traits::{CookieSource, CoreResourceMsg, FetchResponseMsg, FetchTaskTarget, LoadConsumer}; +use net_traits::{CustomResponseMediator, LoadData, LoadResponse, NetworkError, ResourceId}; +use net_traits::{ResourceThreads, WebSocketCommunicate, WebSocketConnectData}; use net_traits::LoadContext; use net_traits::ProgressMsg::Done; use net_traits::request::{Request, RequestInit}; use net_traits::storage_thread::StorageThreadMsg; -use net_traits::{AsyncResponseTarget, Metadata, ProgressMsg, ResponseAction, CoreResourceThread}; -use net_traits::{CoreResourceMsg, CookieSource, FetchResponseMsg, FetchTaskTarget, LoadConsumer}; -use net_traits::{LoadData, LoadResponse, NetworkError, ResourceId, CustomResponseMediator}; -use net_traits::{WebSocketCommunicate, WebSocketConnectData, ResourceThreads}; use profile_traits::time::ProfilerChan; -use rustc_serialize::json; use rustc_serialize::{Decodable, Encodable}; +use rustc_serialize::json; use std::borrow::ToOwned; use std::boxed::FnBox; use std::cell::Cell; @@ -45,8 +45,8 @@ use std::io::prelude::*; use std::ops::Deref; use std::path::{Path, PathBuf}; use std::rc::Rc; -use std::sync::mpsc::{Receiver, Sender, channel}; use std::sync::{Arc, RwLock}; +use std::sync::mpsc::{Receiver, Sender, channel}; use storage_thread::StorageThreadFactory; use url::Url; use util::prefs::PREFS; diff --git a/components/net/websocket_loader.rs b/components/net/websocket_loader.rs index d748e309d20..438386eec0e 100644 --- a/components/net/websocket_loader.rs +++ b/components/net/websocket_loader.rs @@ -5,15 +5,16 @@ use cookie_storage::CookieStorage; use http_loader; use hyper::header::Host; +use net_traits::{WebSocketCommunicate, WebSocketConnectData, WebSocketDomAction, WebSocketNetworkEvent}; use net_traits::MessageData; use net_traits::hosts::replace_hosts; use net_traits::unwrap_websocket_protocol; -use net_traits::{WebSocketCommunicate, WebSocketConnectData, WebSocketDomAction, WebSocketNetworkEvent}; use std::ascii::AsciiExt; -use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex, RwLock}; +use std::sync::atomic::{AtomicBool, Ordering}; use std::thread; use util::thread::spawn_named; +use websocket::{Client, Message}; use websocket::client::request::Url; use websocket::header::{Headers, Origin, WebSocketProtocol}; use websocket::message::Type; @@ -24,7 +25,6 @@ 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 websocket::{Client, Message}; /// *Establish a WebSocket Connection* as defined in RFC 6455. fn establish_a_websocket_connection(resource_url: &Url, net_url: (Host, String, bool), diff --git a/components/net_traits/response.rs b/components/net_traits/response.rs index 4305abd4fb6..823c56c7002 100644 --- a/components/net_traits/response.rs +++ b/components/net_traits/response.rs @@ -4,6 +4,7 @@ //! The [Response](https://fetch.spec.whatwg.org/#responses) object //! resulting from a [fetch operation](https://fetch.spec.whatwg.org/#concept-fetch) +use {Metadata, NetworkError}; use hyper::header::{AccessControlExposeHeaders, ContentType, Headers}; use hyper::status::StatusCode; use hyper_serde::Serde; @@ -11,7 +12,6 @@ use std::ascii::AsciiExt; use std::cell::{Cell, RefCell}; use std::sync::{Arc, Mutex}; use url::Url; -use {Metadata, NetworkError}; /// [Response type](https://fetch.spec.whatwg.org/#concept-response-type) #[derive(Clone, PartialEq, Copy, Debug, Deserialize, Serialize, HeapSizeOf)] diff --git a/components/plugins/utils.rs b/components/plugins/utils.rs index 3b96bedd0f1..186236aa458 100644 --- a/components/plugins/utils.rs +++ b/components/plugins/utils.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 rustc::hir::def_id::DefId; use rustc::hir::{self, def}; +use rustc::hir::def_id::DefId; use rustc::lint::{LateContext, LintContext}; use syntax::ast; use syntax::attr::mark_used; diff --git a/components/profile/mem.rs b/components/profile/mem.rs index d1d2ca26b20..b27ceeb898f 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::ReportsChan; use profile_traits::mem::{ProfilerChan, ProfilerMsg, ReportKind, Reporter, ReporterRequest}; +use profile_traits::mem::ReportsChan; use std::borrow::ToOwned; use std::cmp::Ordering; use std::collections::HashMap; diff --git a/components/profile/time.rs b/components/profile/time.rs index e6cb6d45f59..e3a550322c0 100644 --- a/components/profile/time.rs +++ b/components/profile/time.rs @@ -8,7 +8,8 @@ use heartbeats; use ipc_channel::ipc::{self, IpcReceiver}; use profile_traits::energy::{energy_interval_ms, read_energy_uj}; use profile_traits::time::{ProfilerCategory, ProfilerChan, ProfilerMsg, TimerMetadata}; -use profile_traits::time::{TimerMetadataReflowType, TimerMetadataFrameType}; +use profile_traits::time::{TimerMetadataFrameType, TimerMetadataReflowType}; +use std::{f64, thread, u32, u64}; use std::borrow::ToOwned; use std::cmp::Ordering; use std::collections::BTreeMap; @@ -19,7 +20,6 @@ use std::io::{self, Write}; use std::path; use std::path::Path; use std::time::Duration; -use std::{f64, thread, u32, u64}; use std_time::precise_time_ns; use trace_dump::TraceDump; use util::opts::OutputOptions; diff --git a/components/script/devtools.rs b/components/script/devtools.rs index 8f08cab9701..d515d1fb99a 100644 --- a/components/script/devtools.rs +++ b/components/script/devtools.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 devtools_traits::TimelineMarkerType; use devtools_traits::{AutoMargins, CONSOLE_API, CachedConsoleMessage, CachedConsoleMessageTypes}; use devtools_traits::{ComputedNodeLayout, ConsoleAPI, PageError, ScriptToDevtoolsControlMsg}; use devtools_traits::{EvaluateJSReply, Modification, NodeInfo, PAGE_ERROR, TimelineMarker}; +use devtools_traits::TimelineMarkerType; use dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods; use dom::bindings::codegen::Bindings::DOMRectBinding::DOMRectMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; @@ -28,9 +28,10 @@ use js::jsval::UndefinedValue; use msg::constellation_msg::PipelineId; use std::ffi::CStr; use std::str; -use style::properties::longhands::{margin_top, margin_right, margin_bottom, margin_left}; +use style::properties::longhands::{margin_bottom, margin_left, margin_right, margin_top}; use uuid::Uuid; + #[allow(unsafe_code)] pub fn handle_evaluate_js(global: &GlobalRef, eval: String, reply: IpcSender<EvaluateJSReply>) { // global.get_cx() returns a valid `JSContext` pointer, so this is safe. diff --git a/components/script/dom/bindings/callback.rs b/components/script/dom/bindings/callback.rs index 7b837df1fed..7e6bb3534fb 100644 --- a/components/script/dom/bindings/callback.rs +++ b/components/script/dom/bindings/callback.rs @@ -7,12 +7,12 @@ use dom::bindings::error::{Error, Fallible, report_pending_exception}; use dom::bindings::global::global_root_from_object; use dom::bindings::reflector::Reflectable; -use js::jsapi::GetGlobalForObjectCrossCompartment; -use js::jsapi::JSAutoCompartment; -use js::jsapi::JS_GetProperty; use js::jsapi::{Heap, MutableHandleObject, RootedObject}; use js::jsapi::{IsCallable, JSContext, JSObject, JS_WrapObject}; use js::jsapi::{JSCompartment, JS_EnterCompartment, JS_LeaveCompartment}; +use js::jsapi::GetGlobalForObjectCrossCompartment; +use js::jsapi::JSAutoCompartment; +use js::jsapi::JS_GetProperty; use js::jsval::{JSVal, UndefinedValue}; use js::rust::RootedGuard; use std::default::Default; diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index 88ed079d2ba..c9cbeb09f21 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -6,8 +6,8 @@ use dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods; use dom::bindings::codegen::PrototypeList::proto_id_to_name; -use dom::bindings::conversions::root_from_object; use dom::bindings::conversions::{ConversionResult, FromJSValConvertible, ToJSValConvertible}; +use dom::bindings::conversions::root_from_object; use dom::bindings::global::{GlobalRef, global_root_from_context}; use dom::bindings::str::USVString; use dom::domexception::{DOMErrorName, DOMException}; diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs index 54efb11250d..118f04a3c7d 100644 --- a/components/script/dom/bindings/global.rs +++ b/components/script/dom/bindings/global.rs @@ -16,15 +16,15 @@ use dom::bindings::reflector::{Reflectable, Reflector}; use dom::window::{self, ScriptHelpers}; use dom::workerglobalscope::WorkerGlobalScope; use ipc_channel::ipc::IpcSender; -use js::jsapi::HandleValue; +use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL}; use js::jsapi::{CurrentGlobalOrNull, GetGlobalForObjectCrossCompartment}; use js::jsapi::{JSContext, JSObject, JS_GetClass, MutableHandleValue}; -use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL}; +use js::jsapi::HandleValue; use msg::constellation_msg::PipelineId; -use net_traits::{ResourceThreads, CoreResourceThread, IpcSend}; +use net_traits::{CoreResourceThread, IpcSend, ResourceThreads}; use profile_traits::{mem, time}; use script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort}; -use script_thread::{MainThreadScriptChan, ScriptThread, RunnableWrapper}; +use script_thread::{MainThreadScriptChan, RunnableWrapper, ScriptThread}; use script_traits::{MsDuration, ScriptMsg as ConstellationMsg, TimerEventRequest}; use task_source::dom_manipulation::DOMManipulationTaskSource; use task_source::file_reading::FileReadingTaskSource; diff --git a/components/script/dom/bindings/inheritance.rs b/components/script/dom/bindings/inheritance.rs index c9ccdbd0325..f4f1274ac6e 100644 --- a/components/script/dom/bindings/inheritance.rs +++ b/components/script/dom/bindings/inheritance.rs @@ -6,8 +6,8 @@ pub use dom::bindings::codegen::InheritTypes::*; -use dom::bindings::conversions::get_dom_class; use dom::bindings::conversions::{DerivedFrom, IDLInterface}; +use dom::bindings::conversions::get_dom_class; use dom::bindings::reflector::Reflectable; use std::mem; diff --git a/components/script/dom/bindings/proxyhandler.rs b/components/script/dom/bindings/proxyhandler.rs index a5be8f1dc96..cacac064376 100644 --- a/components/script/dom/bindings/proxyhandler.rs +++ b/components/script/dom/bindings/proxyhandler.rs @@ -8,21 +8,22 @@ use dom::bindings::conversions::is_dom_proxy; use dom::bindings::utils::delete_property_by_id; +use js::glue::{GetProxyHandler, GetProxyHandlerFamily, SetProxyExtra}; use js::glue::GetProxyExtra; use js::glue::InvokeGetOwnPropertyDescriptor; -use js::glue::{GetProxyHandler, SetProxyExtra, GetProxyHandlerFamily}; +use js::jsapi::{DOMProxyShadowsResult, JSContext, JSObject, JSPROP_GETTER, PropertyDescriptor}; +use js::jsapi::{Handle, HandleId, HandleObject, MutableHandle, ObjectOpResult}; +use js::jsapi::{JSErrNum, JS_AlreadyHasOwnPropertyById, JS_StrictPropertyStub}; +use js::jsapi::{JS_DefinePropertyById, JS_NewObjectWithGivenProto, SetDOMProxyInformation}; use js::jsapi::GetObjectProto; use js::jsapi::GetStaticPrototype; use js::jsapi::JS_GetPropertyDescriptorById; use js::jsapi::MutableHandleObject; -use js::jsapi::{Handle, HandleId, HandleObject, MutableHandle, ObjectOpResult}; -use js::jsapi::{JSContext, JSObject, JSPROP_GETTER, PropertyDescriptor, DOMProxyShadowsResult}; -use js::jsapi::{JSErrNum, JS_StrictPropertyStub, JS_AlreadyHasOwnPropertyById}; -use js::jsapi::{JS_DefinePropertyById, JS_NewObjectWithGivenProto, SetDOMProxyInformation}; use js::jsval::ObjectValue; use libc; use std::{mem, ptr}; + static JSPROXYSLOT_EXPANDO: u32 = 0; /// Determine if this id shadows any existing properties for this proxy. diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 49a27d3271a..76e6bb2074d 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -53,19 +53,19 @@ use hyper::mime::Mime; use hyper::status::StatusCode; use ipc_channel::ipc::{IpcReceiver, IpcSender}; use js::glue::{CallObjectTracer, CallUnbarrieredObjectTracer, CallValueTracer}; -use js::jsapi::{GCTraceKindToAscii, Heap, TraceKind, JSObject, JSTracer}; +use js::jsapi::{GCTraceKindToAscii, Heap, JSObject, JSTracer, TraceKind}; use js::jsval::JSVal; use js::rust::Runtime; use libc; -use msg::constellation_msg::{FrameType, PipelineId, SubpageId, WindowSizeType, ReferrerPolicy}; +use msg::constellation_msg::{FrameType, PipelineId, ReferrerPolicy, SubpageId, WindowSizeType}; +use net_traits::{Metadata, NetworkError, ResourceThreads}; use net_traits::filemanager_thread::RelativePos; use net_traits::image::base::{Image, ImageMetadata}; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread}; use net_traits::request::Request; -use net_traits::response::HttpsState; use net_traits::response::{Response, ResponseBody}; +use net_traits::response::HttpsState; use net_traits::storage_thread::StorageType; -use net_traits::{Metadata, NetworkError, ResourceThreads}; use offscreen_gl_context::GLLimits; use profile_traits::mem::ProfilerChan as MemProfilerChan; use profile_traits::time::ProfilerChan as TimeProfilerChan; @@ -93,7 +93,7 @@ use style::attr::{AttrIdentifier, AttrValue, LengthOrPercentageOrAuto}; use style::domrefcell::DOMRefCell; use style::element_state::*; use style::properties::PropertyDeclarationBlock; -use style::selector_impl::{PseudoElement, ElementSnapshot}; +use style::selector_impl::{ElementSnapshot, PseudoElement}; use style::values::specified::Length; use time::Duration; use url::Origin as UrlOrigin; diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index 0e513081e10..78990f40564 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -14,9 +14,9 @@ use dom::bindings::str::DOMString; use encoding::all::UTF_8; use encoding::types::{EncoderTrap, Encoding}; use ipc_channel::ipc; -use net_traits::blob_url_store::{BlobBuf, get_blob_origin}; -use net_traits::filemanager_thread::{FileManagerThreadMsg, RelativePos, ReadFileProgress}; use net_traits::{CoreResourceMsg, IpcSend}; +use net_traits::blob_url_store::{BlobBuf, get_blob_origin}; +use net_traits::filemanager_thread::{FileManagerThreadMsg, ReadFileProgress, RelativePos}; use std::cell::Cell; use std::mem; use std::ops::Index; diff --git a/components/script/dom/bluetooth.rs b/components/script/dom/bluetooth.rs index c86fa0150a3..6540f6c971f 100644 --- a/components/script/dom/bluetooth.rs +++ b/components/script/dom/bluetooth.rs @@ -5,8 +5,8 @@ use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted}; use core::clone::Clone; use dom::bindings::codegen::Bindings::BluetoothBinding; +use dom::bindings::codegen::Bindings::BluetoothBinding::{BluetoothMethods, BluetoothScanFilter}; use dom::bindings::codegen::Bindings::BluetoothBinding::RequestDeviceOptions; -use dom::bindings::codegen::Bindings::BluetoothBinding::{BluetoothScanFilter, BluetoothMethods}; use dom::bindings::error::Error::{self, Security, Type}; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; diff --git a/components/script/dom/bluetoothremotegattcharacteristic.rs b/components/script/dom/bluetoothremotegattcharacteristic.rs index 0c27097625c..c88463920e6 100644 --- a/components/script/dom/bluetoothremotegattcharacteristic.rs +++ b/components/script/dom/bluetoothremotegattcharacteristic.rs @@ -12,8 +12,8 @@ use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding:: BluetoothRemoteGATTCharacteristicMethods; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods; +use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::Error::{self, InvalidModification, Network, NotSupported, Security}; -use dom::bindings::error::{Fallible, ErrorResult}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, MutHeap, Root}; use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object}; diff --git a/components/script/dom/bluetoothremotegattdescriptor.rs b/components/script/dom/bluetoothremotegattdescriptor.rs index 0ba52181b48..a726de42974 100644 --- a/components/script/dom/bluetoothremotegattdescriptor.rs +++ b/components/script/dom/bluetoothremotegattdescriptor.rs @@ -11,8 +11,8 @@ use dom::bindings::codegen::Bindings::BluetoothRemoteGATTDescriptorBinding; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTDescriptorBinding::BluetoothRemoteGATTDescriptorMethods; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods; +use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::Error::{self, InvalidModification, Network, Security}; -use dom::bindings::error::{Fallible, ErrorResult}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, MutHeap, Root}; use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object}; diff --git a/components/script/dom/bluetoothremotegattserver.rs b/components/script/dom/bluetoothremotegattserver.rs index f4b1e532f10..615094623e9 100644 --- a/components/script/dom/bluetoothremotegattserver.rs +++ b/components/script/dom/bluetoothremotegattserver.rs @@ -6,8 +6,8 @@ use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted}; use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods; +use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::Error::{self, Security}; -use dom::bindings::error::{Fallible, ErrorResult}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, MutHeap, Root}; use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object}; diff --git a/components/script/dom/canvasgradient.rs b/components/script/dom/canvasgradient.rs index f47589b60af..a805b485796 100644 --- a/components/script/dom/canvasgradient.rs +++ b/components/script/dom/canvasgradient.rs @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use canvas_traits::{CanvasGradientStop, FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle}; -use cssparser::Color as CSSColor; use cssparser::{Parser, RGBA}; +use cssparser::Color as CSSColor; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::CanvasGradientBinding; use dom::bindings::codegen::Bindings::CanvasGradientBinding::CanvasGradientMethods; diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index 61cc2520165..13610c53487 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -6,8 +6,8 @@ use canvas_traits::{Canvas2dMsg, CanvasCommonMsg, CanvasMsg}; use canvas_traits::{CompositionOrBlending, FillOrStrokeStyle, FillRule}; use canvas_traits::{LineCapStyle, LineJoinStyle, LinearGradientStyle}; use canvas_traits::{RadialGradientStyle, RepetitionStyle, byte_swap, byte_swap_and_premultiply}; -use cssparser::Color as CSSColor; use cssparser::{Parser, RGBA}; +use cssparser::Color as CSSColor; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods; use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding; @@ -19,7 +19,7 @@ use dom::bindings::codegen::Bindings::ImageDataBinding::ImageDataMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::codegen::UnionTypes::HTMLImageElementOrHTMLCanvasElementOrCanvasRenderingContext2D; use dom::bindings::codegen::UnionTypes::StringOrCanvasGradientOrCanvasPattern; -use dom::bindings::error::{Error, Fallible, ErrorResult}; +use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; use dom::bindings::js::{JS, LayoutJS, Root}; @@ -42,9 +42,9 @@ use net_traits::image::base::PixelFormat; use net_traits::image_cache_thread::ImageResponse; use num_traits::ToPrimitive; use script_traits::ScriptMsg as ConstellationMsg; +use std::{cmp, fmt}; use std::cell::Cell; use std::str::FromStr; -use std::{cmp, fmt}; use unpremultiplytable::UNPREMULTIPLY_TABLE; use url::Url; use util::opts; diff --git a/components/script/dom/client.rs b/components/script/dom/client.rs index 1039ff1a04a..d800d6f55e0 100644 --- a/components/script/dom/client.rs +++ b/components/script/dom/client.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::Bindings::ClientBinding::FrameType; use dom::bindings::codegen::Bindings::ClientBinding::{ClientMethods, Wrap}; +use dom::bindings::codegen::Bindings::ClientBinding::FrameType; use dom::bindings::global::GlobalRef; use dom::bindings::js::JS; use dom::bindings::js::Root; diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs index d537d8f3fd3..1c583fffcc8 100644 --- a/components/script/dom/dedicatedworkerglobalscope.rs +++ b/components/script/dom/dedicatedworkerglobalscope.rs @@ -4,7 +4,7 @@ use devtools; use devtools_traits::DevtoolScriptControlMsg; -use dom::abstractworker::{WorkerScriptMsg, SharedRt , SimpleWorkerErrorHandler}; +use dom::abstractworker::{SharedRt, SimpleWorkerErrorHandler, WorkerScriptMsg}; use dom::abstractworkerglobalscope::{SendableWorkerScriptChan, WorkerThreadWorkerChan}; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::DedicatedWorkerGlobalScopeBinding; @@ -27,15 +27,15 @@ use js::jsapi::{JSAutoCompartment, JSContext}; use js::jsval::UndefinedValue; use js::rust::Runtime; use msg::constellation_msg::PipelineId; -use net_traits::{LoadContext, load_whole_resource, IpcSend}; +use net_traits::{IpcSend, LoadContext, load_whole_resource}; use rand::random; -use script_runtime::ScriptThreadEventCategory::WorkerEvent; use script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort, StackRootTLS, get_reports, new_rt_and_cx}; -use script_traits::{TimerEvent, TimerSource, WorkerScriptLoadOrigin, WorkerGlobalScopeInit}; +use script_runtime::ScriptThreadEventCategory::WorkerEvent; +use script_traits::{TimerEvent, TimerSource, WorkerGlobalScopeInit, WorkerScriptLoadOrigin}; use std::mem::replace; +use std::sync::{Arc, Mutex}; use std::sync::atomic::AtomicBool; use std::sync::mpsc::{Receiver, RecvError, Select, Sender, channel}; -use std::sync::{Arc, Mutex}; use style::thread_state; use url::Url; use util::thread::spawn_named; diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 4322e348c92..1d58c60222a 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -23,14 +23,14 @@ use dom::bindings::codegen::UnionTypes::NodeOrString; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::{Castable, ElementTypeId, HTMLElementTypeId, NodeTypeId}; -use dom::bindings::js::RootedReference; use dom::bindings::js::{JS, LayoutJS, MutNullableHeap, Root}; +use dom::bindings::js::RootedReference; use dom::bindings::num::Finite; use dom::bindings::refcounted::Trusted; use dom::bindings::reflector::{Reflectable, reflect_dom_object}; use dom::bindings::str::{DOMString, USVString}; +use dom::bindings::xmlname::{namespace_from_domstring, validate_and_extract, xml_name_type}; use dom::bindings::xmlname::XMLName::InvalidXMLName; -use dom::bindings::xmlname::{validate_and_extract, namespace_from_domstring, xml_name_type}; use dom::browsingcontext::BrowsingContext; use dom::closeevent::CloseEvent; use dom::comment::Comment; @@ -90,24 +90,24 @@ use encoding::all::UTF_8; use euclid::point::Point2D; use html5ever::tree_builder::{LimitedQuirks, NoQuirks, Quirks, QuirksMode}; use ipc_channel::ipc::{self, IpcSender}; -use js::jsapi::JS_GetRuntime; use js::jsapi::{JSContext, JSObject, JSRuntime}; +use js::jsapi::JS_GetRuntime; use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER}; use msg::constellation_msg::{Key, KeyModifiers, KeyState}; use msg::constellation_msg::{PipelineId, ReferrerPolicy, SubpageId}; +use net_traits::{AsyncResponseTarget, IpcSend, PendingAsyncLoad}; use net_traits::CookieSource::NonHTTP; use net_traits::CoreResourceMsg::{GetCookiesForUrl, SetCookiesForUrl}; use net_traits::response::HttpsState; -use net_traits::{AsyncResponseTarget, PendingAsyncLoad, IpcSend}; use num_traits::ToPrimitive; use origin::Origin; -use parse::{ParserRoot, ParserRef, MutNullableParserField}; +use parse::{MutNullableParserField, ParserRef, ParserRoot}; use script_layout_interface::message::{Msg, ReflowQueryType}; use script_thread::{MainThreadScriptMsg, Runnable}; -use script_traits::UntrustedNodeAddress; use script_traits::{AnimationState, MouseButton, MouseEventType, MozBrowserEvent}; use script_traits::{ScriptMsg as ConstellationMsg, TouchpadPressurePhase}; use script_traits::{TouchEventType, TouchId}; +use script_traits::UntrustedNodeAddress; use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::boxed::FnBox; diff --git a/components/script/dom/domimplementation.rs b/components/script/dom/domimplementation.rs index 824cc0b88cf..dd55630204c 100644 --- a/components/script/dom/domimplementation.rs +++ b/components/script/dom/domimplementation.rs @@ -13,9 +13,9 @@ use dom::bindings::inheritance::Castable; use dom::bindings::js::{JS, Root}; use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::str::DOMString; -use dom::bindings::xmlname::{validate_qualified_name, namespace_from_domstring}; -use dom::document::DocumentSource; +use dom::bindings::xmlname::{namespace_from_domstring, validate_qualified_name}; use dom::document::{Document, IsHTMLDocument}; +use dom::document::DocumentSource; 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 3964c84abcb..a52f0b8b82f 100644 --- a/components/script/dom/domparser.rs +++ b/components/script/dom/domparser.rs @@ -16,8 +16,8 @@ use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, Root}; use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::str::DOMString; -use dom::document::DocumentSource; use dom::document::{Document, IsHTMLDocument}; +use dom::document::DocumentSource; use dom::window::Window; use parse::html::{ParseContext, parse_html}; use parse::xml::{self, parse_xml}; diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 8dea99bcd4a..f85f608545f 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -17,8 +17,8 @@ use dom::bindings::codegen::Bindings::ElementBinding::ElementMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; -use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::codegen::Bindings::WindowBinding::{ScrollBehavior, ScrollToOptions}; +use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::codegen::UnionTypes::NodeOrString; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; @@ -26,8 +26,8 @@ use dom::bindings::inheritance::{Castable, ElementTypeId, HTMLElementTypeId, Nod use dom::bindings::js::{JS, LayoutJS, MutNullableHeap}; use dom::bindings::js::{Root, RootedReference}; use dom::bindings::str::DOMString; -use dom::bindings::xmlname::XMLName::InvalidXMLName; use dom::bindings::xmlname::{namespace_from_domstring, validate_and_extract, xml_name_type}; +use dom::bindings::xmlname::XMLName::InvalidXMLName; use dom::characterdata::CharacterData; use dom::create::create_element; use dom::document::{Document, LayoutDocumentHelpers}; @@ -71,7 +71,7 @@ use html5ever::serialize::TraversalScope; use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode}; use html5ever::tree_builder::{LimitedQuirks, NoQuirks, Quirks}; use selectors::matching::{ElementFlags, MatchingReason, matches}; -use selectors::matching::{HAS_SLOW_SELECTOR, HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS}; +use selectors::matching::{HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS}; use selectors::parser::{AttrSelector, NamespaceConstraint, parse_author_origin_selector_list_from_str}; use std::ascii::AsciiExt; use std::borrow::Cow; @@ -86,9 +86,9 @@ use style::attr::{AttrValue, LengthOrPercentageOrAuto}; use style::element_state::*; use style::matching::{common_style_affecting_attributes, rare_style_affecting_attributes}; use style::parser::ParserContextExtraData; -use style::properties::longhands::{self, background_image, border_spacing, font_family, overflow_x, font_size}; use style::properties::{DeclaredValue, Importance}; use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, parse_style_attribute}; +use style::properties::longhands::{self, background_image, border_spacing, font_family, font_size, overflow_x}; use style::refcell::Ref; use style::selector_impl::{NonTSPseudoClass, ServoSelectorImpl}; use style::selector_matching::ApplicableDeclarationBlock; diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index 6c15cf92150..af95ec404b9 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -15,9 +15,9 @@ use dom::event::Event; use dom::eventtarget::EventTarget; use dom::htmlelement::HTMLElement; use dom::htmlfieldsetelement::HTMLFieldSetElement; -use dom::htmlformelement::HTMLFormElement; use dom::htmlformelement::{FormControl, FormDatum, FormDatumValue}; use dom::htmlformelement::{FormSubmitter, ResetFrom, SubmittedFrom}; +use dom::htmlformelement::HTMLFormElement; use dom::node::{Node, UnbindContext, document_from_node, window_from_node}; use dom::nodelist::NodeList; use dom::validation::Validatable; diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index e9d967514d7..4ec42ced6d6 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -11,8 +11,8 @@ use dom::bindings::codegen::Bindings::HTMLElementBinding; use dom::bindings::codegen::Bindings::HTMLElementBinding::HTMLElementMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::error::{Error, ErrorResult}; -use dom::bindings::inheritance::Castable; use dom::bindings::inheritance::{ElementTypeId, HTMLElementTypeId, NodeTypeId}; +use dom::bindings::inheritance::Castable; use dom::bindings::js::{JS, MutNullableHeap, Root, RootedReference}; use dom::bindings::str::DOMString; use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration}; diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 2cc946ec933..59578b37b59 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use document_loader::{LoadType, LoadBlocker}; +use document_loader::{LoadBlocker, LoadType}; use dom::attr::Attr; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementErrorEventDetail; @@ -20,7 +20,7 @@ use dom::bindings::conversions::ToJSValConvertible; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; -use dom::bindings::js::{JS, MutNullableHeap, Root, LayoutJS}; +use dom::bindings::js::{JS, LayoutJS, MutNullableHeap, Root}; use dom::bindings::reflector::Reflectable; use dom::bindings::str::DOMString; use dom::browsingcontext::BrowsingContext; @@ -31,18 +31,18 @@ use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers}; use dom::event::Event; use dom::eventtarget::EventTarget; use dom::htmlelement::HTMLElement; -use dom::node::{Node, NodeDamage, UnbindContext, window_from_node, document_from_node}; +use dom::node::{Node, NodeDamage, UnbindContext, document_from_node, window_from_node}; use dom::urlhelper::UrlHelper; use dom::virtualmethods::VirtualMethods; use dom::window::{ReflowReason, Window}; use ipc_channel::ipc; use js::jsapi::{JSAutoCompartment, JSContext, MutableHandleValue}; -use js::jsval::{UndefinedValue, NullValue}; -use msg::constellation_msg::{FrameType, LoadData, TraversalDirection, PipelineId, SubpageId}; +use js::jsval::{NullValue, UndefinedValue}; +use msg::constellation_msg::{FrameType, LoadData, PipelineId, SubpageId, TraversalDirection}; use net_traits::response::HttpsState; use script_layout_interface::message::ReflowQueryType; -use script_traits::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed}; use script_traits::{IFrameLoadInfo, MozBrowserEvent, ScriptMsg as ConstellationMsg}; +use script_traits::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed}; use std::cell::Cell; use string_cache::Atom; use style::attr::{AttrValue, LengthOrPercentageOrAuto}; diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index a98fcbcfb4e..978d93f6138 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -13,17 +13,17 @@ use dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElementM use dom::bindings::codegen::Bindings::KeyboardEventBinding::KeyboardEventMethods; use dom::bindings::error::{Error, ErrorResult}; use dom::bindings::inheritance::Castable; -use dom::bindings::js::{JS, LayoutJS, Root, RootedReference, MutNullableHeap}; +use dom::bindings::js::{JS, LayoutJS, MutNullableHeap, Root, RootedReference}; use dom::bindings::str::DOMString; use dom::document::Document; -use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers, LayoutElementHelpers}; +use dom::element::{AttributeMutation, Element, LayoutElementHelpers, RawLayoutElementHelpers}; use dom::event::{Event, EventBubbles, EventCancelable}; use dom::eventtarget::EventTarget; use dom::file::File; use dom::filelist::FileList; use dom::htmlelement::HTMLElement; use dom::htmlfieldsetelement::HTMLFieldSetElement; -use dom::htmlformelement::{FormDatumValue, FormControl, FormDatum, FormSubmitter, HTMLFormElement}; +use dom::htmlformelement::{FormControl, FormDatum, FormDatumValue, FormSubmitter, HTMLFormElement}; use dom::htmlformelement::{ResetFrom, SubmittedFrom}; use dom::keyboardevent::KeyboardEvent; use dom::node::{Node, NodeDamage, UnbindContext}; @@ -34,9 +34,9 @@ use dom::virtualmethods::VirtualMethods; use ipc_channel::ipc::{self, IpcSender}; use mime_guess; use msg::constellation_msg::Key; +use net_traits::{CoreResourceMsg, IpcSend}; use net_traits::blob_url_store::get_blob_origin; use net_traits::filemanager_thread::{FileManagerThreadMsg, FilterPattern}; -use net_traits::{IpcSend, CoreResourceMsg}; use script_traits::ScriptMsg as ConstellationMsg; use std::borrow::ToOwned; use std::cell::Cell; @@ -45,9 +45,9 @@ use string_cache::Atom; use style::attr::AttrValue; use style::element_state::*; use style::str::split_commas; +use textinput::{SelectionDirection, TextInput}; use textinput::KeyReaction::{DispatchInput, Nothing, RedrawSelection, TriggerDefaultAction}; use textinput::Lines::Single; -use textinput::{TextInput, SelectionDirection}; const DEFAULT_SUBMIT_VALUE: &'static str = "Submit"; const DEFAULT_RESET_VALUE: &'static str = "Reset"; diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index a7f5c5e3666..6484de1e029 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -11,8 +11,8 @@ use dom::bindings::codegen::Bindings::HTMLScriptElementBinding::HTMLScriptElemen use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; -use dom::bindings::js::RootedReference; use dom::bindings::js::{JS, Root}; +use dom::bindings::js::RootedReference; use dom::bindings::refcounted::Trusted; use dom::bindings::str::DOMString; use dom::document::Document; diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index a89df91f99b..5df0778fa2b 100644 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -12,8 +12,8 @@ use dom::bindings::inheritance::Castable; use dom::bindings::js::{LayoutJS, Root}; use dom::bindings::str::DOMString; use dom::document::Document; -use dom::element::RawLayoutElementHelpers; use dom::element::{AttributeMutation, Element}; +use dom::element::RawLayoutElementHelpers; use dom::event::{Event, EventBubbles, EventCancelable}; use dom::htmlelement::HTMLElement; use dom::htmlfieldsetelement::HTMLFieldSetElement; @@ -31,7 +31,7 @@ use std::ops::Range; use string_cache::Atom; use style::attr::AttrValue; use style::element_state::*; -use textinput::{KeyReaction, Lines, TextInput, SelectionDirection}; +use textinput::{KeyReaction, Lines, SelectionDirection, TextInput}; #[dom_struct] pub struct HTMLTextAreaElement { diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 555c7719fb1..5f1bee3a730 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -23,9 +23,9 @@ use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::{Castable, CharacterDataTypeId, ElementTypeId}; use dom::bindings::inheritance::{EventTargetTypeId, HTMLElementTypeId, NodeTypeId}; +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::reflector::{Reflectable, reflect_dom_object}; use dom::bindings::str::{DOMString, USVString}; use dom::bindings::xmlname::namespace_from_domstring; @@ -59,9 +59,9 @@ use libc::{self, c_void, uintptr_t}; use msg::constellation_msg::PipelineId; use parse::html::parse_html_fragment; use ref_slice::ref_slice; -use script_layout_interface::message::Msg; use script_layout_interface::{HTMLCanvasData, OpaqueStyleAndLayoutData}; -use script_layout_interface::{LayoutNodeType, LayoutElementType, TrustedNodeAddress}; +use script_layout_interface::{LayoutElementType, LayoutNodeType, TrustedNodeAddress}; +use script_layout_interface::message::Msg; use script_traits::UntrustedNodeAddress; use selectors::matching::{MatchingReason, matches}; use selectors::parser::Selector; diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs index b8cb72c4dc4..bab6bdcc3a2 100644 --- a/components/script/dom/range.rs +++ b/components/script/dom/range.rs @@ -6,14 +6,14 @@ 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::RangeMethods; use dom::bindings::codegen::Bindings::RangeBinding::{self, RangeConstants}; +use dom::bindings::codegen::Bindings::RangeBinding::RangeMethods; use dom::bindings::codegen::Bindings::TextBinding::TextMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; -use dom::bindings::inheritance::Castable; use dom::bindings::inheritance::{CharacterDataTypeId, NodeTypeId}; +use dom::bindings::inheritance::Castable; use dom::bindings::js::{JS, MutHeap, Root, RootedReference}; use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::str::DOMString; diff --git a/components/script/dom/request.rs b/components/script/dom/request.rs index c396c0d36e1..a32799cd61c 100644 --- a/components/script/dom/request.rs +++ b/components/script/dom/request.rs @@ -19,10 +19,11 @@ use dom::bindings::error::{Error, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, MutNullableHeap, Root}; use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object}; -use dom::bindings::str::{ByteString, USVString, DOMString}; -use dom::headers::{Headers, Guard}; +use dom::bindings::str::{ByteString, DOMString, USVString}; +use dom::headers::{Guard, Headers}; use hyper; -use msg::constellation_msg::{ReferrerPolicy as MsgReferrerPolicy}; +use msg::constellation_msg::ReferrerPolicy as MsgReferrerPolicy; +use net_traits::request::{Origin, Window}; use net_traits::request::CacheMode as NetTraitsRequestCache; use net_traits::request::CredentialsMode as NetTraitsRequestCredentials; use net_traits::request::Destination as NetTraitsRequestDestination; @@ -31,7 +32,6 @@ use net_traits::request::Referer as NetTraitsRequestReferer; use net_traits::request::Request as NetTraitsRequest; use net_traits::request::RequestMode as NetTraitsRequestMode; use net_traits::request::Type as NetTraitsRequestType; -use net_traits::request::{Origin, Window}; use std::cell::Cell; use url::Url; diff --git a/components/script/dom/serviceworkercontainer.rs b/components/script/dom/serviceworkercontainer.rs index 4487c064fe1..06080b7731c 100644 --- a/components/script/dom/serviceworkercontainer.rs +++ b/components/script/dom/serviceworkercontainer.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::Bindings::ServiceWorkerContainerBinding::RegistrationOptions; use dom::bindings::codegen::Bindings::ServiceWorkerContainerBinding::{ServiceWorkerContainerMethods, Wrap}; +use dom::bindings::codegen::Bindings::ServiceWorkerContainerBinding::RegistrationOptions; use dom::bindings::error::{Error, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; diff --git a/components/script/dom/servohtmlparser.rs b/components/script/dom/servohtmlparser.rs index d4d2cbc911a..548dad24dae 100644 --- a/components/script/dom/servohtmlparser.rs +++ b/components/script/dom/servohtmlparser.rs @@ -33,9 +33,9 @@ use js::jsapi::JSTracer; use msg::constellation_msg::{PipelineId, SubpageId}; use net_traits::{AsyncResponseListener, Metadata, NetworkError}; use network_listener::PreInvoke; -use parse::{TrustedParser, ParserRef, Parser}; +use parse::{Parser, ParserRef, TrustedParser}; +use profile_traits::time::{TimerMetadata, TimerMetadataFrameType, TimerMetadataReflowType, profile}; use profile_traits::time::ProfilerCategory; -use profile_traits::time::{profile, TimerMetadata, TimerMetadataReflowType, TimerMetadataFrameType}; use script_thread::ScriptThread; use std::cell::Cell; use std::default::Default; diff --git a/components/script/dom/treewalker.rs b/components/script/dom/treewalker.rs index 8103421a155..c4097fc761a 100644 --- a/components/script/dom/treewalker.rs +++ b/components/script/dom/treewalker.rs @@ -10,8 +10,8 @@ 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::Root; use dom::bindings::js::{JS, MutHeap}; +use dom::bindings::js::Root; use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::document::Document; use dom::node::Node; diff --git a/components/script/dom/uievent.rs b/components/script/dom/uievent.rs index 16461315ca1..a0f35868662 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::error::Fallible; use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; -use dom::bindings::js::Root; use dom::bindings::js::{JS, MutNullableHeap, RootedReference}; +use dom::bindings::js::Root; use dom::bindings::reflector::reflect_dom_object; use dom::bindings::str::DOMString; use dom::event::{Event, EventBubbles, EventCancelable}; diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs index e42b3b7f1cd..bc686d23cc4 100644 --- a/components/script/dom/url.rs +++ b/components/script/dom/url.rs @@ -14,13 +14,13 @@ use dom::blob::Blob; use dom::urlhelper::UrlHelper; use dom::urlsearchparams::URLSearchParams; use ipc_channel::ipc; +use net_traits::{CoreResourceMsg, IpcSend}; use net_traits::blob_url_store::{get_blob_origin, parse_blob_url}; use net_traits::filemanager_thread::FileManagerThreadMsg; -use net_traits::{IpcSend, CoreResourceMsg}; use std::borrow::ToOwned; use std::default::Default; -use url::quirks::domain_to_unicode; use url::{Host, Url}; +use url::quirks::domain_to_unicode; use uuid::Uuid; // https://url.spec.whatwg.org/#url diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index aadf03d4211..3fc63349634 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -4,12 +4,12 @@ use canvas_traits::{CanvasCommonMsg, CanvasMsg, byte_swap}; use core::nonzero::NonZero; +use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes}; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods; -use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes}; use dom::bindings::codegen::UnionTypes::ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement; use dom::bindings::conversions::{ToJSValConvertible, array_buffer_view_data, array_buffer_view_data_checked}; -use dom::bindings::conversions::{array_buffer_view_to_vec_checked, array_buffer_view_to_vec}; +use dom::bindings::conversions::{array_buffer_view_to_vec, array_buffer_view_to_vec_checked}; use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; use dom::bindings::js::{JS, LayoutJS, MutNullableHeap, Root}; @@ -22,7 +22,7 @@ use dom::node::{Node, NodeDamage, window_from_node}; use dom::webgl_validations::WebGLValidator; use dom::webgl_validations::tex_image_2d::{CommonTexImage2DValidator, CommonTexImage2DValidatorResult}; use dom::webgl_validations::tex_image_2d::{TexImage2DValidator, TexImage2DValidatorResult}; -use dom::webgl_validations::types::{TexFormat, TexImageTarget, TexDataType}; +use dom::webgl_validations::types::{TexDataType, TexFormat, TexImageTarget}; use dom::webglactiveinfo::WebGLActiveInfo; use dom::webglbuffer::WebGLBuffer; use dom::webglcontextevent::WebGLContextEvent; @@ -34,15 +34,15 @@ use dom::webgltexture::{TexParameterValue, WebGLTexture}; use dom::webgluniformlocation::WebGLUniformLocation; use euclid::size::Size2D; use ipc_channel::ipc::{self, IpcSender}; -use js::jsapi::{JSContext, JS_GetArrayBufferViewType, JSObject, Type}; +use js::jsapi::{JSContext, JSObject, JS_GetArrayBufferViewType, Type}; use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue, UndefinedValue}; use net_traits::image::base::PixelFormat; use net_traits::image_cache_thread::ImageResponse; use offscreen_gl_context::{GLContextAttributes, GLLimits}; use script_traits::ScriptMsg as ConstellationMsg; use std::cell::Cell; -use webrender_traits::WebGLError::*; use webrender_traits::{WebGLCommand, WebGLError, WebGLFramebufferBindingRequest, WebGLParameter}; +use webrender_traits::WebGLError::*; type ImagePixelResult = Result<(Vec<u8>, Size2D<i32>), ()>; pub const MAX_UNIFORM_AND_ATTRIBUTE_LEN: usize = 256; diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs index 3b3652040e9..df9c2e5ed34 100644 --- a/components/script/dom/websocket.rs +++ b/components/script/dom/websocket.rs @@ -9,7 +9,7 @@ use dom::bindings::codegen::Bindings::WebSocketBinding; use dom::bindings::codegen::Bindings::WebSocketBinding::{BinaryType, WebSocketMethods}; use dom::bindings::codegen::UnionTypes::StringOrStringSequence; use dom::bindings::conversions::ToJSValConvertible; -use dom::bindings::error::{Error, Fallible, ErrorResult}; +use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; use dom::bindings::js::Root; @@ -23,18 +23,18 @@ use dom::eventtarget::EventTarget; use dom::messageevent::MessageEvent; use dom::urlhelper::UrlHelper; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; -use js::jsapi::JSAutoCompartment; use js::jsapi::{JS_GetArrayBufferData, JS_NewArrayBuffer}; +use js::jsapi::JSAutoCompartment; use js::jsval::UndefinedValue; use libc::{uint32_t, uint8_t}; +use net_traits::{WebSocketCommunicate, WebSocketConnectData, WebSocketDomAction, WebSocketNetworkEvent}; use net_traits::CookieSource::HTTP; -use net_traits::CoreResourceMsg::{WebsocketConnect, SetCookiesForUrl}; +use net_traits::CoreResourceMsg::{SetCookiesForUrl, WebsocketConnect}; use net_traits::MessageData; use net_traits::hosts::replace_hosts; use net_traits::unwrap_websocket_protocol; -use net_traits::{WebSocketCommunicate, WebSocketConnectData, WebSocketDomAction, WebSocketNetworkEvent}; -use script_runtime::ScriptThreadEventCategory::WebSocketEvent; use script_runtime::{CommonScriptMsg, ScriptChan}; +use script_runtime::ScriptThreadEventCategory::WebSocketEvent; use script_thread::Runnable; use std::ascii::AsciiExt; use std::borrow::ToOwned; diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index d1529b44b19..e28b381a2fa 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -12,9 +12,9 @@ use dom::bindings::codegen::Bindings::EventHandlerBinding::OnBeforeUnloadEventHa use dom::bindings::codegen::Bindings::EventHandlerBinding::OnErrorEventHandlerNonNull; use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; -use dom::bindings::codegen::Bindings::WindowBinding::{ScrollBehavior, ScrollToOptions}; use dom::bindings::codegen::Bindings::WindowBinding::{self, FrameRequestCallback, WindowMethods}; -use dom::bindings::error::{Error, ErrorResult, Fallible, report_pending_exception, ErrorInfo}; +use dom::bindings::codegen::Bindings::WindowBinding::{ScrollBehavior, ScrollToOptions}; +use dom::bindings::error::{Error, ErrorInfo, ErrorResult, Fallible, report_pending_exception}; use dom::bindings::global::{GlobalRef, global_root_from_object}; use dom::bindings::inheritance::Castable; use dom::bindings::js::{JS, MutNullableHeap, Root}; @@ -46,7 +46,7 @@ use euclid::{Point2D, Rect, Size2D}; use gfx_traits::LayerId; use ipc_channel::ipc::{self, IpcSender}; use js::jsapi::{Evaluate2, HandleObject, HandleValue, JSAutoCompartment, JSContext}; -use js::jsapi::{JS_GetRuntime, JS_GC, MutableHandleValue, SetWindowProxy}; +use js::jsapi::{JS_GC, JS_GetRuntime, MutableHandleValue, SetWindowProxy}; use js::jsval::UndefinedValue; use js::rust::CompileOptionsWrapper; use js::rust::Runtime; @@ -68,13 +68,13 @@ use script_layout_interface::message::{Msg, Reflow, ReflowQueryType, ScriptReflo use script_layout_interface::reporter::CSSErrorReporter; use script_layout_interface::rpc::{ContentBoxResponse, ContentBoxesResponse, LayoutRPC}; use script_layout_interface::rpc::{MarginStyleResponse, ResolvedStyleResponse}; -use script_runtime::{ScriptChan, ScriptPort, CommonScriptMsg, ScriptThreadEventCategory, maybe_take_panic_result}; +use script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort, ScriptThreadEventCategory, maybe_take_panic_result}; +use script_thread::{MainThreadScriptChan, MainThreadScriptMsg, Runnable, RunnableWrapper}; use script_thread::SendableMainThreadScriptChan; -use script_thread::{MainThreadScriptChan, MainThreadScriptMsg, RunnableWrapper, Runnable}; -use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult}; use script_traits::{ConstellationControlMsg, MozBrowserEvent, UntrustedNodeAddress}; use script_traits::{DocumentState, MsDuration, TimerEvent, TimerEventId}; use script_traits::{ScriptMsg as ConstellationMsg, TimerEventRequest, TimerSource, WindowSizeData}; +use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult}; use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::cell::Cell; @@ -84,10 +84,10 @@ use std::ffi::CString; use std::io::{Write, stderr, stdout}; use std::panic; use std::rc::Rc; +use std::sync::{Arc, Mutex}; use std::sync::atomic::{AtomicBool, Ordering}; -use std::sync::mpsc::TryRecvError::{Disconnected, Empty}; use std::sync::mpsc::{Sender, channel}; -use std::sync::{Arc, Mutex}; +use std::sync::mpsc::TryRecvError::{Disconnected, Empty}; use string_cache::Atom; use style::context::ReflowGoal; use style::error_reporting::ParseErrorReporter; diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs index f171d1ee515..938ca28c148 100644 --- a/components/script/dom/worker.rs +++ b/components/script/dom/worker.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 devtools_traits::{ScriptToDevtoolsControlMsg, DevtoolsPageInfo}; +use devtools_traits::{DevtoolsPageInfo, ScriptToDevtoolsControlMsg}; +use dom::abstractworker::{SharedRt, SimpleWorkerErrorHandler}; use dom::abstractworker::WorkerScriptMsg; -use dom::abstractworker::{SimpleWorkerErrorHandler, SharedRt}; use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; use dom::bindings::codegen::Bindings::WorkerBinding; use dom::bindings::codegen::Bindings::WorkerBinding::WorkerMethods; @@ -21,14 +21,14 @@ use dom::eventtarget::EventTarget; use dom::messageevent::MessageEvent; use dom::workerglobalscope::prepare_workerscope_init; use ipc_channel::ipc; -use js::jsapi::{HandleValue, JSContext, JSAutoCompartment}; +use js::jsapi::{HandleValue, JSAutoCompartment, JSContext}; use js::jsval::UndefinedValue; use script_thread::Runnable; use script_traits::WorkerScriptLoadOrigin; use std::cell::Cell; +use std::sync::{Arc, Mutex}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::{Sender, channel}; -use std::sync::{Arc, Mutex}; pub type TrustedWorkerAddress = Trusted<Worker>; diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index 9f61753ca64..18f51156aec 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -24,14 +24,14 @@ use js::jsapi::{HandleValue, JSAutoCompartment, JSContext, JSRuntime}; use js::jsval::UndefinedValue; use js::rust::Runtime; use msg::constellation_msg::{PipelineId, ReferrerPolicy}; +use net_traits::{IpcSend, LoadOrigin}; use net_traits::{LoadContext, ResourceThreads, load_whole_resource}; -use net_traits::{LoadOrigin, IpcSend}; use profile_traits::{mem, time}; use script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort, maybe_take_panic_result}; use script_thread::RunnableWrapper; +use script_traits::{MsDuration, TimerEvent, TimerEventId, TimerEventRequest, TimerSource}; use script_traits::ScriptMsg as ConstellationMsg; use script_traits::WorkerGlobalScopeInit; -use script_traits::{MsDuration, TimerEvent, TimerEventId, TimerEventRequest, TimerSource}; use std::cell::Cell; use std::default::Default; use std::panic; diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index fc82d63a897..a97dc7f802b 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -21,8 +21,8 @@ use dom::bindings::refcounted::Trusted; use dom::bindings::reflector::{Reflectable, reflect_dom_object}; use dom::bindings::str::{ByteString, DOMString, USVString, is_token}; use dom::blob::{Blob, BlobImpl}; -use dom::document::DocumentSource; use dom::document::{Document, IsHTMLDocument}; +use dom::document::DocumentSource; use dom::event::{Event, EventBubbles, EventCancelable}; use dom::eventtarget::EventTarget; use dom::headers::is_forbidden_header_name; @@ -34,22 +34,22 @@ use encoding::all::UTF_8; use encoding::label::encoding_from_whatwg_label; use encoding::types::{DecoderTrap, EncoderTrap, Encoding, EncodingRef}; use euclid::length::Length; -use hyper::header::Headers; use hyper::header::{ContentLength, ContentType}; +use hyper::header::Headers; use hyper::method::Method; -use hyper::mime::{self, Mime, Attr as MimeAttr, Value as MimeValue}; +use hyper::mime::{self, Attr as MimeAttr, Mime, Value as MimeValue}; use hyper_serde::Serde; use ipc_channel::ipc; use ipc_channel::router::ROUTER; -use js::jsapi::JS_ClearPendingException; use js::jsapi::{JSContext, JS_ParseJSON}; +use js::jsapi::JS_ClearPendingException; use js::jsval::{JSVal, NullValue, UndefinedValue}; use msg::constellation_msg::{PipelineId, ReferrerPolicy}; +use net_traits::{CoreResourceThread, LoadOrigin}; +use net_traits::{FetchResponseListener, Metadata, NetworkError}; use net_traits::CoreResourceMsg::Fetch; use net_traits::request::{CredentialsMode, Destination, RequestInit, RequestMode}; use net_traits::trim_http_whitespace; -use net_traits::{CoreResourceThread, LoadOrigin}; -use net_traits::{FetchResponseListener, Metadata, NetworkError}; use network_listener::{NetworkListener, PreInvoke}; use parse::html::{ParseContext, parse_html}; use parse::xml::{self, parse_xml}; @@ -63,7 +63,7 @@ use std::sync::{Arc, Mutex}; use string_cache::Atom; use time; use timers::{OneshotTimerCallback, OneshotTimerHandle}; -use url::{Url, Position}; +use url::{Position, Url}; use util::prefs::PREFS; #[derive(JSTraceable, PartialEq, Copy, Clone, HeapSizeOf)] @@ -1235,8 +1235,8 @@ impl XMLHttpRequest { fn filter_response_headers(&self) -> Headers { // https://fetch.spec.whatwg.org/#concept-response-header-list use hyper::error::Result; - use hyper::header::SetCookie; use hyper::header::{Header, HeaderFormat}; + use hyper::header::SetCookie; use std::fmt; // a dummy header so we can use headers.remove::<SetCookie2>() diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index 911810880e2..5411deb91a8 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -36,17 +36,17 @@ use dom::bindings::js::LayoutJS; use dom::characterdata::LayoutCharacterDataHelpers; use dom::document::{Document, LayoutDocumentHelpers}; use dom::element::{Element, LayoutElementHelpers, RawLayoutElementHelpers}; -use dom::node::{CAN_BE_FRAGMENTED, HAS_CHANGED, HAS_DIRTY_DESCENDANTS, IS_DIRTY, DIRTY_ON_VIEWPORT_SIZE_CHANGE}; -use dom::node::{Node, LayoutNodeHelpers}; +use dom::node::{CAN_BE_FRAGMENTED, DIRTY_ON_VIEWPORT_SIZE_CHANGE, HAS_CHANGED, HAS_DIRTY_DESCENDANTS, IS_DIRTY}; +use dom::node::{LayoutNodeHelpers, Node}; use dom::text::Text; use gfx_traits::ByteIndex; use msg::constellation_msg::PipelineId; use range::Range; -use script_layout_interface::restyle_damage::RestyleDamage; -use script_layout_interface::wrapper_traits::{DangerousThreadSafeLayoutNode, LayoutNode, PseudoElementType}; -use script_layout_interface::wrapper_traits::{ThreadSafeLayoutNode, ThreadSafeLayoutElement}; use script_layout_interface::{HTMLCanvasData, LayoutNodeType, TrustedNodeAddress}; use script_layout_interface::{OpaqueStyleAndLayoutData, PartialStyleAndLayoutData}; +use script_layout_interface::restyle_damage::RestyleDamage; +use script_layout_interface::wrapper_traits::{DangerousThreadSafeLayoutNode, LayoutNode, PseudoElementType}; +use script_layout_interface::wrapper_traits::{ThreadSafeLayoutElement, ThreadSafeLayoutNode}; use selectors::matching::ElementFlags; use selectors::parser::{AttrSelector, NamespaceConstraint}; use std::fmt; @@ -58,7 +58,7 @@ use style::attr::AttrValue; use style::computed_values::display; use style::context::SharedStyleContext; use style::data::PrivateStyleData; -use style::dom::{PresentationalHintsSynthetizer, OpaqueNode, TDocument, TElement, TNode, UnsafeNode}; +use style::dom::{OpaqueNode, PresentationalHintsSynthetizer, TDocument, TElement, TNode, UnsafeNode}; use style::element_state::*; use style::properties::{ComputedValues, PropertyDeclarationBlock}; use style::refcell::{Ref, RefCell, RefMut}; diff --git a/components/script/network_listener.rs b/components/script/network_listener.rs index 1dd0d8f0a34..4ff65bf8073 100644 --- a/components/script/network_listener.rs +++ b/components/script/network_listener.rs @@ -4,8 +4,8 @@ use net_traits::{Action, AsyncResponseListener, FetchResponseListener}; use net_traits::{FetchResponseMsg, ResponseAction}; -use script_runtime::ScriptThreadEventCategory::NetworkEvent; use script_runtime::{CommonScriptMsg, ScriptChan}; +use script_runtime::ScriptThreadEventCategory::NetworkEvent; use script_thread::{Runnable, RunnableWrapper}; use std::sync::{Arc, Mutex}; diff --git a/components/script/origin.rs b/components/script/origin.rs index 9b0ba7738e2..21204980e26 100644 --- a/components/script/origin.rs +++ b/components/script/origin.rs @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use std::sync::Arc; +use url::{Host, Url}; use url::Origin as UrlOrigin; -use url::{Url, Host}; /// A representation of an [origin](https://html.spec.whatwg.org/multipage/#origin-2). #[derive(HeapSizeOf, JSTraceable)] diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs index 659772b851b..39684bd1b3e 100644 --- a/components/script/parse/html.rs +++ b/components/script/parse/html.rs @@ -13,23 +13,23 @@ use dom::bindings::js::{JS, RootedReference}; use dom::bindings::str::DOMString; use dom::characterdata::CharacterData; use dom::comment::Comment; -use dom::document::Document; use dom::document::{DocumentSource, IsHTMLDocument}; +use dom::document::Document; use dom::documenttype::DocumentType; use dom::element::{Element, ElementCreator}; use dom::htmlformelement::HTMLFormElement; use dom::htmlscriptelement::HTMLScriptElement; use dom::htmltemplateelement::HTMLTemplateElement; -use dom::node::Node; use dom::node::{document_from_node, window_from_node}; +use dom::node::Node; use dom::processinginstruction::ProcessingInstruction; use dom::servohtmlparser; use dom::servohtmlparser::{FragmentContext, ServoHTMLParser}; use dom::text::Text; use html5ever::Attribute; +use html5ever::serialize::{AttrRef, Serializable, Serializer}; use html5ever::serialize::TraversalScope; use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode}; -use html5ever::serialize::{AttrRef, Serializable, Serializer}; use html5ever::tendril::StrTendril; use html5ever::tree_builder::{NextParserState, NodeOrText, QuirksMode, TreeSink}; use msg::constellation_msg::PipelineId; diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index ac6165d5c4f..d69124b5d07 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -18,9 +18,9 @@ //! loop. use devtools; -use devtools_traits::CSSError; use devtools_traits::{DevtoolScriptControlMsg, DevtoolsPageInfo}; use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId}; +use devtools_traits::CSSError; use document_loader::DocumentLoader; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState}; @@ -52,7 +52,7 @@ use euclid::Rect; use euclid::point::Point2D; use gfx_traits::LayerId; use hyper::header::{ContentType, Headers, HttpDate, LastModified}; -use hyper::header::{ReferrerPolicy as ReferrerPolicyHeader}; +use hyper::header::ReferrerPolicy as ReferrerPolicyHeader; use hyper::method::Method; use hyper::mime::{Mime, SubLevel, TopLevel}; use hyper_serde::Serde; @@ -65,11 +65,11 @@ use js::jsval::UndefinedValue; use js::rust::Runtime; use mem::heap_size_of_self_and_children; use msg::constellation_msg::{FrameType, LoadData, PipelineId, PipelineNamespace}; -use msg::constellation_msg::{SubpageId, WindowSizeType, ReferrerPolicy}; -use net_traits::bluetooth_thread::BluetoothMethodMsg; -use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheResult, ImageCacheThread}; +use msg::constellation_msg::{ReferrerPolicy, SubpageId, WindowSizeType}; use net_traits::{AsyncResponseTarget, CoreResourceMsg, LoadConsumer, LoadContext, Metadata, ResourceThreads}; use net_traits::{IpcSend, LoadData as NetLoadData}; +use net_traits::bluetooth_thread::BluetoothMethodMsg; +use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheResult, ImageCacheThread}; use network_listener::NetworkListener; use parse::ParserRoot; use parse::html::{ParseContext, parse_html}; @@ -78,15 +78,15 @@ use profile_traits::mem::{self, OpaqueSender, Report, ReportKind, ReportsChan}; use profile_traits::time::{self, ProfilerCategory, profile}; use script_layout_interface::message::{self, NewLayoutThreadInfo, ReflowQueryType}; use script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory}; -use script_runtime::{ScriptPort, StackRootTLS, new_rt_and_cx, get_reports}; -use script_traits::CompositorEvent::{KeyEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent}; -use script_traits::CompositorEvent::{TouchEvent, TouchpadPressureEvent}; -use script_traits::webdriver_msg::WebDriverScriptCommand; +use script_runtime::{ScriptPort, StackRootTLS, get_reports, new_rt_and_cx}; use script_traits::{CompositorEvent, ConstellationControlMsg, EventResult}; use script_traits::{InitialScriptState, MouseButton, MouseEventType, MozBrowserEvent}; use script_traits::{NewLayoutInfo, ScriptMsg as ConstellationMsg}; use script_traits::{ScriptThreadFactory, TimerEvent, TimerEventRequest, TimerSource}; use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress, WindowSizeData}; +use script_traits::CompositorEvent::{KeyEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent}; +use script_traits::CompositorEvent::{TouchEvent, TouchpadPressureEvent}; +use script_traits::webdriver_msg::WebDriverScriptCommand; use std::borrow::ToOwned; use std::cell::Cell; use std::collections::{HashMap, HashSet}; @@ -94,19 +94,19 @@ use std::option::Option; use std::ptr; use std::rc::Rc; use std::result::Result; -use std::sync::atomic::{Ordering, AtomicBool}; -use std::sync::mpsc::{Receiver, Select, Sender, channel}; use std::sync::{Arc, Mutex}; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::mpsc::{Receiver, Select, Sender, channel}; use style::context::ReflowGoal; use style::thread_state; use task_source::TaskSource; -use task_source::dom_manipulation::{DOMManipulationTaskSource, DOMManipulationTask}; +use task_source::dom_manipulation::{DOMManipulationTask, DOMManipulationTaskSource}; use task_source::file_reading::FileReadingTaskSource; use task_source::history_traversal::HistoryTraversalTaskSource; use task_source::networking::NetworkingTaskSource; -use task_source::user_interaction::{UserInteractionTaskSource, UserInteractionTask}; +use task_source::user_interaction::{UserInteractionTask, UserInteractionTaskSource}; use time::Tm; -use url::{Url, Position}; +use url::{Position, Url}; use util::opts; use util::thread; use webdriver_handlers; diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs index 91b70ff128c..b43262080b0 100644 --- a/components/script/webdriver_handlers.rs +++ b/components/script/webdriver_handlers.rs @@ -29,14 +29,14 @@ use euclid::rect::Rect; use euclid::size::Size2D; use hyper_serde::Serde; use ipc_channel::ipc::{self, IpcSender}; -use js::jsapi::{JSContext, HandleValue}; +use js::jsapi::{HandleValue, JSContext}; use js::jsval::UndefinedValue; use msg::constellation_msg::PipelineId; use net_traits::CookieSource::{HTTP, NonHTTP}; use net_traits::CoreResourceMsg::{GetCookiesDataForUrl, SetCookiesForUrlWithData}; use net_traits::IpcSend; -use script_traits::webdriver_msg::WebDriverCookieError; use script_traits::webdriver_msg::{WebDriverFrameId, WebDriverJSError, WebDriverJSResult, WebDriverJSValue}; +use script_traits::webdriver_msg::WebDriverCookieError; use url::Url; fn find_node_by_unique_id(context: &BrowsingContext, diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs index 5d16aeffb0a..35583bc2dfe 100644 --- a/components/script_layout_interface/message.rs +++ b/components/script_layout_interface/message.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use {OpaqueStyleAndLayoutData, TrustedNodeAddress}; use app_units::Au; use euclid::point::Point2D; use euclid::rect::Rect; @@ -21,7 +22,6 @@ use style::selector_impl::PseudoElement; use style::stylesheets::Stylesheet; use url::Url; use util::ipc::OptionalOpaqueIpcSender; -use {OpaqueStyleAndLayoutData, TrustedNodeAddress}; /// Asynchronous messages that script can send to layout. pub enum Msg { diff --git a/components/script_layout_interface/wrapper_traits.rs b/components/script_layout_interface/wrapper_traits.rs index 3c603e83396..20ddca94cf4 100644 --- a/components/script_layout_interface/wrapper_traits.rs +++ b/components/script_layout_interface/wrapper_traits.rs @@ -15,8 +15,8 @@ use std::sync::Arc; use string_cache::{Atom, Namespace}; use style::computed_values::display; use style::context::SharedStyleContext; -use style::dom::OpaqueNode; use style::dom::{PresentationalHintsSynthetizer, TNode}; +use style::dom::OpaqueNode; use style::properties::ServoComputedValues; use style::refcell::{Ref, RefCell}; use style::selector_impl::{PseudoElement, PseudoElementCascadeType, ServoSelectorImpl}; diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 897f20bb3b2..21db877640b 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -55,16 +55,16 @@ use libc::c_void; use msg::constellation_msg::{FrameId, FrameType, Image, Key, KeyModifiers, KeyState, LoadData}; use msg::constellation_msg::{PipelineId, PipelineNamespaceId, ReferrerPolicy}; use msg::constellation_msg::{SubpageId, TraversalDirection, WindowSizeType}; +use net_traits::{LoadOrigin, ResourceThreads}; use net_traits::bluetooth_thread::BluetoothMethodMsg; use net_traits::image_cache_thread::ImageCacheThread; use net_traits::response::HttpsState; -use net_traits::{LoadOrigin, ResourceThreads}; use profile_traits::mem; use profile_traits::time as profile_time; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::collections::HashMap; use std::fmt; -use std::sync::mpsc::{Sender, Receiver}; +use std::sync::mpsc::{Receiver, Sender}; use style_traits::{PagePx, ViewportPx}; use url::Url; use util::ipc::OptionalOpaqueIpcSender; diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 6e61ad4d736..11a13d6c1cc 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -60,14 +60,14 @@ fn webdriver(port: u16, constellation: Sender<ConstellationMsg>) { #[cfg(not(feature = "webdriver"))] fn webdriver(_port: u16, _constellation: Sender<ConstellationMsg>) { } +use compositing::{CompositorProxy, IOCompositor}; use compositing::compositor_thread::InitialCompositorState; use compositing::windowing::WindowEvent; use compositing::windowing::WindowMethods; -use compositing::{CompositorProxy, IOCompositor}; +use constellation::{Constellation, InitialConstellationState, UnprivilegedPipelineContent}; +use constellation::{FromCompositorLogger, FromScriptLogger}; #[cfg(not(target_os = "windows"))] use constellation::content_process_sandbox_profile; -use constellation::{Constellation, InitialConstellationState, UnprivilegedPipelineContent}; -use constellation::{FromScriptLogger, FromCompositorLogger}; use env_logger::Logger as EnvLogger; #[cfg(not(target_os = "windows"))] use gaol::sandbox::{ChildSandbox, ChildSandboxMethods}; @@ -83,7 +83,7 @@ use profile::mem as profile_mem; use profile::time as profile_time; use profile_traits::mem; use profile_traits::time; -use script_traits::{ConstellationMsg, ScriptMsg, SWManagerSenders}; +use script_traits::{ConstellationMsg, SWManagerSenders, ScriptMsg}; use std::cmp::max; use std::rc::Rc; use std::sync::mpsc::Sender; diff --git a/components/servo/main.rs b/components/servo/main.rs index 321c41f9716..ddba3b38f51 100644 --- a/components/servo/main.rs +++ b/components/servo/main.rs @@ -288,9 +288,9 @@ mod android { unsafe impl Send for FilePtr {} fn redirect_output(file_no: c_int) { + use self::libc::{pipe, dup2}; use self::libc::fdopen; use self::libc::fgets; - use self::libc::{pipe, dup2}; use servo::util::thread::spawn_named; use std::ffi::CStr; use std::ffi::CString; diff --git a/components/style/animation.rs b/components/style/animation.rs index 6d6236f53f8..c65553a78f4 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -9,13 +9,13 @@ use context::SharedStyleContext; use dom::OpaqueNode; use euclid::point::Point2D; use keyframes::{KeyframesStep, KeyframesStepValue}; +use properties::{self, ComputedValues, Importance}; use properties::animated_properties::{AnimatedProperty, TransitionProperty}; use properties::longhands::animation_direction::computed_value::AnimationDirection; use properties::longhands::animation_iteration_count::computed_value::AnimationIterationCount; use properties::longhands::animation_play_state::computed_value::AnimationPlayState; use properties::longhands::transition_timing_function::computed_value::StartEnd; use properties::longhands::transition_timing_function::computed_value::TransitionTimingFunction; -use properties::{self, ComputedValues, Importance}; use selector_matching::ApplicableDeclarationBlock; use std::sync::Arc; use std::sync::mpsc::Sender; @@ -686,4 +686,3 @@ pub fn complete_expired_transitions(node: OpaqueNode, style: &mut Arc<ComputedVa had_animations_to_expire } - diff --git a/components/style/context.rs b/components/style/context.rs index f1c5ac3f307..f25094140fa 100644 --- a/components/style/context.rs +++ b/components/style/context.rs @@ -13,8 +13,8 @@ use matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache}; use selector_matching::Stylist; use std::cell::RefCell; use std::collections::HashMap; -use std::sync::mpsc::Sender; use std::sync::{Arc, Mutex, RwLock}; +use std::sync::mpsc::Sender; use timer::Timer; /// This structure is used to create a local style context from a shared one. diff --git a/components/style/gecko_conversions.rs b/components/style/gecko_conversions.rs index 851dbe90947..635656afab0 100644 --- a/components/style/gecko_conversions.rs +++ b/components/style/gecko_conversions.rs @@ -108,15 +108,15 @@ impl From<nsStyleCoord_CalcValue> for LengthOrPercentage { pub mod basic_shape { use euclid::size::Size2D; use gecko_bindings::structs; - use gecko_bindings::structs::StyleClipPathGeometryBox; use gecko_bindings::structs::{StyleBasicShape, StyleBasicShapeType, StyleFillRule}; use gecko_bindings::structs::{nsStyleCoord, nsStyleCorners}; + use gecko_bindings::structs::StyleClipPathGeometryBox; use gecko_bindings::sugar::ns_style_coord::{CoordDataMut, CoordDataValue}; use gecko_values::GeckoStyleCoordConvertible; use std::borrow::Borrow; + use values::computed::{BorderRadiusSize, LengthOrPercentage}; use values::computed::basic_shape::*; use values::computed::position; - use values::computed::{BorderRadiusSize, LengthOrPercentage}; // using Borrow so that we can have a non-moving .into() impl<T: Borrow<StyleBasicShape>> From<T> for BasicShape { diff --git a/components/style/gecko_selector_impl.rs b/components/style/gecko_selector_impl.rs index 86de0ad4938..e1dbffbdc19 100644 --- a/components/style/gecko_selector_impl.rs +++ b/components/style/gecko_selector_impl.rs @@ -4,11 +4,11 @@ use cssparser::ToCss; use element_state::ElementState; +use selector_impl::{attr_equals_selector_is_shareable, attr_exists_selector_is_shareable}; use selector_impl::PseudoElementCascadeType; -use selector_impl::{attr_exists_selector_is_shareable, attr_equals_selector_is_shareable}; -use selectors::parser::{ParserContext, SelectorImpl, AttrSelector}; +use selectors::parser::{AttrSelector, ParserContext, SelectorImpl}; use std::fmt; -use string_cache::{Atom, WeakAtom, Namespace, WeakNamespace}; +use string_cache::{Atom, Namespace, WeakAtom, WeakNamespace}; #[derive(Debug, Clone, PartialEq, Eq)] pub struct GeckoSelectorImpl; diff --git a/components/style/gecko_values.rs b/components/style/gecko_values.rs index f3c570f34cc..79cfcbb0beb 100644 --- a/components/style/gecko_values.rs +++ b/components/style/gecko_values.rs @@ -6,13 +6,13 @@ use app_units::Au; use cssparser::RGBA; -use gecko_bindings::structs::nsStyleCoord; use gecko_bindings::structs::{NS_RADIUS_CLOSEST_SIDE, NS_RADIUS_FARTHEST_SIDE}; -use gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordData, CoordDataMut}; +use gecko_bindings::structs::nsStyleCoord; +use gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, CoordDataValue}; use std::cmp::max; +use values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto, LengthOrPercentageOrNone}; use values::computed::Angle; use values::computed::basic_shape::ShapeRadius; -use values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto, LengthOrPercentageOrNone}; pub trait StyleCoordHelpers { fn set<T: GeckoStyleCoordConvertible>(&mut self, val: T); diff --git a/components/style/keyframes.rs b/components/style/keyframes.rs index f874f788cbe..01043b0fc5e 100644 --- a/components/style/keyframes.rs +++ b/components/style/keyframes.rs @@ -5,9 +5,9 @@ use cssparser::{AtRuleParser, Parser, QualifiedRuleParser, RuleListParser}; use cssparser::{DeclarationListParser, DeclarationParser}; use parser::{ParserContext, log_css_error}; +use properties::{Importance, PropertyDeclaration, PropertyDeclarationBlock}; use properties::PropertyDeclarationParseResult; use properties::animated_properties::TransitionProperty; -use properties::{PropertyDeclaration, PropertyDeclarationBlock, Importance}; use std::sync::Arc; /// A number from 1 to 100, indicating the percentage of the animation where diff --git a/components/style/logical_geometry.rs b/components/style/logical_geometry.rs index 71a7dda8bc7..0bf47cbc575 100644 --- a/components/style/logical_geometry.rs +++ b/components/style/logical_geometry.rs @@ -4,9 +4,9 @@ //! Geometry in flow-relative space. +use euclid::{Point2D, Rect, Size2D}; use euclid::num::Zero; use euclid::side_offsets::SideOffsets2D; -use euclid::{Point2D, Rect, Size2D}; use std::cmp::{max, min}; use std::fmt::{self, Debug, Error, Formatter}; use std::ops::{Add, Sub}; diff --git a/components/style/matching.rs b/components/style/matching.rs index 223c09f28c1..4edf85d1d3c 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -10,16 +10,16 @@ use animation; use arc_ptr_eq; use cache::{LRUCache, SimpleHashCache}; use cascade_info::CascadeInfo; -use context::{StyleContext, SharedStyleContext}; +use context::{SharedStyleContext, StyleContext}; use data::PrivateStyleData; use dom::{TElement, TNode, TRestyleDamage, UnsafeNode}; +use properties::{ComputedValues, PropertyDeclarationBlock, cascade}; use properties::longhands::display::computed_value as display; -use properties::{ComputedValues, cascade, PropertyDeclarationBlock}; -use selector_impl::{TheSelectorImpl, PseudoElement}; +use selector_impl::{PseudoElement, TheSelectorImpl}; use selector_matching::{ApplicableDeclarationBlock, Stylist}; -use selectors::bloom::BloomFilter; -use selectors::matching::{MatchingReason, StyleRelations, AFFECTED_BY_PSEUDO_ELEMENTS}; use selectors::{Element, MatchAttr}; +use selectors::bloom::BloomFilter; +use selectors::matching::{AFFECTED_BY_PSEUDO_ELEMENTS, MatchingReason, StyleRelations}; use sink::ForgetfulSink; use smallvec::SmallVec; use std::collections::HashMap; diff --git a/components/style/restyle_hints.rs b/components/style/restyle_hints.rs index 2801b17e368..1471f451843 100644 --- a/components/style/restyle_hints.rs +++ b/components/style/restyle_hints.rs @@ -7,11 +7,11 @@ use element_state::*; #[cfg(feature = "servo")] use heapsize::HeapSizeOf; -use selector_impl::{ElementExt, TheSelectorImpl, NonTSPseudoClass, AttrValue}; -use selectors::matching::matches_complex_selector; -use selectors::matching::{MatchingReason, StyleRelations}; -use selectors::parser::{AttrSelector, Combinator, ComplexSelector, SimpleSelector, SelectorImpl}; +use selector_impl::{AttrValue, ElementExt, NonTSPseudoClass, TheSelectorImpl}; use selectors::{Element, MatchAttr}; +use selectors::matching::{MatchingReason, StyleRelations}; +use selectors::matching::matches_complex_selector; +use selectors::parser::{AttrSelector, Combinator, ComplexSelector, SelectorImpl, SimpleSelector}; use std::clone::Clone; use std::sync::Arc; use string_cache::Atom; diff --git a/components/style/servo_selector_impl.rs b/components/style/servo_selector_impl.rs index 81079f4a416..f54ef9f3870 100644 --- a/components/style/servo_selector_impl.rs +++ b/components/style/servo_selector_impl.rs @@ -7,9 +7,9 @@ use cssparser::ToCss; use element_state::ElementState; use restyle_hints::ElementSnapshot; use selector_impl::{ElementExt, PseudoElementCascadeType, TheSelectorImpl}; -use selector_impl::{attr_exists_selector_is_shareable, attr_equals_selector_is_shareable}; -use selectors::parser::{AttrSelector, ParserContext, SelectorImpl}; +use selector_impl::{attr_equals_selector_is_shareable, attr_exists_selector_is_shareable}; use selectors::{Element, MatchAttrGeneric}; +use selectors::parser::{AttrSelector, ParserContext, SelectorImpl}; use std::fmt; use string_cache::{Atom, Namespace}; diff --git a/components/style/stylesheets.rs b/components/style/stylesheets.rs index c2de24847da..56bd8e88944 100644 --- a/components/style/stylesheets.rs +++ b/components/style/stylesheets.rs @@ -269,9 +269,9 @@ pub mod rule_filter { //! Specific `CSSRule` variant iterators. use std::marker::PhantomData; + use super::{CSSRule, KeyframesRule, MediaRule, StyleRule}; use super::super::font_face::FontFaceRule; use super::super::viewport::ViewportRule; - use super::{CSSRule, KeyframesRule, MediaRule, StyleRule}; macro_rules! rule_filter { ($variant:ident -> $value:ty) => { diff --git a/components/style/values/computed/basic_shape.rs b/components/style/values/computed/basic_shape.rs index 8ea013af073..f9dd1f6609d 100644 --- a/components/style/values/computed/basic_shape.rs +++ b/components/style/values/computed/basic_shape.rs @@ -11,9 +11,9 @@ use cssparser::ToCss; use properties::shorthands::serialize_four_sides; use std::fmt; use url::Url; +use values::computed::{BorderRadiusSize, LengthOrPercentage}; use values::computed::UrlExtraData; use values::computed::position::Position; -use values::computed::{BorderRadiusSize, LengthOrPercentage}; pub use values::specified::basic_shape::{FillRule, GeometryBox, ShapeBox}; diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index 7c13e1811e2..7abdf9fa1ac 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -7,10 +7,11 @@ use euclid::size::Size2D; use ordered_float::NotNaN; use properties::ComputedValues; use std::fmt; +use super::{CSSFloat, specified}; use super::LocalToCss; use super::specified::AngleOrCorner; -use super::{CSSFloat, specified}; use url::Url; + pub use cssparser::Color as CSSColor; pub use super::specified::{Angle, BorderStyle, Time, UrlExtraData}; diff --git a/components/style/values/specified/basic_shape.rs b/components/style/values/specified/basic_shape.rs index 11da6b80598..2ff53a5c08f 100644 --- a/components/style/values/specified/basic_shape.rs +++ b/components/style/values/specified/basic_shape.rs @@ -8,15 +8,15 @@ //! [basic-shape]: https://drafts.csswg.org/css-shapes/#typedef-basic-shape use cssparser::{Parser, ToCss}; -use parser::{ParserContext, Parse}; +use parser::{Parse, ParserContext}; use properties::shorthands::{parse_four_sides, serialize_four_sides}; use std::fmt; use url::Url; +use values::computed::{ComputedValueAsSpecified, Context, ToComputedValue}; use values::computed::basic_shape as computed_basic_shape; -use values::computed::{Context, ToComputedValue, ComputedValueAsSpecified}; +use values::specified::{BorderRadiusSize, LengthOrPercentage, Percentage}; use values::specified::UrlExtraData; use values::specified::position::{Keyword, Position}; -use values::specified::{BorderRadiusSize, LengthOrPercentage, Percentage}; /// A shape source, for some reference box /// diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index b0d02669154..14cd7cccd0e 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -16,8 +16,8 @@ use std::f32::consts::PI; use std::fmt; use std::ops::Mul; use style_traits::values::specified::AllowedNumericType; -use super::computed::{self, Context, ToComputedValue}; use super::{CSSFloat, FONT_MEDIUM_PX, HasViewportPercentage, LocalToCss, NoViewportPercentage}; +use super::computed::{self, Context, ToComputedValue}; use url::Url; pub mod basic_shape; diff --git a/components/style/values/specified/position.rs b/components/style/values/specified/position.rs index 6b0086b41ff..7ade88663b5 100644 --- a/components/style/values/specified/position.rs +++ b/components/style/values/specified/position.rs @@ -10,9 +10,9 @@ use cssparser::{Parser, ToCss, Token}; use std::fmt; use values::HasViewportPercentage; -use values::computed::position as computed_position; use values::computed::{CalcLengthOrPercentage, Context}; use values::computed::{LengthOrPercentage as ComputedLengthOrPercentage, ToComputedValue}; +use values::computed::position as computed_position; use values::specified::{LengthOrPercentage, Percentage}; #[derive(Debug, Clone, PartialEq, Copy)] diff --git a/components/style/viewport.rs b/components/style/viewport.rs index 0ab1819b6e5..ef89484b21a 100644 --- a/components/style/viewport.rs +++ b/components/style/viewport.rs @@ -8,8 +8,8 @@ //! [meta]: https://drafts.csswg.org/css-device-adapt/#viewport-meta use app_units::Au; -use cssparser::ToCss; use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser, parse_important}; +use cssparser::ToCss; use euclid::scale_factor::ScaleFactor; use euclid::size::{Size2D, TypedSize2D}; use parser::{ParserContext, log_css_error}; diff --git a/components/style_traits/viewport.rs b/components/style_traits/viewport.rs index 9e76013934a..22c21afcecc 100644 --- a/components/style_traits/viewport.rs +++ b/components/style_traits/viewport.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 {PagePx, ViewportPx}; use cssparser::{Parser, ToCss}; use euclid::scale_factor::ScaleFactor; use euclid::size::TypedSize2D; use std::ascii::AsciiExt; use std::fmt; use values::specified::AllowedNumericType; -use {PagePx, ViewportPx}; define_css_keyword_enum!(UserZoom: "zoom" => Zoom, diff --git a/components/util/remutex.rs b/components/util/remutex.rs index ec1c27a3d1a..02dcd884bcd 100644 --- a/components/util/remutex.rs +++ b/components/util/remutex.rs @@ -14,8 +14,8 @@ use core::nonzero::NonZero; use std::cell::{Cell, UnsafeCell}; use std::mem; use std::ops::Deref; -use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{LockResult, Mutex, MutexGuard, PoisonError, TryLockError, TryLockResult}; +use std::sync::atomic::{AtomicUsize, Ordering}; /// A type for thread ids. diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs index f1460f1540d..3206af03a32 100644 --- a/components/webdriver_server/lib.rs +++ b/components/webdriver_server/lib.rs @@ -34,13 +34,13 @@ use image::{DynamicImage, ImageFormat, RgbImage}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use keys::keycodes_to_keys; use msg::constellation_msg::{FrameId, LoadData, PipelineId}; -use msg::constellation_msg::{TraversalDirection, PixelFormat}; +use msg::constellation_msg::{PixelFormat, TraversalDirection}; use regex::Captures; use rustc_serialize::base64::{CharacterSet, Config, Newline, ToBase64}; use rustc_serialize::json::{Json, ToJson}; +use script_traits::{ConstellationMsg, WebDriverCommandMsg}; use script_traits::webdriver_msg::{LoadStatus, WebDriverCookieError, WebDriverFrameId}; use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult, WebDriverScriptCommand}; -use script_traits::{ConstellationMsg, WebDriverCommandMsg}; use std::borrow::ToOwned; use std::collections::BTreeMap; use std::net::{SocketAddr, SocketAddrV4}; @@ -51,11 +51,11 @@ use url::Url; use util::prefs::{PREFS, PrefValue}; use util::thread::spawn_named; use uuid::Uuid; -use webdriver::command::WindowSizeParameters; use webdriver::command::{AddCookieParameters, GetParameters, JavascriptCommandParameters}; use webdriver::command::{LocatorParameters, Parameters}; use webdriver::command::{SendKeysParameters, SwitchToFrameParameters, TimeoutsParameters}; use webdriver::command::{WebDriverCommand, WebDriverExtensionCommand, WebDriverMessage}; +use webdriver::command::WindowSizeParameters; use webdriver::common::{Date, LocatorStrategy, Nullable, WebElement}; use webdriver::error::{ErrorStatus, WebDriverError, WebDriverResult}; use webdriver::httpapi::WebDriverExtensionRoute; diff --git a/ports/geckolib/data.rs b/ports/geckolib/data.rs index 6b279510982..657084f3665 100644 --- a/ports/geckolib/data.rs +++ b/ports/geckolib/data.rs @@ -9,8 +9,8 @@ use num_cpus; use std::cmp; use std::collections::HashMap; use std::env; -use std::sync::mpsc::{channel, Receiver, Sender}; use std::sync::{Arc, RwLock}; +use std::sync::mpsc::{Receiver, Sender, channel}; use style::animation::Animation; use style::context::SharedStyleContext; use style::dom::OpaqueNode; diff --git a/ports/geckolib/gecko_bindings/sugar/ns_css_shadow_array.rs b/ports/geckolib/gecko_bindings/sugar/ns_css_shadow_array.rs index 6c0a0e6dc03..8537ad78a5f 100644 --- a/ports/geckolib/gecko_bindings/sugar/ns_css_shadow_array.rs +++ b/ports/geckolib/gecko_bindings/sugar/ns_css_shadow_array.rs @@ -5,9 +5,9 @@ use bindings::Gecko_AddRefCSSShadowArrayArbitraryThread; use bindings::Gecko_NewCSSShadowArray; use bindings::Gecko_ReleaseCSSShadowArrayArbitraryThread; -use std::ops::{Deref, DerefMut}; use std::{ptr, slice}; -use structs::{nsCSSShadowArray, nsCSSShadowItem, RefPtr}; +use std::ops::{Deref, DerefMut}; +use structs::{RefPtr, nsCSSShadowArray, nsCSSShadowItem}; impl RefPtr<nsCSSShadowArray> { pub fn replace_with_new(&mut self, len: u32) { diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 685d594d0e7..0f071662e8d 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -8,7 +8,6 @@ use app_units::Au; use data::{NUM_THREADS, PerDocumentStyleData}; use env_logger; use euclid::Size2D; -use gecko_bindings::bindings::RawGeckoDocumentBorrowed; use gecko_bindings::bindings::{RawGeckoDocument, RawGeckoElement, RawGeckoNode}; use gecko_bindings::bindings::{RawGeckoElementBorrowed, RawGeckoNodeBorrowed}; use gecko_bindings::bindings::{RawServoStyleSet, RawServoStyleSetBorrowedMut}; @@ -18,20 +17,21 @@ use gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedValuesStro use gecko_bindings::bindings::{ServoComputedValuesBorrowedOrNull, ServoDeclarationBlock}; use gecko_bindings::bindings::{ServoDeclarationBlockBorrowed, ServoDeclarationBlockStrong}; use gecko_bindings::bindings::{ThreadSafePrincipalHolder, ThreadSafeURIHolder, nsHTMLCSSStyleSheet}; +use gecko_bindings::bindings::RawGeckoDocumentBorrowed; use gecko_bindings::ptr::{GeckoArcPrincipal, GeckoArcURI}; +use gecko_bindings::structs::{SheetParsingMode, nsIAtom}; use gecko_bindings::structs::ServoElementSnapshot; use gecko_bindings::structs::nsRestyleHint; -use gecko_bindings::structs::{SheetParsingMode, nsIAtom}; use gecko_bindings::sugar::ownership::{FFIArcHelpers, HasArcFFI, HasBoxFFI}; -use gecko_bindings::sugar::ownership::{HasSimpleFFI, HasFFI, Strong}; +use gecko_bindings::sugar::ownership::{HasFFI, HasSimpleFFI, Strong}; use gecko_string_cache::Atom; use snapshot::GeckoElementSnapshot; use std::mem::transmute; use std::ptr; use std::slice; use std::str::from_utf8_unchecked; -use std::sync::atomic::{AtomicBool, AtomicPtr, Ordering}; use std::sync::{Arc, Mutex}; +use std::sync::atomic::{AtomicBool, AtomicPtr, Ordering}; use style::arc_ptr_eq; use style::context::{LocalStyleContextCreationInfo, ReflowGoal, SharedStyleContext}; use style::dom::{TDocument, TElement, TNode}; @@ -42,7 +42,7 @@ use style::parser::ParserContextExtraData; use style::properties::{ComputedValues, PropertyDeclarationBlock, parse_one_declaration}; use style::selector_impl::PseudoElementCascadeType; use style::sequential; -use style::stylesheets::{Stylesheet, Origin}; +use style::stylesheets::{Origin, Stylesheet}; use style::timer::Timer; use traversal::RecalcStyleOnly; use url::Url; diff --git a/ports/geckolib/string_cache/namespace.rs b/ports/geckolib/string_cache/namespace.rs index d3d57285b5a..0884617725e 100644 --- a/ports/geckolib/string_cache/namespace.rs +++ b/ports/geckolib/string_cache/namespace.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 {Atom, WeakAtom}; use gecko_bindings::structs::nsIAtom; use selectors::bloom::BloomHash; use std::borrow::Borrow; use std::fmt; use std::ops::Deref; -use {Atom, WeakAtom}; #[macro_export] macro_rules! ns { diff --git a/ports/geckolib/traversal.rs b/ports/geckolib/traversal.rs index 118c4688c83..b342b8bd2a5 100644 --- a/ports/geckolib/traversal.rs +++ b/ports/geckolib/traversal.rs @@ -6,8 +6,8 @@ use context::StandaloneStyleContext; use std::mem; use style::context::{LocalStyleContext, SharedStyleContext, StyleContext}; use style::dom::OpaqueNode; -use style::traversal::RestyleResult; use style::traversal::{DomTraversalContext, recalc_style_at}; +use style::traversal::RestyleResult; use wrapper::GeckoNode; pub struct RecalcStyleOnly<'lc> { diff --git a/ports/geckolib/wrapper.rs b/ports/geckolib/wrapper.rs index ee731c8ad48..adf8ba007bd 100644 --- a/ports/geckolib/wrapper.rs +++ b/ports/geckolib/wrapper.rs @@ -5,10 +5,6 @@ #![allow(unsafe_code)] use gecko_bindings::bindings; -use gecko_bindings::bindings::Gecko_ClassOrClassList; -use gecko_bindings::bindings::Gecko_GetNodeData; -use gecko_bindings::bindings::Gecko_GetStyleContext; -use gecko_bindings::bindings::ServoNodeData; use gecko_bindings::bindings::{Gecko_CalcStyleDifference, Gecko_StoreStyleDifference}; use gecko_bindings::bindings::{Gecko_DropStyleChildrenIterator, Gecko_MaybeCreateStyleChildrenIterator}; use gecko_bindings::bindings::{Gecko_ElementState, Gecko_GetDocumentElement}; @@ -24,10 +20,14 @@ use gecko_bindings::bindings::{Gecko_IsUnvisitedLink, Gecko_IsVisitedLink}; use gecko_bindings::bindings::{Gecko_LocalName, Gecko_Namespace, Gecko_NodeIsElement, Gecko_SetNodeData}; use gecko_bindings::bindings::{RawGeckoDocument, RawGeckoElement, RawGeckoNode}; use gecko_bindings::bindings::{RawGeckoElementBorrowed, RawGeckoNodeBorrowed}; +use gecko_bindings::bindings::Gecko_ClassOrClassList; +use gecko_bindings::bindings::Gecko_GetNodeData; +use gecko_bindings::bindings::Gecko_GetStyleContext; +use gecko_bindings::bindings::ServoNodeData; use gecko_bindings::structs::{NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO, NODE_IS_DIRTY_FOR_SERVO}; -use gecko_bindings::structs::{nsIAtom, nsChangeHint, nsStyleContext}; +use gecko_bindings::structs::{nsChangeHint, nsIAtom, nsStyleContext}; +use gecko_bindings::sugar::ownership::{FFIArcHelpers, HasBoxFFI, HasFFI, HasSimpleFFI}; use gecko_bindings::sugar::ownership::Borrowed; -use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI, FFIArcHelpers}; use gecko_string_cache::{Atom, Namespace, WeakAtom, WeakNamespace}; use glue::GeckoDeclarationBlock; use libc::uintptr_t; @@ -47,8 +47,8 @@ use style::element_state::ElementState; use style::error_reporting::StdoutErrorReporter; use style::gecko_selector_impl::{GeckoSelectorImpl, NonTSPseudoClass, PseudoElement}; use style::parser::ParserContextExtraData; -use style::properties::PropertyDeclarationBlock; use style::properties::{ComputedValues, parse_style_attribute}; +use style::properties::PropertyDeclarationBlock; use style::refcell::{Ref, RefCell, RefMut}; use style::selector_impl::ElementExt; use style::selector_matching::ApplicableDeclarationBlock; diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index c6904de3fe4..58e055e3c40 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -8,37 +8,40 @@ use NestedEventLoopListener; use compositing::compositor_thread::{self, CompositorProxy, CompositorReceiver}; use compositing::windowing::{MouseWindowEvent, WindowNavigateMsg}; use compositing::windowing::{WindowEvent, WindowMethods}; +use euclid::{Point2D, Size2D, TypedPoint2D}; use euclid::scale_factor::ScaleFactor; use euclid::size::TypedSize2D; -use euclid::{Size2D, Point2D, TypedPoint2D}; -#[cfg(target_os = "windows")] use gdi32; +#[cfg(target_os = "windows")] +use gdi32; use gleam::gl; use glutin; +use glutin::{Api, ElementState, Event, GlRequest, MouseButton, MouseScrollDelta, VirtualKeyCode}; +use glutin::{ScanCode, TouchPhase}; #[cfg(target_os = "macos")] use glutin::os::macos::{ActivationPolicy, WindowBuilderExt}; -use glutin::{Api, ElementState, Event, GlRequest, MouseButton, VirtualKeyCode, MouseScrollDelta}; -use glutin::{ScanCode, TouchPhase}; use layers::geometry::DevicePixel; use layers::platform::surface::NativeDisplay; -use msg::constellation_msg::{KeyState, NONE, CONTROL, SHIFT, ALT, SUPER}; use msg::constellation_msg::{self, Key}; +use msg::constellation_msg::{ALT, CONTROL, KeyState, NONE, SHIFT, SUPER}; use net_traits::net_error_list::NetError; use script_traits::{TouchEventType, TouchpadPressurePhase}; use std::cell::{Cell, RefCell}; #[cfg(not(target_os = "android"))] use std::os::raw::c_void; use std::rc::Rc; -use std::sync::mpsc::{channel, Sender}; +use std::sync::mpsc::{Sender, channel}; use style_traits::cursor::Cursor; use url::Url; -#[cfg(target_os = "windows")] use user32; +#[cfg(target_os = "windows")] +use user32; use util::geometry::ScreenPx; use util::opts; #[cfg(not(target_os = "android"))] use util::opts::RenderApi; use util::prefs::PREFS; use util::resource_files; -#[cfg(target_os = "windows")] use winapi; +#[cfg(target_os = "windows")] +use winapi; static mut g_nested_event_loop_listener: Option<*mut (NestedEventLoopListener + 'static)> = None; diff --git a/tests/unit/net/data_loader.rs b/tests/unit/net/data_loader.rs index 2916cb7e30c..663d9390a40 100644 --- a/tests/unit/net/data_loader.rs +++ b/tests/unit/net/data_loader.rs @@ -8,11 +8,11 @@ extern crate hyper_serde; use hyper_serde::Serde; use ipc_channel::ipc; use msg::constellation_msg::{PipelineId, ReferrerPolicy}; +use net_traits::{LoadContext, LoadData, LoadOrigin, NetworkError}; use net_traits::LoadConsumer::Channel; -use net_traits::ProgressMsg::{Payload, Done}; -use net_traits::{LoadData, LoadContext, NetworkError, LoadOrigin}; +use net_traits::ProgressMsg::{Done, Payload}; use self::hyper::header::ContentType; -use self::hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use self::hyper::mime::{Attr, Mime, SubLevel, TopLevel, Value}; use url::Url; struct DataLoadTest; diff --git a/tests/unit/net/fetch.rs b/tests/unit/net/fetch.rs index a99e4236def..571ad2cee71 100644 --- a/tests/unit/net/fetch.rs +++ b/tests/unit/net/fetch.rs @@ -8,13 +8,13 @@ use devtools_traits::HttpResponse as DevtoolsHttpResponse; use http_loader::{expect_devtools_http_request, expect_devtools_http_response}; use hyper::LanguageTag; use hyper::header::{Accept, AccessControlAllowCredentials, AccessControlAllowHeaders, AccessControlAllowOrigin}; -use hyper::header::{AccessControlAllowMethods, AccessControlMaxAge, AcceptLanguage, AcceptEncoding}; -use hyper::header::{AccessControlRequestHeaders, AccessControlRequestMethod, UserAgent, Date}; +use hyper::header::{AcceptEncoding, AcceptLanguage, AccessControlAllowMethods, AccessControlMaxAge}; +use hyper::header::{AccessControlRequestHeaders, AccessControlRequestMethod, Date, UserAgent}; use hyper::header::{CacheControl, ContentLanguage, ContentLength, ContentType, Expires, LastModified}; -use hyper::header::{Headers, HttpDate, Host, Referer as HyperReferer}; -use hyper::header::{Location, SetCookie, Pragma, Encoding, qitem}; +use hyper::header::{Encoding, Location, Pragma, SetCookie, qitem}; +use hyper::header::{Headers, Host, HttpDate, Referer as HyperReferer}; use hyper::method::Method; -use hyper::mime::{Mime, TopLevel, SubLevel}; +use hyper::mime::{Mime, SubLevel, TopLevel}; use hyper::server::{Handler, Listening, Server}; use hyper::server::{Request as HyperRequest, Response as HyperResponse}; use hyper::status::StatusCode; @@ -29,9 +29,9 @@ use net_traits::response::{CacheState, Response, ResponseBody, ResponseType}; use std::fs::File; use std::io::Read; use std::rc::Rc; +use std::sync::{Arc, Mutex}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::{Sender, channel}; -use std::sync::{Arc, Mutex}; use std::thread; use time::{self, Duration}; use unicase::UniCase; diff --git a/tests/unit/net/hsts.rs b/tests/unit/net/hsts.rs index 6d310d25aea..864d335868c 100644 --- a/tests/unit/net/hsts.rs +++ b/tests/unit/net/hsts.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 net::hsts::{HstsEntry, HstsList}; use net::hsts::secure_url; -use net::hsts::{HstsList, HstsEntry}; use net_traits::IncludeSubdomains; use time; use url::Url; diff --git a/tests/unit/net/http_loader.rs b/tests/unit/net/http_loader.rs index 7264f108011..15bd6b8fd25 100644 --- a/tests/unit/net/http_loader.rs +++ b/tests/unit/net/http_loader.rs @@ -4,15 +4,15 @@ use content_blocker::parse_list; use cookie_rs::Cookie as CookiePair; +use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg, NetworkEvent}; use devtools_traits::HttpRequest as DevtoolsHttpRequest; use devtools_traits::HttpResponse as DevtoolsHttpResponse; -use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg, NetworkEvent}; use flate2::Compression; -use flate2::write::{GzEncoder, DeflateEncoder}; +use flate2::write::{DeflateEncoder, GzEncoder}; use hyper::LanguageTag; use hyper::header::{Accept, AcceptEncoding, ContentEncoding, ContentLength, Cookie as CookieHeader}; -use hyper::header::{Authorization, AcceptLanguage, Basic}; -use hyper::header::{Encoding, Headers, Host, Location, Quality, QualityItem, qitem, Referer, SetCookie}; +use hyper::header::{AcceptLanguage, Authorization, Basic}; +use hyper::header::{Encoding, Headers, Host, Location, Quality, QualityItem, Referer, SetCookie, qitem}; use hyper::header::{StrictTransportSecurity, UserAgent}; use hyper::http::RawStatus; use hyper::method::Method; @@ -22,15 +22,15 @@ use msg::constellation_msg::{PipelineId, ReferrerPolicy}; use net::cookie::Cookie; use net::cookie_storage::CookieStorage; use net::hsts::HstsEntry; -use net::http_loader::{LoadErrorType, HttpResponse}; -use net::http_loader::{load, LoadError, HttpRequestFactory, HttpRequest, UIProvider, HttpState}; +use net::http_loader::{HttpRequest, HttpRequestFactory, HttpState, LoadError, UIProvider, load}; +use net::http_loader::{HttpResponse, LoadErrorType}; use net::resource_thread::{AuthCacheEntry, CancellationListener}; -use net_traits::{CustomResponse, Metadata, LoadOrigin}; -use net_traits::{LoadData, CookieSource, LoadContext, IncludeSubdomains}; +use net_traits::{CookieSource, IncludeSubdomains, LoadContext, LoadData}; +use net_traits::{CustomResponse, LoadOrigin, Metadata}; use std::borrow::Cow; -use std::io::{self, Write, Read, Cursor}; +use std::io::{self, Cursor, Read, Write}; +use std::sync::{Arc, RwLock, mpsc}; use std::sync::mpsc::Receiver; -use std::sync::{Arc, mpsc, RwLock}; use std::thread; use url::Url; use util::prefs::{self, PREFS}; diff --git a/tests/unit/net/mime_classifier.rs b/tests/unit/net/mime_classifier.rs index c5635e06a53..0d08c07d664 100644 --- a/tests/unit/net/mime_classifier.rs +++ b/tests/unit/net/mime_classifier.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 net::mime_classifier::{ApacheBugFlag, MimeClassifier, Mp4Matcher, NoSniffFlag}; use net::mime_classifier::as_string_option; -use net::mime_classifier::{Mp4Matcher, MimeClassifier, ApacheBugFlag, NoSniffFlag}; use net_traits::LoadContext; use std::env; use std::fs::File; @@ -557,4 +557,3 @@ fn test_sniff_mp4_video_apache_flag_on() { NoSniffFlag::OFF, ApacheBugFlag::ON); } - diff --git a/tests/unit/net/resource_thread.rs b/tests/unit/net/resource_thread.rs index b6da4f4f524..8d5c1a0f90f 100644 --- a/tests/unit/net/resource_thread.rs +++ b/tests/unit/net/resource_thread.rs @@ -5,9 +5,9 @@ use ipc_channel::ipc; use msg::constellation_msg::{PipelineId, ReferrerPolicy}; use net::resource_thread::new_core_resource_thread; -use net_traits::hosts::{parse_hostsfile, host_replacement}; -use net_traits::{CoreResourceMsg, LoadData, LoadConsumer, LoadContext}; -use net_traits::{NetworkError, ProgressMsg, LoadOrigin}; +use net_traits::{CoreResourceMsg, LoadConsumer, LoadContext, LoadData}; +use net_traits::{LoadOrigin, NetworkError, ProgressMsg}; +use net_traits::hosts::{host_replacement, parse_hostsfile}; use profile_traits::time::ProfilerChan; use std::borrow::ToOwned; use std::collections::HashMap; diff --git a/tests/unit/script/textinput.rs b/tests/unit/script/textinput.rs index 01d8931ff67..b276b0da058 100644 --- a/tests/unit/script/textinput.rs +++ b/tests/unit/script/textinput.rs @@ -7,11 +7,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use msg::constellation_msg::{Key, KeyModifiers}; #[cfg(not(target_os = "macos"))] use msg::constellation_msg::CONTROL; #[cfg(target_os = "macos")] use msg::constellation_msg::SUPER; -use msg::constellation_msg::{Key, KeyModifiers}; use script::clipboard_provider::DummyClipboardContext; use script::dom::bindings::str::DOMString; use script::textinput::{TextInput, TextPoint, Selection, Lines, Direction, SelectionDirection}; diff --git a/tests/unit/style/properties/viewport.rs b/tests/unit/style/properties/viewport.rs index 585d55b581a..4964373c7d8 100644 --- a/tests/unit/style/properties/viewport.rs +++ b/tests/unit/style/properties/viewport.rs @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use app_units::Au; -use style::properties::longhands::border_top_width; use style::properties::{DeclaredValue, PropertyDeclaration}; +use style::properties::longhands::border_top_width; use style::values::HasViewportPercentage; use style::values::specified::{Length, ViewportPercentageLength}; |