From 4df4d1a1a9e8fa53c862fc0d42aa43c58eee3fa3 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 19 Aug 2015 12:07:14 -0700 Subject: [PATCH] layout: Put iframes that form stacking contexts in the right place. Improves eBay. Closes #7282. --- components/layout/display_list_builder.rs | 12 +++++++++--- tests/ref/basic.list | 1 + tests/ref/iframe/stacking_context.html | 13 +++++++++++++ tests/ref/iframe/stacking_context_ref.html | 12 ++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 tests/ref/iframe/stacking_context.html create mode 100644 tests/ref/iframe/stacking_context_ref.html diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 8710c519de0..59264e24a8f 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -1011,9 +1011,15 @@ impl FragmentDisplayListBuilding for Fragment { // because layout for the iframe only needs to know size, and origin is only relevant if // the iframe is actually going to be displayed. if let SpecificFragmentInfo::Iframe(ref iframe_fragment) = self.specific { - self.finalize_position_and_size_of_iframe(&**iframe_fragment, - stacking_relative_border_box.origin, - layout_context) + let stacking_relative_border_box_in_parent_coordinate_system = + self.stacking_relative_border_box(stacking_relative_flow_origin, + relative_containing_block_size, + relative_containing_block_mode, + CoordinateSystem::Parent); + self.finalize_position_and_size_of_iframe( + &**iframe_fragment, + stacking_relative_border_box_in_parent_coordinate_system.origin, + layout_context) } } diff --git a/tests/ref/basic.list b/tests/ref/basic.list index d4302a6099f..72f98ee3402 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -137,6 +137,7 @@ flaky_cpu == append_style_a.html append_style_b.html == iframe/simple_inline_width_percentage.html iframe/simple_inline_width_percentage_ref.html == iframe/size_attributes.html iframe/size_attributes_ref.html experimental == iframe/size_attributes_vertical_writing_mode.html iframe/size_attributes_ref.html +== iframe/stacking_context.html iframe/stacking_context_ref.html != image_rendering_auto_a.html image_rendering_pixelated_a.html == image_rendering_pixelated_a.html image_rendering_pixelated_ref.html diff --git a/tests/ref/iframe/stacking_context.html b/tests/ref/iframe/stacking_context.html new file mode 100644 index 00000000000..feeea572eaa --- /dev/null +++ b/tests/ref/iframe/stacking_context.html @@ -0,0 +1,13 @@ + + +