aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout
diff options
context:
space:
mode:
authorJohann Tuffe <tafia973@gmail.com>2015-08-20 20:47:12 +0800
committerJohann Tuffe <tafia973@gmail.com>2015-08-20 20:47:12 +0800
commitec07178b6fc5a0ab559eb191952101cf92b5d666 (patch)
treef7550ec6d7623b57b29d3030686f4fdb609f0b36 /components/layout
parentd3c7e31722fb194f1a266eec9ae57d2f2557e7a6 (diff)
downloadservo-ec07178b6fc5a0ab559eb191952101cf92b5d666.tar.gz
servo-ec07178b6fc5a0ab559eb191952101cf92b5d666.zip
sort all uses
Diffstat (limited to 'components/layout')
-rw-r--r--components/layout/block.rs12
-rw-r--r--components/layout/construct.rs6
-rw-r--r--components/layout/context.rs4
-rw-r--r--components/layout/css/matching.rs2
-rw-r--r--components/layout/display_list_builder.rs8
-rw-r--r--components/layout/floats.rs8
-rw-r--r--components/layout/flow.rs2
-rw-r--r--components/layout/flow_ref.rs2
-rw-r--r--components/layout/fragment.rs4
-rw-r--r--components/layout/generated_content.rs2
-rw-r--r--components/layout/inline.rs6
-rw-r--r--components/layout/layout_debug.rs4
-rw-r--r--components/layout/layout_task.rs16
-rw-r--r--components/layout/list_item.rs6
-rw-r--r--components/layout/multicol.rs6
-rw-r--r--components/layout/parallel.rs6
-rw-r--r--components/layout/query.rs4
-rw-r--r--components/layout/sequential.rs6
-rw-r--r--components/layout/table.rs6
-rw-r--r--components/layout/table_caption.rs6
-rw-r--r--components/layout/table_cell.rs2
-rw-r--r--components/layout/table_colgroup.rs6
-rw-r--r--components/layout/table_row.rs2
-rw-r--r--components/layout/table_wrapper.rs4
-rw-r--r--components/layout/traversal.rs6
-rw-r--r--components/layout/wrapper.rs18
26 files changed, 77 insertions, 77 deletions
diff --git a/components/layout/block.rs b/components/layout/block.rs
index 9580f1cd6a5..abc169ef1e8 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -31,14 +31,14 @@ use context::LayoutContext;
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
use display_list_builder::{FragmentDisplayListBuilding};
use floats::{ClearType, FloatKind, Floats, PlacementInfo};
-use flow::{self, AbsolutePositionInfo, BaseFlow, ForceNonfloatedFlag, FlowClass, Flow};
-use flow::{ImmutableFlowUtils, MutableFlowUtils, OpaqueFlow, PreorderFlowTraversal};
-use flow::{PostorderFlowTraversal, mut_base};
use flow::{BLOCK_POSITION_IS_STATIC, HAS_LEFT_FLOATED_DESCENDANTS, HAS_RIGHT_FLOATED_DESCENDANTS};
+use flow::{CLEARS_LEFT, CLEARS_RIGHT};
use flow::{IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS, INLINE_POSITION_IS_STATIC};
-use flow::{LAYERS_NEEDED_FOR_DESCENDANTS, NEEDS_LAYER};
use flow::{IS_ABSOLUTELY_POSITIONED};
-use flow::{CLEARS_LEFT, CLEARS_RIGHT};
+use flow::{ImmutableFlowUtils, MutableFlowUtils, OpaqueFlow, PreorderFlowTraversal};
+use flow::{LAYERS_NEEDED_FOR_DESCENDANTS, NEEDS_LAYER};
+use flow::{PostorderFlowTraversal, mut_base};
+use flow::{self, AbsolutePositionInfo, BaseFlow, ForceNonfloatedFlag, FlowClass, Flow};
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
use layout_debug;
@@ -56,8 +56,8 @@ use std::sync::Arc;
use style::computed_values::{border_collapse, box_sizing, display, float, overflow_x, overflow_y};
use style::computed_values::{transform, transform_style, position, text_align};
use style::properties::ComputedValues;
-use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
use style::values::computed::{LengthOrNone, LengthOrPercentageOrNone};
+use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
use util::geometry::{Au, MAX_AU, MAX_RECT};
use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
use util::opts;
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index 60a547094b0..a53f0d0b209 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -17,11 +17,11 @@ use block::BlockFlow;
use context::LayoutContext;
use data::{HAS_NEWLY_CONSTRUCTED_FLOW, LayoutDataWrapper};
use floats::FloatKind;
-use flow::{self, AbsoluteDescendants, Flow, ImmutableFlowUtils, IS_ABSOLUTELY_POSITIONED};
use flow::{MutableFlowUtils, MutableOwnedFlowUtils};
+use flow::{self, AbsoluteDescendants, Flow, ImmutableFlowUtils, IS_ABSOLUTELY_POSITIONED};
use flow_ref::FlowRef;
-use fragment::{Fragment, GeneratedContentInfo, IframeFragmentInfo};
use fragment::{CanvasFragmentInfo, ImageFragmentInfo, InlineAbsoluteFragmentInfo};
+use fragment::{Fragment, GeneratedContentInfo, IframeFragmentInfo};
use fragment::{InlineAbsoluteHypotheticalFragmentInfo, TableColumnFragmentInfo};
use fragment::{InlineBlockFragmentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo};
use fragment::{WhitespaceStrippingResult};
@@ -1729,8 +1729,8 @@ pub fn strip_ignorable_whitespace_from_end(this: &mut LinkedList<Fragment>) {
/// If the 'unicode-bidi' property has a value other than 'normal', return the bidi control codes
/// to inject before and after the text content of the element.
fn bidi_control_chars(style: &Arc<ComputedValues>) -> Option<(&'static str, &'static str)> {
- use style::computed_values::unicode_bidi::T::*;
use style::computed_values::direction::T::*;
+ use style::computed_values::unicode_bidi::T::*;
let unicode_bidi = style.get_text().unicode_bidi;
let direction = style.get_inheritedbox().direction;
diff --git a/components/layout/context.rs b/components/layout/context.rs
index cfb58ccb3d4..3562fd1dd98 100644
--- a/components/layout/context.rs
+++ b/components/layout/context.rs
@@ -9,13 +9,13 @@
use css::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache};
use canvas_traits::CanvasMsg;
-use msg::compositor_msg::LayerId;
-use fnv::FnvHasher;
use euclid::{Rect, Size2D};
+use fnv::FnvHasher;
use gfx::display_list::OpaqueNode;
use gfx::font_cache_task::FontCacheTask;
use gfx::font_context::FontContext;
use ipc_channel::ipc::{self, IpcSender};
+use msg::compositor_msg::LayerId;
use msg::constellation_msg::ConstellationChan;
use net_traits::image::base::Image;
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageResponse, ImageState};
diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs
index c5a2d86b249..db14af662ec 100644
--- a/components/layout/css/matching.rs
+++ b/components/layout/css/matching.rs
@@ -16,11 +16,11 @@ use wrapper::{LayoutElement, LayoutNode};
use script::dom::characterdata::CharacterDataTypeId;
use script::dom::node::NodeTypeId;
use script::layout_interface::Animation;
-use selectors::{Element};
use selectors::bloom::BloomFilter;
use selectors::matching::{CommonStyleAffectingAttributeMode, CommonStyleAffectingAttributes};
use selectors::matching::{common_style_affecting_attributes, rare_style_affecting_attributes};
use selectors::parser::PseudoElement;
+use selectors::{Element};
use std::borrow::ToOwned;
use std::hash::{Hash, Hasher};
use std::mem;
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs
index 59264e24a8f..2e2ff543650 100644
--- a/components/layout/display_list_builder.rs
+++ b/components/layout/display_list_builder.rs
@@ -22,9 +22,8 @@ use model::{self, MaybeAuto, ToGfxMatrix};
use table_cell::CollapsedBordersForCell;
use canvas_traits::{CanvasMsg, FromLayoutMsg};
-use euclid::{Point2D, Point3D, Rect, Size2D, SideOffsets2D};
use euclid::Matrix4;
-use gfx_traits::color;
+use euclid::{Point2D, Point3D, Rect, Size2D, SideOffsets2D};
use gfx::display_list::{BLUR_INFLATION_FACTOR, BaseDisplayItem, BorderDisplayItem};
use gfx::display_list::{BorderRadii, BoxShadowClipMode, BoxShadowDisplayItem, ClippingRegion};
use gfx::display_list::{DisplayItem, DisplayList, DisplayItemMetadata};
@@ -33,17 +32,18 @@ use gfx::display_list::{GradientStop, ImageDisplayItem, LineDisplayItem};
use gfx::display_list::{OpaqueNode, SolidColorDisplayItem};
use gfx::display_list::{StackingContext, TextDisplayItem, TextOrientation};
use gfx::paint_task::{PaintLayer, THREAD_TINT_COLORS};
+use gfx_traits::color;
use ipc_channel::ipc::{self, IpcSharedMemory};
use msg::compositor_msg::{ScrollPolicy, LayerId};
use msg::constellation_msg::ConstellationChan;
use msg::constellation_msg::Msg as ConstellationMsg;
-use net_traits::image_cache_task::UsePlaceholder;
use net_traits::image::base::{Image, PixelFormat};
+use net_traits::image_cache_task::UsePlaceholder;
use std::cmp;
use std::default::Default;
+use std::f32;
use std::sync::Arc;
use std::sync::mpsc::channel;
-use std::f32;
use style::computed_values::filter::Filter;
use style::computed_values::{background_attachment, background_clip, background_origin};
use style::computed_values::{background_repeat, background_size};
diff --git a/components/layout/floats.rs b/components/layout/floats.rs
index e3028a90f8c..be1947958c3 100644
--- a/components/layout/floats.rs
+++ b/components/layout/floats.rs
@@ -2,14 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+use std::cmp::{max, min};
+use std::fmt;
+use std::i32;
+use style::computed_values::float;
use util::geometry::Au;
use util::logical_geometry::WritingMode;
use util::logical_geometry::{LogicalRect, LogicalSize};
use util::persistent_list::PersistentList;
-use std::cmp::{max, min};
-use std::i32;
-use std::fmt;
-use style::computed_values::float;
/// The kind of float: left or right.
#[derive(Clone, RustcEncodable, Debug, Copy)]
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index 95866d04b5f..e41b19c9bb0 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -35,6 +35,7 @@ use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
use incremental::{self, RECONSTRUCT_FLOW, REFLOW, REFLOW_OUT_OF_FLOW, RestyleDamage};
use inline::InlineFlow;
use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo};
+use multicol::MulticolFlow;
use parallel::FlowParallelInfo;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, TableFlow};
use table_caption::TableCaptionFlow;
@@ -43,7 +44,6 @@ use table_colgroup::TableColGroupFlow;
use table_row::TableRowFlow;
use table_rowgroup::TableRowGroupFlow;
use table_wrapper::TableWrapperFlow;
-use multicol::MulticolFlow;
use wrapper::{PseudoElementType, ThreadSafeLayoutNode};
use euclid::{Point2D, Rect, Size2D};
diff --git a/components/layout/flow_ref.rs b/components/layout/flow_ref.rs
index f120841d2e4..65c07f81f19 100644
--- a/components/layout/flow_ref.rs
+++ b/components/layout/flow_ref.rs
@@ -10,8 +10,8 @@
#![allow(unsafe_code)]
-use flow::{Flow, BaseFlow};
use flow;
+use flow::{Flow, BaseFlow};
use std::mem;
use std::ops::{Deref, DerefMut};
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index bb9a0b82006..542fd5dd416 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -20,10 +20,10 @@ use text;
use wrapper::{PseudoElementType, ThreadSafeLayoutNode};
use euclid::{Point2D, Rect, Size2D};
+use gfx;
use gfx::display_list::{BLUR_INFLATION_FACTOR, OpaqueNode};
use gfx::text::glyph::CharIndex;
use gfx::text::text_run::{TextRun, TextRunSlice};
-use gfx;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::{ConstellationChan, Msg, PipelineId, SubpageId};
use net_traits::image::base::Image;
@@ -44,11 +44,11 @@ use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
use style::values::computed::{LengthOrPercentageOrNone};
use text::TextRunScanner;
use url::Url;
+use util;
use util::geometry::{Au, ZERO_POINT};
use util::logical_geometry::{LogicalRect, LogicalSize, LogicalMargin, WritingMode};
use util::range::*;
use util::str::{is_whitespace, slice_chars};
-use util;
/// Fragments (`struct Fragment`) are the leaves of the layout tree. They cannot position
/// themselves. In general, fragments do not have a simple correspondence with CSS fragments in the
diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs
index 3b65afdbfdd..f512616761b 100644
--- a/components/layout/generated_content.rs
+++ b/components/layout/generated_content.rs
@@ -9,8 +9,8 @@
//! as possible.
use context::LayoutContext;
-use flow::{self, AFFECTS_COUNTERS, Flow, HAS_COUNTER_AFFECTING_CHILDREN, ImmutableFlowUtils};
use flow::{InorderFlowTraversal};
+use flow::{self, AFFECTS_COUNTERS, Flow, HAS_COUNTER_AFFECTING_CHILDREN, ImmutableFlowUtils};
use fragment::{Fragment, GeneratedContentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo};
use incremental::{self, RESOLVE_GENERATED_CONTENT};
use smallvec::SmallVec;
diff --git a/components/layout/inline.rs b/components/layout/inline.rs
index d06489ea3bd..3a23634aa40 100644
--- a/components/layout/inline.rs
+++ b/components/layout/inline.rs
@@ -8,8 +8,8 @@ use block::{AbsoluteAssignBSizesTraversal, AbsoluteStoreOverflowTraversal};
use context::LayoutContext;
use display_list_builder::{FragmentDisplayListBuilding, InlineFlowDisplayListBuilding};
use floats::{FloatKind, Floats, PlacementInfo};
-use flow::{self, BaseFlow, FlowClass, Flow, ForceNonfloatedFlag, IS_ABSOLUTELY_POSITIONED};
use flow::{MutableFlowUtils, OpaqueFlow};
+use flow::{self, BaseFlow, FlowClass, Flow, ForceNonfloatedFlag, IS_ABSOLUTELY_POSITIONED};
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW, RESOLVE_GENERATED_CONTENT};
use layout_debug;
@@ -24,17 +24,17 @@ use gfx::font_context::FontContext;
use std::cmp::max;
use std::collections::VecDeque;
use std::fmt;
+use std::isize;
use std::mem;
use std::sync::Arc;
-use std::isize;
use style::computed_values::{display, overflow_x, position, text_align, text_justify};
use style::computed_values::{text_overflow, vertical_align, white_space};
use style::properties::ComputedValues;
use unicode_bidi;
+use util;
use util::geometry::{Au, MAX_AU, ZERO_RECT};
use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
use util::range::{Range, RangeIndex};
-use util;
// From gfxFontConstants.h in Firefox
static FONT_SUBSCRIPT_OFFSET_RATIO: f32 = 0.20;
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs
index 26e62780f92..3bc7ef8bf6b 100644
--- a/components/layout/layout_debug.rs
+++ b/components/layout/layout_debug.rs
@@ -7,14 +7,14 @@
#![macro_use]
-use flow_ref::FlowRef;
use flow;
+use flow_ref::FlowRef;
use rustc_serialize::json;
use std::borrow::ToOwned;
use std::cell::RefCell;
-use std::io::Write;
use std::fs::File;
+use std::io::Write;
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None));
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs
index 010bbdd578f..6da26ab59a9 100644
--- a/components/layout/layout_task.rs
+++ b/components/layout/layout_task.rs
@@ -29,17 +29,17 @@ use azure::azure::AzColor;
use canvas_traits::CanvasMsg;
use encoding::EncodingRef;
use encoding::all::UTF_8;
-use fnv::FnvHasher;
use euclid::Matrix4;
use euclid::point::Point2D;
use euclid::rect::Rect;
use euclid::scale_factor::ScaleFactor;
use euclid::size::Size2D;
-use gfx_traits::color;
-use gfx::display_list::{ClippingRegion, DisplayList, OpaqueNode};
+use fnv::FnvHasher;
use gfx::display_list::StackingContext;
+use gfx::display_list::{ClippingRegion, DisplayList, OpaqueNode};
use gfx::font_cache_task::FontCacheTask;
use gfx::paint_task::{LayoutToPaintMsg, PaintLayer};
+use gfx_traits::color;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use layout_traits::LayoutTaskFactory;
@@ -47,19 +47,19 @@ use log;
use msg::compositor_msg::{Epoch, ScrollPolicy, LayerId};
use msg::constellation_msg::Msg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, PipelineId};
+use net_traits::image_cache_task::{ImageCacheTask, ImageCacheResult, ImageCacheChan};
+use net_traits::{load_bytes_iter, PendingAsyncLoad};
use profile_traits::mem::{self, Report, ReportKind, ReportsChan};
-use profile_traits::time::{self, ProfilerMetadata, profile};
use profile_traits::time::{TimerMetadataFrameType, TimerMetadataReflowType};
-use net_traits::{load_bytes_iter, PendingAsyncLoad};
-use net_traits::image_cache_task::{ImageCacheTask, ImageCacheResult, ImageCacheChan};
+use profile_traits::time::{self, ProfilerMetadata, profile};
use script::dom::bindings::js::LayoutJS;
use script::dom::node::{LayoutData, Node};
use script::layout_interface::Animation;
use script::layout_interface::{LayoutChan, LayoutRPC, OffsetParentResponse};
use script::layout_interface::{NewLayoutTaskInfo, Msg, Reflow, ReflowGoal, ReflowQueryType};
use script::layout_interface::{ScriptLayoutChan, ScriptReflow, TrustedNodeAddress};
-use script_traits::{ConstellationControlMsg, LayoutControlMsg, OpaqueScriptLayoutChannel};
use script_traits::StylesheetLoadResponder;
+use script_traits::{ConstellationControlMsg, LayoutControlMsg, OpaqueScriptLayoutChannel};
use selectors::parser::PseudoElement;
use serde_json;
use std::borrow::ToOwned;
@@ -73,8 +73,8 @@ use std::sync::{Arc, Mutex, MutexGuard};
use string_cache::Atom;
use style::computed_values::{self, filter, mix_blend_mode};
use style::media_queries::{MediaType, MediaQueryList, Device};
-use style::properties::style_structs;
use style::properties::longhands::{display, position};
+use style::properties::style_structs;
use style::selector_matching::Stylist;
use style::stylesheets::{Origin, Stylesheet, CSSRuleIteratorExt};
use url::Url;
diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs
index a81f1f2e623..b0c3702f2c2 100644
--- a/components/layout/list_item.rs
+++ b/components/layout/list_item.rs
@@ -20,12 +20,12 @@ use text;
use euclid::{Point2D, Rect};
use gfx::display_list::DisplayList;
+use std::sync::Arc;
+use style::computed_values::{list_style_type, position};
+use style::properties::ComputedValues;
use util::geometry::Au;
use util::logical_geometry::LogicalSize;
use util::opts;
-use style::properties::ComputedValues;
-use style::computed_values::{list_style_type, position};
-use std::sync::Arc;
/// A block with the CSS `display` property equal to `list-item`.
#[derive(Debug)]
diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs
index 784df3d0ba7..8a9738a6038 100644
--- a/components/layout/multicol.rs
+++ b/components/layout/multicol.rs
@@ -13,11 +13,11 @@ use flow::{FlowClass, Flow, OpaqueFlow};
use fragment::{Fragment, FragmentBorderBoxIterator};
use euclid::{Point2D, Rect};
-use util::geometry::Au;
-use util::logical_geometry::LogicalSize;
use std::fmt;
-use style::properties::ComputedValues;
use std::sync::Arc;
+use style::properties::ComputedValues;
+use util::geometry::Au;
+use util::logical_geometry::LogicalSize;
pub struct MulticolFlow {
pub block_flow: BlockFlow,
diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs
index c936dd00a16..7895127e4be 100644
--- a/components/layout/parallel.rs
+++ b/components/layout/parallel.rs
@@ -9,16 +9,16 @@
#![allow(unsafe_code)]
use context::{LayoutContext, SharedLayoutContext};
-use flow::{Flow, MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal};
use flow;
+use flow::{Flow, MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal};
use flow_ref::FlowRef;
-use traversal::{PreorderDomTraversal, PostorderDomTraversal};
use traversal::PostorderNodeMutTraversal;
use traversal::{BubbleISizes, AssignISizes, AssignBSizesAndStoreOverflow};
use traversal::{ComputeAbsolutePositions, BuildDisplayList};
+use traversal::{PreorderDomTraversal, PostorderDomTraversal};
use traversal::{RecalcStyleForNode, ConstructFlows};
-use wrapper::{layout_node_to_unsafe_layout_node, layout_node_from_unsafe_layout_node, LayoutNode};
use wrapper::UnsafeLayoutNode;
+use wrapper::{layout_node_to_unsafe_layout_node, layout_node_from_unsafe_layout_node, LayoutNode};
use profile_traits::time::{self, ProfilerMetadata, profile};
use std::mem;
diff --git a/components/layout/query.rs b/components/layout/query.rs
index 01f1c6065b5..80ea4c534ca 100644
--- a/components/layout/query.rs
+++ b/components/layout/query.rs
@@ -11,8 +11,8 @@ use euclid::rect::Rect;
use flow_ref::FlowRef;
use fragment::{Fragment, FragmentBorderBoxIterator};
use gfx::display_list::{DisplayItemMetadata, OpaqueNode};
-use msg::constellation_msg::Msg as ConstellationMsg;
use msg::constellation_msg::ConstellationChan;
+use msg::constellation_msg::Msg as ConstellationMsg;
use opaque_node::OpaqueNodeMethods;
use script::layout_interface::{ContentBoxResponse, ContentBoxesResponse, NodeGeometryResponse};
use script::layout_interface::{HitTestResponse, LayoutRPC, MouseOverResponse, OffsetParentResponse};
@@ -20,8 +20,8 @@ use script::layout_interface::{ResolvedStyleResponse, ScriptLayoutChan, TrustedN
use sequential;
use std::sync::{Arc, Mutex};
-use util::geometry::Au;
use util::cursor::Cursor;
+use util::geometry::Au;
use util::logical_geometry::WritingMode;
pub struct LayoutRPCImpl(pub Arc<Mutex<LayoutTaskData>>);
diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs
index 573d35a7b67..51d8f39e59e 100644
--- a/components/layout/sequential.rs
+++ b/components/layout/sequential.rs
@@ -5,16 +5,16 @@
//! Implements sequential traversals over the DOM and flow trees.
use context::{LayoutContext, SharedLayoutContext};
-use flow::{self, Flow, ImmutableFlowUtils, InorderFlowTraversal, MutableFlowUtils};
use flow::{PostorderFlowTraversal, PreorderFlowTraversal};
+use flow::{self, Flow, ImmutableFlowUtils, InorderFlowTraversal, MutableFlowUtils};
use flow_ref::FlowRef;
use fragment::FragmentBorderBoxIterator;
use generated_content::ResolveGeneratedContent;
-use traversal::{PreorderDomTraversal, PostorderDomTraversal};
use traversal::PostorderNodeMutTraversal;
-use traversal::{BubbleISizes, RecalcStyleForNode, ConstructFlows};
use traversal::{AssignBSizesAndStoreOverflow, AssignISizes};
+use traversal::{BubbleISizes, RecalcStyleForNode, ConstructFlows};
use traversal::{ComputeAbsolutePositions, BuildDisplayList};
+use traversal::{PreorderDomTraversal, PostorderDomTraversal};
use wrapper::LayoutNode;
use euclid::point::Point2D;
diff --git a/components/layout/table.rs b/components/layout/table.rs
index 5d42b0772d4..f5ef95f1989 100644
--- a/components/layout/table.rs
+++ b/components/layout/table.rs
@@ -6,18 +6,18 @@
#![deny(unsafe_code)]
-use block::{self, BlockFlow, CandidateBSizeIterator, ISizeAndMarginsComputer};
use block::{ISizeConstraintInput, ISizeConstraintSolution};
+use block::{self, BlockFlow, CandidateBSizeIterator, ISizeAndMarginsComputer};
use context::LayoutContext;
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
-use flow::{self, Flow, FlowClass, IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS};
use flow::{ImmutableFlowUtils, OpaqueFlow};
+use flow::{self, Flow, FlowClass, IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS};
use fragment::{Fragment, FragmentBorderBoxIterator};
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
use layout_debug;
use model::{IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto};
-use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance};
use table_row::{TableRowFlow};
+use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance};
use table_wrapper::TableLayout;
use euclid::{Point2D, Rect};
diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs
index 5cd35f5be99..460478790c6 100644
--- a/components/layout/table_caption.rs
+++ b/components/layout/table_caption.rs
@@ -12,11 +12,11 @@ use flow::{FlowClass, Flow, OpaqueFlow};
use fragment::{Fragment, FragmentBorderBoxIterator};
use euclid::{Point2D, Rect};
-use util::geometry::Au;
-use util::logical_geometry::LogicalSize;
use std::fmt;
-use style::properties::ComputedValues;
use std::sync::Arc;
+use style::properties::ComputedValues;
+use util::geometry::Au;
+use util::logical_geometry::LogicalSize;
/// A table formatting context.
pub struct TableCaptionFlow {
diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs
index 56c66d2a967..fcb54b0d9ab 100644
--- a/components/layout/table_cell.rs
+++ b/components/layout/table_cell.rs
@@ -11,8 +11,8 @@ use context::LayoutContext;
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
use flow::{Flow, FlowClass, OpaqueFlow};
use fragment::{Fragment, FragmentBorderBoxIterator};
-use model::MaybeAuto;
use layout_debug;
+use model::MaybeAuto;
use table::InternalTable;
use table_row::{CollapsedBorder, CollapsedBorderProvenance};
use wrapper::ThreadSafeLayoutNode;
diff --git a/components/layout/table_colgroup.rs b/components/layout/table_colgroup.rs
index 7e8d2976823..aacff8cc011 100644
--- a/components/layout/table_colgroup.rs
+++ b/components/layout/table_colgroup.rs
@@ -12,12 +12,12 @@ use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
use layout_debug;
use euclid::{Point2D, Rect};
-use util::geometry::{Au, ZERO_RECT};
use std::cmp::max;
use std::fmt;
-use style::values::computed::LengthOrPercentageOrAuto;
-use style::properties::ComputedValues;
use std::sync::Arc;
+use style::properties::ComputedValues;
+use style::values::computed::LengthOrPercentageOrAuto;
+use util::geometry::{Au, ZERO_RECT};
use util::logical_geometry::LogicalSize;
/// A table formatting context.
diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs
index 4dc732ff922..e2b155bca78 100644
--- a/components/layout/table_row.rs
+++ b/components/layout/table_row.rs
@@ -13,9 +13,9 @@ use flow::{self, FlowClass, Flow, ImmutableFlowUtils, OpaqueFlow};
use flow_list::MutFlowListIterator;
use fragment::{Fragment, FragmentBorderBoxIterator};
use layout_debug;
+use model::MaybeAuto;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt};
use table_cell::{CollapsedBordersForCell, TableCellFlow};
-use model::MaybeAuto;
use cssparser::{Color, RGBA};
use euclid::{Point2D, Rect};
diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs
index 4beb11e76d7..c3312bceba9 100644
--- a/components/layout/table_wrapper.rs
+++ b/components/layout/table_wrapper.rs
@@ -25,8 +25,6 @@ use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
use table_row;
use euclid::{Point2D, Rect};
-use util::geometry::Au;
-use util::logical_geometry::LogicalSize;
use std::cmp::{max, min};
use std::fmt;
use std::ops::Add;
@@ -35,6 +33,8 @@ use style::computed_values::{border_collapse, table_layout};
use style::properties::ComputedValues;
use style::values::CSSFloat;
use style::values::computed::LengthOrPercentageOrAuto;
+use util::geometry::Au;
+use util::logical_geometry::LogicalSize;
#[derive(Copy, Clone, RustcEncodable, Debug)]
pub enum TableLayout {
diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs
index 0fbf159d7c3..7c4687a1b00 100644
--- a/components/layout/traversal.rs
+++ b/components/layout/traversal.rs
@@ -4,15 +4,15 @@
//! Traversals over the DOM and flow trees, running the layout computations.
-use css::matching::{ApplicableDeclarations, MatchMethods, StyleSharingResult};
use construct::FlowConstructor;
use context::LayoutContext;
-use flow::{self, Flow};
+use css::matching::{ApplicableDeclarations, MatchMethods, StyleSharingResult};
use flow::{PreorderFlowTraversal, PostorderFlowTraversal};
+use flow::{self, Flow};
use incremental::{self, BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, RestyleDamage};
use script::layout_interface::ReflowGoal;
-use wrapper::{layout_node_to_unsafe_layout_node, LayoutNode};
use wrapper::{ThreadSafeLayoutNode, UnsafeLayoutNode};
+use wrapper::{layout_node_to_unsafe_layout_node, LayoutNode};
use selectors::bloom::BloomFilter;
use util::opts;
diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs
index a44db23a02d..6deb515f5f2 100644
--- a/components/layout/wrapper.rs
+++ b/components/layout/wrapper.rs
@@ -32,12 +32,13 @@
use canvas_traits::CanvasMsg;
use context::SharedLayoutContext;
-use incremental::RestyleDamage;
use data::{LayoutDataFlags, LayoutDataWrapper, PrivateLayoutData};
+use incremental::RestyleDamage;
use opaque_node::OpaqueNodeMethods;
use gfx::display_list::OpaqueNode;
use ipc_channel::ipc::IpcSender;
+use msg::constellation_msg::{PipelineId, SubpageId};
use script::dom::attr::AttrValue;
use script::dom::bindings::codegen::InheritTypes::{CharacterDataCast, ElementCast};
use script::dom::bindings::codegen::InheritTypes::{HTMLIFrameElementCast, HTMLCanvasElementCast};
@@ -47,18 +48,18 @@ use script::dom::bindings::js::LayoutJS;
use script::dom::characterdata::{CharacterDataTypeId, LayoutCharacterDataHelpers};
use script::dom::element::{Element, ElementTypeId};
use script::dom::element::{LayoutElementHelpers, RawLayoutElementHelpers};
-use script::dom::htmlelement::HTMLElementTypeId;
use script::dom::htmlcanvaselement::LayoutHTMLCanvasElementHelpers;
+use script::dom::htmlelement::HTMLElementTypeId;
use script::dom::htmlimageelement::LayoutHTMLImageElementHelpers;
use script::dom::htmlinputelement::{HTMLInputElement, LayoutHTMLInputElementHelpers};
use script::dom::htmltextareaelement::LayoutHTMLTextAreaElementHelpers;
-use script::dom::node::{Node, NodeTypeId};
-use script::dom::node::{LayoutNodeHelpers, SharedLayoutData};
use script::dom::node::{HAS_CHANGED, IS_DIRTY, HAS_DIRTY_SIBLINGS, HAS_DIRTY_DESCENDANTS};
+use script::dom::node::{LayoutNodeHelpers, SharedLayoutData};
+use script::dom::node::{Node, NodeTypeId};
use script::dom::text::Text;
+use selectors::matching::DeclarationBlock;
+use selectors::parser::{NamespaceConstraint, AttrSelector};
use smallvec::VecLike;
-use msg::constellation_msg::{PipelineId, SubpageId};
-use util::str::is_whitespace;
use std::borrow::ToOwned;
use std::cell::{Ref, RefMut};
use std::marker::PhantomData;
@@ -67,13 +68,12 @@ use std::sync::Arc;
use string_cache::{Atom, Namespace};
use style::computed_values::content::ContentItem;
use style::computed_values::{content, display, white_space};
-use selectors::matching::DeclarationBlock;
-use selectors::parser::{NamespaceConstraint, AttrSelector};
use style::legacy::UnsignedIntegerAttribute;
use style::node::TElementAttributes;
-use style::properties::{PropertyDeclaration, PropertyDeclarationBlock};
use style::properties::ComputedValues;
+use style::properties::{PropertyDeclaration, PropertyDeclarationBlock};
use url::Url;
+use util::str::is_whitespace;
/// A wrapper so that layout can access only the methods that it should have access to. Layout must
/// only ever see these and must never see instances of `LayoutJS`.