diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2018-02-14 13:30:48 -0800 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-02-16 16:01:46 -0800 |
commit | 62328466990e3ea436e5d05486eb26bc4ce0d799 (patch) | |
tree | ed74a46e08a88dc1633fc322f17a579779b249f5 /components/layout/flow.rs | |
parent | f7ac5d712f6581c20f32769c9992d8d7667fc7f6 (diff) | |
download | servo-62328466990e3ea436e5d05486eb26bc4ce0d799.tar.gz servo-62328466990e3ea436e5d05486eb26bc4ce0d799.zip |
Add stacking_relative_border_box_for_display_list
Diffstat (limited to 'components/layout/flow.rs')
-rw-r--r-- | components/layout/flow.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 30877defa43..399a21087c4 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -1155,6 +1155,19 @@ impl BaseFlow { self.speculated_float_placement_out.left > Au(0) || self.speculated_float_placement_out.right > Au(0) } + + + /// Compute the fragment position relative to the parent stacking context. If the fragment + /// itself establishes a stacking context, then the origin of its position will be (0, 0) + /// for the purposes of this computation. + pub fn stacking_relative_border_box_for_display_list(&self, fragment: &Fragment) -> Rect<Au> { + fragment.stacking_relative_border_box( + &self.stacking_relative_position, + &self.early_absolute_position_info.relative_containing_block_size, + self.early_absolute_position_info.relative_containing_block_mode, + CoordinateSystem::Own, + ) + } } impl<'a> ImmutableFlowUtils for &'a Flow { |