From 24f10df436fdd1b6fdf197f76feb89135b72f25d Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 26 Jun 2015 17:01:08 -0700 Subject: [PATCH] layout: Modify styles for replaced content as appropriate during incremental flow construction. Fixes jumpiness on lots of Web sites. --- components/layout/construct.rs | 6 ++++-- tests/ref/basic.list | 1 + tests/ref/jumpiness_a.html | 19 +++++++++++++++++++ tests/ref/jumpiness_ref.html | 15 +++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 tests/ref/jumpiness_a.html create mode 100644 tests/ref/jumpiness_ref.html diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 12eb258f8f5..cc67cc6c300 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -1249,7 +1249,7 @@ impl<'a> FlowConstructor<'a> { let mut layout_data_ref = node.mutate_layout_data(); let layout_data = layout_data_ref.as_mut().expect("no layout data"); - let style = (*node.get_style(&layout_data)).clone(); + let mut style = (*node.get_style(&layout_data)).clone(); let damage = layout_data.data.restyle_damage; match node.construction_result_mut(layout_data) { &mut ConstructionResult::None => true, @@ -1297,8 +1297,10 @@ impl<'a> FlowConstructor<'a> { .repair_style_and_bubble_inline_sizes(&style); } _ => { + if node.is_replaced_content() { + properties::modify_style_for_replaced_content(&mut style); + } fragment.repair_style(&style); - return true } } } diff --git a/tests/ref/basic.list b/tests/ref/basic.list index 786eb580f29..60fd6bb7f45 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -169,6 +169,7 @@ experimental == iframe/size_attributes_vertical_writing_mode.html iframe/size_at == inset.html inset_ref.html != inset_blackborder.html blackborder_ref.html == issue-1324.html issue-1324-ref.html +== jumpiness_a.html jumpiness_ref.html == last_child_pseudo_a.html last_child_pseudo_b.html == last_of_type_pseudo_a.html last_of_type_pseudo_b.html == legacy_cellspacing_attribute_a.html border_spacing_ref.html diff --git a/tests/ref/jumpiness_a.html b/tests/ref/jumpiness_a.html new file mode 100644 index 00000000000..8a7a58a933a --- /dev/null +++ b/tests/ref/jumpiness_a.html @@ -0,0 +1,19 @@ + + + + + + +a + + + + diff --git a/tests/ref/jumpiness_ref.html b/tests/ref/jumpiness_ref.html new file mode 100644 index 00000000000..ebd503a9187 --- /dev/null +++ b/tests/ref/jumpiness_ref.html @@ -0,0 +1,15 @@ + + + + + + +a + + + +