Fix parsing of ClipRect

This commit is contained in:
Nazım Can Altınova 2017-02-24 23:31:48 +03:00
parent 050d9d9097
commit d7c227f614
No known key found for this signature in database
GPG key ID: AF9BCD7CE6449954
6 changed files with 94 additions and 27 deletions

View file

@ -1259,8 +1259,10 @@ impl FragmentDisplayListBuilding for Fragment {
};
// FIXME(pcwalton, #2795): Get the real container size.
let clip_origin = Point2D::new(stacking_relative_border_box.origin.x + style_clip_rect.left,
stacking_relative_border_box.origin.y + style_clip_rect.top);
let clip_origin = Point2D::new(stacking_relative_border_box.origin.x +
style_clip_rect.left.unwrap_or(Au(0)),
stacking_relative_border_box.origin.y +
style_clip_rect.top.unwrap_or(Au(0)));
let right = style_clip_rect.right.unwrap_or(stacking_relative_border_box.size.width);
let bottom = style_clip_rect.bottom.unwrap_or(stacking_relative_border_box.size.height);
let clip_size = Size2D::new(right - clip_origin.x, bottom - clip_origin.y);