Use reference frames explicitly for fixed positioning

Now that WebRender gives us reference frame ClipIds, we can use those to
implement fixed positioning in Servo. This will allow us to remove the
feature from WebRender entirely.
This commit is contained in:
Martin Robinson 2018-05-08 17:05:06 +02:00
parent 11a89bcc47
commit 32f00ef821
4 changed files with 160 additions and 50 deletions

View file

@ -2474,6 +2474,12 @@ impl Fragment {
stacking_relative_border_box.size.height - border_padding.vertical()))
}
/// Returns true if this fragment may establish a reference frame.
pub fn can_establish_reference_frame(&self) -> bool {
!self.style().get_box().transform.0.is_empty() ||
self.style().get_box().perspective != Perspective::None
}
/// Returns true if this fragment has a filter, transform, or perspective property set.
pub fn has_filter_transform_or_perspective(&self) -> bool {
!self.style().get_box().transform.0.is_empty() ||