Rename PositionOffsets to Position

This commit is contained in:
Mauricio Collares 2016-04-04 23:17:49 -03:00
parent 841aef06e0
commit 281e385ab2
3 changed files with 17 additions and 17 deletions

View file

@ -211,8 +211,8 @@ pub fn compute_damage(old: Option<&Arc<ServoComputedValues>>, new: &ServoCompute
get_flex.flex_direction
]) || add_if_not_equal!(old, new, damage,
[ REPAINT, STORE_OVERFLOW, REFLOW_OUT_OF_FLOW ], [
get_positionoffsets.top, get_positionoffsets.left,
get_positionoffsets.right, get_positionoffsets.bottom
get_position.top, get_position.left,
get_position.right, get_position.bottom
]) || add_if_not_equal!(old, new, damage,
[ REPAINT ], [
get_color.color, get_background.background_color,

View file

@ -154,12 +154,12 @@ impl PropertyAnimation {
[BorderSpacing; get_inheritedtable; border_spacing],
[BorderTopColor; get_border; border_top_color],
[BorderTopWidth; get_border; border_top_width],
[Bottom; get_positionoffsets; bottom],
[Bottom; get_position; bottom],
[Color; get_color; color],
[FontSize; get_font; font_size],
[FontWeight; get_font; font_weight],
[Height; get_box; height],
[Left; get_positionoffsets; left],
[Left; get_position; left],
[LineHeight; get_inheritedbox; line_height],
[MarginBottom; get_margin; margin_bottom],
[MarginLeft; get_margin; margin_left],
@ -176,9 +176,9 @@ impl PropertyAnimation {
[PaddingLeft; get_padding; padding_left],
[PaddingRight; get_padding; padding_right],
[PaddingTop; get_padding; padding_top],
[Right; get_positionoffsets; right],
[Right; get_position; right],
[TextIndent; get_inheritedtext; text_indent],
[Top; get_positionoffsets; top],
[Top; get_position; top],
[VerticalAlign; get_box; vertical_align],
[Visibility; get_inheritedbox; visibility],
[Width; get_box; width],
@ -252,12 +252,12 @@ impl PropertyAnimation {
[BorderSpacing; mutate_inheritedtable; border_spacing],
[BorderTopColor; mutate_border; border_top_color],
[BorderTopWidth; mutate_border; border_top_width],
[Bottom; mutate_positionoffsets; bottom],
[Bottom; mutate_position; bottom],
[Color; mutate_color; color],
[FontSize; mutate_font; font_size],
[FontWeight; mutate_font; font_weight],
[Height; mutate_box; height],
[Left; mutate_positionoffsets; left],
[Left; mutate_position; left],
[LineHeight; mutate_inheritedbox; line_height],
[MarginBottom; mutate_margin; margin_bottom],
[MarginLeft; mutate_margin; margin_left],
@ -274,10 +274,10 @@ impl PropertyAnimation {
[PaddingLeft; mutate_padding; padding_left],
[PaddingRight; mutate_padding; padding_right],
[PaddingTop; mutate_padding; padding_top],
[Right; mutate_positionoffsets; right],
[Right; mutate_position; right],
[TextIndent; mutate_inheritedtext; text_indent],
[TextShadow; mutate_inheritedtext; text_shadow],
[Top; mutate_positionoffsets; top],
[Top; mutate_position; top],
[Transform; mutate_effects; transform],
[VerticalAlign; mutate_box; vertical_align],
[Visibility; mutate_inheritedbox; visibility],

View file

@ -460,7 +460,7 @@ pub mod longhands {
${predefined_type("outline-offset", "Length", "Au(0)")}
${new_style_struct("PositionOffsets", is_inherited=False, gecko_name="nsStylePosition")}
${new_style_struct("Position", is_inherited=False, gecko_name="nsStylePosition")}
% for side in ["top", "right", "bottom", "left"]:
${predefined_type(side, "LengthOrPercentageOrAuto",
@ -6462,7 +6462,7 @@ impl ServoComputedValues {
#[inline]
pub fn logical_position(&self) -> LogicalMargin<computed::LengthOrPercentageOrAuto> {
// FIXME(SimonSapin): should be the writing mode of the containing block, maybe?
let position_style = self.get_positionoffsets();
let position_style = self.get_position();
LogicalMargin::from_physical(self.writing_mode, SideOffsets2D::new(
position_style.top,
position_style.right,
@ -7074,11 +7074,11 @@ pub fn modify_style_for_text(style: &mut Arc<ServoComputedValues>) {
// We leave the `position` property set to `relative` so that we'll still establish a
// containing block if needed. But we reset all position offsets to `auto`.
let mut style = Arc::make_mut(style);
let mut position_offsets = Arc::make_mut(&mut style.positionoffsets);
position_offsets.top = computed::LengthOrPercentageOrAuto::Auto;
position_offsets.right = computed::LengthOrPercentageOrAuto::Auto;
position_offsets.bottom = computed::LengthOrPercentageOrAuto::Auto;
position_offsets.left = computed::LengthOrPercentageOrAuto::Auto;
let mut position = Arc::make_mut(&mut style.position);
position.top = computed::LengthOrPercentageOrAuto::Auto;
position.right = computed::LengthOrPercentageOrAuto::Auto;
position.bottom = computed::LengthOrPercentageOrAuto::Auto;
position.left = computed::LengthOrPercentageOrAuto::Auto;
}
if style.padding.padding_top != computed::LengthOrPercentage::Length(Au(0)) ||