Factor out ClipRect type into values; use Either for clip

MozReview-Commit-ID: C3R1erJdiID
This commit is contained in:
Manish Goregaokar 2017-02-08 16:18:56 -08:00 committed by Manish Goregaokar
parent 8b7bb97aa9
commit 6b0d3902de
10 changed files with 223 additions and 238 deletions

View file

@ -1176,10 +1176,11 @@ impl FragmentDisplayListBuilding for Fragment {
fn adjust_clip_for_style(&self,
parent_clip: &mut ClippingRegion,
stacking_relative_border_box: &Rect<Au>) {
use style::values::Either;
// Account for `clip` per CSS 2.1 § 11.1.2.
let style_clip_rect = match (self.style().get_box().position,
self.style().get_effects().clip.0) {
(position::T::absolute, Some(style_clip_rect)) => style_clip_rect,
self.style().get_effects().clip) {
(position::T::absolute, Either::First(style_clip_rect)) => style_clip_rect,
_ => return,
};