Split Au type into separate crate, with minimal dependencies.

This commit is contained in:
Glenn Watson 2015-09-28 16:53:00 +10:00
parent fb6d0946cb
commit 339a3f869b
72 changed files with 376 additions and 235 deletions

View file

@ -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"

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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};

View file

@ -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};

View file

@ -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;

View file

@ -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;

View file

@ -18,6 +18,7 @@
#![plugin(string_cache_plugin)]
#![plugin(plugins)]
extern crate app_units;
#[macro_use]
extern crate bitflags;
#[macro_use]

View file

@ -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;

View file

@ -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.

View file

@ -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 {

View file

@ -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>>);

View file

@ -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;

View file

@ -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.

View file

@ -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.

View file

@ -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;

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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)]

View file

@ -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};