layout: Put iframes that form stacking contexts in the right place.

Improves eBay.

Closes #7282.
This commit is contained in:
Patrick Walton 2015-08-19 12:07:14 -07:00
parent 5c284a546a
commit 4df4d1a1a9
4 changed files with 35 additions and 3 deletions

View file

@ -1011,9 +1011,15 @@ impl FragmentDisplayListBuilding for Fragment {
// because layout for the iframe only needs to know size, and origin is only relevant if // because layout for the iframe only needs to know size, and origin is only relevant if
// the iframe is actually going to be displayed. // the iframe is actually going to be displayed.
if let SpecificFragmentInfo::Iframe(ref iframe_fragment) = self.specific { if let SpecificFragmentInfo::Iframe(ref iframe_fragment) = self.specific {
self.finalize_position_and_size_of_iframe(&**iframe_fragment, let stacking_relative_border_box_in_parent_coordinate_system =
stacking_relative_border_box.origin, self.stacking_relative_border_box(stacking_relative_flow_origin,
layout_context) 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)
} }
} }

View file

@ -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/simple_inline_width_percentage.html iframe/simple_inline_width_percentage_ref.html
== iframe/size_attributes.html iframe/size_attributes_ref.html == iframe/size_attributes.html iframe/size_attributes_ref.html
experimental == iframe/size_attributes_vertical_writing_mode.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_auto_a.html image_rendering_pixelated_a.html
== image_rendering_pixelated_a.html image_rendering_pixelated_ref.html == image_rendering_pixelated_a.html image_rendering_pixelated_ref.html

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<style>
iframe {
position: absolute;
width: 200px;
height: 200px;
top: 100px;
left: 100px;
border: solid green 50px;
transform: translateX(0px); /* form a stacking context */
}
</style>
<iframe src="data:text/html,%3Cspan%3EJust%20a%20simple%20little%20iframe.%3C%2Fspan%3E">

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<style>
iframe {
position: absolute;
width: 200px;
height: 200px;
top: 100px;
left: 100px;
border: solid green 50px;
}
</style>
<iframe src="data:text/html,%3Cspan%3EJust%20a%20simple%20little%20iframe.%3C%2Fspan%3E">