style: Add a "start_end()" method to LogicalMargin

Add a `LogicalMargin::start_end()` method that receives a `Direction'
parameter. This is useful for some layout that is symmetric in inline
and block directions, like flexbox.
This commit is contained in:
Pu Xingyu 2016-11-08 23:33:56 +08:00
parent 29a55e5cbd
commit eb22d33d4e
5 changed files with 22 additions and 12 deletions

View file

@ -19,7 +19,7 @@ use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
use gfx::display_list::StackingContext;
use gfx_traits::ScrollRootId;
use layout_debug;
use model::{Direction, IntrinsicISizes, MaybeAuto, MinMaxConstraint};
use model::{IntrinsicISizes, MaybeAuto, MinMaxConstraint};
use model::{specified, specified_or_none};
use std::cmp::{max, min};
use std::ops::Range;
@ -27,7 +27,7 @@ use std::sync::Arc;
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::logical_geometry::{Direction, LogicalSize};
use style::properties::ServoComputedValues;
use style::servo::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW};
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};