Skip to content

Commit

Permalink
Move CSS flex-direction property from Flex to Position and delete Flex
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioc committed Apr 5, 2016
1 parent aae8919 commit bbc5c51
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions components/layout/flex.rs
Expand Up @@ -25,7 +25,6 @@ use std::cmp::max;
use std::sync::Arc;
use style::computed_values::flex_direction;
use style::logical_geometry::LogicalSize;
use style::properties::style_structs;
use style::properties::{ComputedValues, ServoComputedValues};
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto, LengthOrPercentageOrNone};

Expand Down Expand Up @@ -88,10 +87,6 @@ pub struct FlexFlow {
available_cross_size: AxisSize
}

fn flex_style(fragment: &Fragment) -> &style_structs::Flex {
fragment.style.get_flex()
}

// TODO(zentner): This function should use flex-basis.
fn flex_item_inline_sizes(flow: &mut Flow) -> IntrinsicISizes {
let _scope = layout_debug_scope!("flex::flex_item_inline_sizes");
Expand All @@ -113,7 +108,7 @@ impl FlexFlow {
flotation: Option<FloatKind>)
-> FlexFlow {

let main_mode = match flex_style(&fragment).flex_direction {
let main_mode = match fragment.style.get_position().flex_direction {
flex_direction::T::row_reverse | flex_direction::T::row => Mode::Inline,
flex_direction::T::column_reverse | flex_direction::T::column => Mode::Block
};
Expand Down
2 changes: 1 addition & 1 deletion components/layout/incremental.rs
Expand Up @@ -208,7 +208,7 @@ pub fn compute_damage(old: Option<&Arc<ServoComputedValues>>, new: &ServoCompute
get_inheritedtable.border_collapse,
get_inheritedtable.border_spacing,
get_column.column_gap,
get_flex.flex_direction
get_position.flex_direction
]) || add_if_not_equal!(old, new, damage,
[ REPAINT, STORE_OVERFLOW, REFLOW_OUT_OF_FLOW ], [
get_position.top, get_position.left,
Expand Down
2 changes: 1 addition & 1 deletion components/style/properties.mako.rs
Expand Up @@ -4860,7 +4860,7 @@ pub mod longhands {
// CSS Flexible Box Layout Module Level 1
// http://www.w3.org/TR/css3-flexbox/

${new_style_struct("Flex", is_inherited=False)}
${switch_to_style_struct("Position")}

// Flex container properties
${single_keyword("flex-direction", "row row-reverse column column-reverse", experimental=True)}
Expand Down

0 comments on commit bbc5c51

Please sign in to comment.