diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2015-09-28 16:53:00 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2015-10-01 07:16:11 +1000 |
commit | 339a3f869b539ae6da49f5d34568789d0abf3e00 (patch) | |
tree | 06790c2e03a77bdbb988361dcf8e0b34b97dec4b /components/layout | |
parent | fb6d0946cb3bac713bc20794f17a40fa7a12bc00 (diff) | |
download | servo-339a3f869b539ae6da49f5d34568789d0abf3e00.tar.gz servo-339a3f869b539ae6da49f5d34568789d0abf3e00.zip |
Split Au type into separate crate, with minimal dependencies.
Diffstat (limited to 'components/layout')
-rw-r--r-- | components/layout/Cargo.toml | 3 | ||||
-rw-r--r-- | components/layout/block.rs | 3 | ||||
-rw-r--r-- | components/layout/context.rs | 2 | ||||
-rw-r--r-- | components/layout/display_list_builder.rs | 3 | ||||
-rw-r--r-- | components/layout/flex.rs | 2 | ||||
-rw-r--r-- | components/layout/floats.rs | 2 | ||||
-rw-r--r-- | components/layout/flow.rs | 3 | ||||
-rw-r--r-- | components/layout/fragment.rs | 3 | ||||
-rw-r--r-- | components/layout/inline.rs | 3 | ||||
-rw-r--r-- | components/layout/layout_task.rs | 4 | ||||
-rw-r--r-- | components/layout/lib.rs | 1 | ||||
-rw-r--r-- | components/layout/list_item.rs | 2 | ||||
-rw-r--r-- | components/layout/model.rs | 2 | ||||
-rw-r--r-- | components/layout/multicol.rs | 2 | ||||
-rw-r--r-- | components/layout/query.rs | 2 | ||||
-rw-r--r-- | components/layout/sequential.rs | 3 | ||||
-rw-r--r-- | components/layout/table.rs | 2 | ||||
-rw-r--r-- | components/layout/table_caption.rs | 2 | ||||
-rw-r--r-- | components/layout/table_cell.rs | 2 | ||||
-rw-r--r-- | components/layout/table_colgroup.rs | 3 | ||||
-rw-r--r-- | components/layout/table_row.rs | 2 | ||||
-rw-r--r-- | components/layout/table_rowgroup.rs | 2 | ||||
-rw-r--r-- | components/layout/table_wrapper.rs | 2 | ||||
-rw-r--r-- | components/layout/text.rs | 2 |
24 files changed, 35 insertions, 22 deletions
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index 85f3d42f5f7..8cccb371428 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -7,6 +7,9 @@ authors = ["The Servo Project Developers"] name = "layout" path = "lib.rs" +[dependencies.app_units] +path = "../app_units" + [dependencies.azure] git = "https://github.com/servo/rust-azure" diff --git a/components/layout/block.rs b/components/layout/block.rs index 970d6a1c315..8203acaf850 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -27,6 +27,7 @@ #![deny(unsafe_code)] +use app_units::{Au, MAX_AU}; use context::LayoutContext; use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode}; use display_list_builder::{FragmentDisplayListBuilding}; @@ -60,7 +61,7 @@ use style::computed_values::{position, text_align, transform, transform_style}; use style::properties::ComputedValues; use style::values::computed::{LengthOrNone, LengthOrPercentageOrNone}; use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto}; -use util::geometry::{Au, MAX_AU, MAX_RECT}; +use util::geometry::MAX_RECT; use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode}; use util::opts; use wrapper::PseudoElementType; diff --git a/components/layout/context.rs b/components/layout/context.rs index 78eb676e02f..e68ce343940 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use canvas_traits::CanvasMsg; use css::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache}; use euclid::{Rect, Size2D}; @@ -28,7 +29,6 @@ use std::sync::Arc; use std::sync::mpsc::{Sender, channel}; use style::selector_matching::Stylist; use url::Url; -use util::geometry::Au; use util::mem::HeapSizeOf; use util::opts; diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 9d4e7a5f979..94b911cae00 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -10,6 +10,7 @@ #![deny(unsafe_code)] +use app_units::{Au, AU_PER_PX}; use azure::azure_hl::Color; use block::BlockFlow; use canvas_traits::{CanvasMsg, FromLayoutMsg}; @@ -56,7 +57,7 @@ use style::values::specified::{AngleOrCorner, HorizontalDirection, VerticalDirec use table_cell::CollapsedBordersForCell; use url::Url; use util::cursor::Cursor; -use util::geometry::{AU_PER_PX, Au, ZERO_POINT}; +use util::geometry::ZERO_POINT; use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode}; use util::opts; use util::range::Range; diff --git a/components/layout/flex.rs b/components/layout/flex.rs index a5b55e37833..fdccc9b1728 100644 --- a/components/layout/flex.rs +++ b/components/layout/flex.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use block::BlockFlow; use context::LayoutContext; use display_list_builder::FlexFlowDisplayListBuilding; @@ -30,7 +31,6 @@ use style::computed_values::{flex_direction, float}; use style::properties::ComputedValues; use style::properties::style_structs; use style::values::computed::LengthOrPercentageOrAuto; -use util::geometry::Au; use util::logical_geometry::LogicalSize; use util::opts; diff --git a/components/layout/floats.rs b/components/layout/floats.rs index be1947958c3..f406cd2194b 100644 --- a/components/layout/floats.rs +++ b/components/layout/floats.rs @@ -2,11 +2,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use app_units::Au; 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; diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 8a7d601646b..dfca7f35053 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -25,6 +25,7 @@ //! line breaks and mapping to CSS boxes, for the purpose of handling `getClientRects()` and //! similar methods. +use app_units::Au; use block::BlockFlow; use context::LayoutContext; use display_list_builder::DisplayListBuildingResult; @@ -57,7 +58,7 @@ use table_colgroup::TableColGroupFlow; use table_row::TableRowFlow; use table_rowgroup::TableRowGroupFlow; use table_wrapper::TableWrapperFlow; -use util::geometry::{Au, ZERO_RECT}; +use util::geometry::ZERO_RECT; use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode}; use wrapper::{PseudoElementType, ThreadSafeLayoutNode}; diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 00f264fb83c..13cf107227e 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use canvas_traits::CanvasMsg; use context::LayoutContext; use euclid::{Point2D, Rect, Size2D}; @@ -43,7 +44,7 @@ use text; use text::TextRunScanner; use url::Url; use util; -use util::geometry::{Au, ZERO_POINT}; +use util::geometry::ZERO_POINT; use util::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode}; use util::range::*; use util::str::{is_whitespace, slice_chars}; diff --git a/components/layout/inline.rs b/components/layout/inline.rs index e2b028a6880..1f86ac09405 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -4,6 +4,7 @@ #![deny(unsafe_code)] +use app_units::{Au, MAX_AU}; use block::{AbsoluteAssignBSizesTraversal, AbsoluteStoreOverflowTraversal}; use context::LayoutContext; use display_list_builder::{FragmentDisplayListBuilding, InlineFlowDisplayListBuilding}; @@ -29,7 +30,7 @@ use style::properties::ComputedValues; use text; use unicode_bidi; use util; -use util::geometry::{Au, MAX_AU, ZERO_RECT}; +use util::geometry::ZERO_RECT; use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode}; use util::range::{Range, RangeIndex}; use wrapper::PseudoElementType; diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 3158753d5c1..3535b8137df 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -8,6 +8,7 @@ #![allow(unsafe_code)] use animation; +use app_units::Au; use azure::azure::AzColor; use canvas_traits::CanvasMsg; use construct::ConstructionResult; @@ -78,8 +79,9 @@ use style::properties::longhands::{display, position}; use style::properties::style_structs; use style::selector_matching::Stylist; use style::stylesheets::{CSSRuleIteratorExt, Origin, Stylesheet}; +use style::values::AuExtensionMethods; use url::Url; -use util::geometry::{Au, MAX_RECT, ZERO_POINT}; +use util::geometry::{MAX_RECT, ZERO_POINT}; use util::ipc::OptionalIpcSender; use util::logical_geometry::LogicalPoint; use util::mem::HeapSizeOf; diff --git a/components/layout/lib.rs b/components/layout/lib.rs index 20a1b3323d4..f12335d9c04 100644 --- a/components/layout/lib.rs +++ b/components/layout/lib.rs @@ -18,6 +18,7 @@ #![plugin(string_cache_plugin)] #![plugin(plugins)] +extern crate app_units; #[macro_use] extern crate bitflags; #[macro_use] diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs index 630453e0b09..41c404f6ad9 100644 --- a/components/layout/list_item.rs +++ b/components/layout/list_item.rs @@ -7,6 +7,7 @@ #![deny(unsafe_code)] +use app_units::Au; use block::BlockFlow; use context::LayoutContext; use display_list_builder::ListItemFlowDisplayListBuilding; @@ -22,7 +23,6 @@ use std::sync::Arc; use style::computed_values::{list_style_type, position}; use style::properties::ComputedValues; use text; -use util::geometry::Au; use util::logical_geometry::LogicalSize; use util::opts; diff --git a/components/layout/model.rs b/components/layout/model.rs index c7c690f84bf..8ee98a39678 100644 --- a/components/layout/model.rs +++ b/components/layout/model.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use euclid::{Matrix4, SideOffsets2D, Size2D}; use fragment::Fragment; use std::cmp::{max, min}; @@ -14,7 +15,6 @@ use style::computed_values::transform::ComputedMatrix; use style::properties::ComputedValues; use style::values::computed::{BorderRadiusSize, LengthOrPercentageOrAuto}; use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrNone}; -use util::geometry::Au; use util::logical_geometry::LogicalMargin; /// A collapsible margin. See CSS 2.1 § 8.3.1. diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs index 6f761152df5..7f21ee58f60 100644 --- a/components/layout/multicol.rs +++ b/components/layout/multicol.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use block::BlockFlow; use context::LayoutContext; use euclid::{Point2D, Rect}; @@ -15,7 +16,6 @@ use fragment::{Fragment, FragmentBorderBoxIterator}; use std::fmt; use std::sync::Arc; use style::properties::ComputedValues; -use util::geometry::Au; use util::logical_geometry::LogicalSize; pub struct MulticolFlow { diff --git a/components/layout/query.rs b/components/layout/query.rs index 1f1eb3e6a3b..024d3022288 100644 --- a/components/layout/query.rs +++ b/components/layout/query.rs @@ -4,6 +4,7 @@ //! Utilities for querying the layout, as needed by the layout task. +use app_units::Au; use euclid::point::Point2D; use euclid::rect::Rect; use flow_ref::FlowRef; @@ -19,7 +20,6 @@ use script::layout_interface::{ResolvedStyleResponse, ScriptLayoutChan, TrustedN use sequential; use std::sync::{Arc, Mutex}; 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 a7c874971dd..cc6abb1184d 100644 --- a/components/layout/sequential.rs +++ b/components/layout/sequential.rs @@ -4,6 +4,7 @@ //! Implements sequential traversals over the DOM and flow trees. +use app_units::Au; use context::{LayoutContext, SharedLayoutContext}; use euclid::point::Point2D; use flow::{PostorderFlowTraversal, PreorderFlowTraversal}; @@ -16,7 +17,7 @@ use traversal::{AssignBSizesAndStoreOverflow, AssignISizes}; use traversal::{BubbleISizes, ConstructFlows, RecalcStyleForNode}; use traversal::{BuildDisplayList, ComputeAbsolutePositions}; use traversal::{PostorderDomTraversal, PreorderDomTraversal}; -use util::geometry::{Au, ZERO_POINT}; +use util::geometry::ZERO_POINT; use util::opts; use wrapper::LayoutNode; diff --git a/components/layout/table.rs b/components/layout/table.rs index eabe20f335f..496a05f80d0 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use block::{ISizeConstraintInput, ISizeConstraintSolution}; use block::{self, BlockFlow, CandidateBSizeIterator, ISizeAndMarginsComputer}; use context::LayoutContext; @@ -28,7 +29,6 @@ use style::values::computed::LengthOrPercentageOrAuto; use table_row::{TableRowFlow}; use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance}; use table_wrapper::TableLayout; -use util::geometry::Au; use util::logical_geometry::LogicalSize; /// A table flow corresponded to the table's internal table fragment under a table wrapper flow. diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs index 4e9157bc61e..54c96ac34fa 100644 --- a/components/layout/table_caption.rs +++ b/components/layout/table_caption.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use block::BlockFlow; use context::LayoutContext; use euclid::{Point2D, Rect}; @@ -14,7 +15,6 @@ use fragment::{Fragment, FragmentBorderBoxIterator}; use std::fmt; use std::sync::Arc; use style::properties::ComputedValues; -use util::geometry::Au; use util::logical_geometry::LogicalSize; /// A table formatting context. diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs index 1cdd22bada1..963a7981562 100644 --- a/components/layout/table_cell.rs +++ b/components/layout/table_cell.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use block::{BlockFlow, ISizeAndMarginsComputer, MarginsMayCollapseFlag}; use context::LayoutContext; use cssparser::Color; @@ -23,7 +24,6 @@ use style::legacy::UnsignedIntegerAttribute; use style::properties::ComputedValues; use table::InternalTable; use table_row::{CollapsedBorder, CollapsedBorderProvenance}; -use util::geometry::Au; use util::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode}; use wrapper::ThreadSafeLayoutNode; diff --git a/components/layout/table_colgroup.rs b/components/layout/table_colgroup.rs index 4cbb41e4c39..12273d0e173 100644 --- a/components/layout/table_colgroup.rs +++ b/components/layout/table_colgroup.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use context::LayoutContext; use euclid::{Point2D, Rect}; use flow::{BaseFlow, Flow, FlowClass, ForceNonfloatedFlag, OpaqueFlow}; @@ -16,7 +17,7 @@ use std::fmt; use std::sync::Arc; use style::properties::ComputedValues; use style::values::computed::LengthOrPercentageOrAuto; -use util::geometry::{Au, ZERO_RECT}; +use util::geometry::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 54b47030eb6..24dde406441 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use block::{BlockFlow, ISizeAndMarginsComputer}; use context::LayoutContext; use cssparser::{Color, RGBA}; @@ -27,7 +28,6 @@ use style::properties::ComputedValues; use style::values::computed::LengthOrPercentageOrAuto; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt}; use table_cell::{CollapsedBordersForCell, TableCellFlow}; -use util::geometry::Au; use util::logical_geometry::{LogicalSize, PhysicalSide, WritingMode}; /// A single row of a table. diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs index 812041cef4a..3d3ad6a10b0 100644 --- a/components/layout/table_rowgroup.rs +++ b/components/layout/table_rowgroup.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use block::{BlockFlow, ISizeAndMarginsComputer}; use context::LayoutContext; use euclid::{Point2D, Rect}; @@ -20,7 +21,6 @@ use style::computed_values::{border_collapse, border_spacing}; use style::properties::ComputedValues; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow}; use table_row::{self, CollapsedBordersForRow}; -use util::geometry::Au; use util::logical_geometry::{LogicalSize, WritingMode}; /// A table formatting context. diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index 81b92d5794f..affe0d26b3d 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -13,6 +13,7 @@ #![deny(unsafe_code)] +use app_units::Au; use block::{AbsoluteNonReplaced, BlockFlow, FloatNonReplaced, ISizeAndMarginsComputer, ISizeConstraintInput}; use block::{ISizeConstraintSolution, MarginsMayCollapseFlag}; use context::LayoutContext; @@ -32,7 +33,6 @@ use style::values::CSSFloat; use style::values::computed::LengthOrPercentageOrAuto; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize}; use table_row; -use util::geometry::Au; use util::logical_geometry::LogicalSize; #[derive(Copy, Clone, RustcEncodable, Debug)] diff --git a/components/layout/text.rs b/components/layout/text.rs index fbcd1dc7e7e..6efc5302a61 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -6,6 +6,7 @@ #![deny(unsafe_code)] +use app_units::Au; use fragment::{Fragment, ScannedTextFragmentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo}; use gfx::font::{DISABLE_KERNING_SHAPING_FLAG, FontMetrics, IGNORE_LIGATURES_SHAPING_FLAG}; use gfx::font::{RTL_FLAG, RunMetrics, ShapingFlags, ShapingOptions}; @@ -24,7 +25,6 @@ use style::properties::ComputedValues; use style::properties::style_structs::Font as FontStyle; use unicode_bidi::{is_rtl, process_text}; use unicode_script::{get_script, Script}; -use util::geometry::Au; use util::linked_list::split_off_head; use util::logical_geometry::{LogicalSize, WritingMode}; use util::range::{Range, RangeIndex}; |