style: Serialize clip-path and shape-outside using Servo.

Differential Revision: https://phabricator.services.mozilla.com/D3653
This commit is contained in:
Emilio Cobos Álvarez 2018-08-17 20:26:29 +02:00
parent e96b025f10
commit e338bd3add
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 85 additions and 43 deletions

View file

@ -81,3 +81,19 @@ impl ToAnimatedZero for BorderCornerRadius {
Err(())
}
}
impl BorderRadius {
/// Returns whether all the values are `0px`.
pub fn all_zero(&self) -> bool {
fn all(corner: &BorderCornerRadius) -> bool {
fn is_zero(l: &LengthOrPercentage) -> bool {
*l == LengthOrPercentage::zero()
}
is_zero(corner.0.width()) && is_zero(corner.0.height())
}
all(&self.top_left) &&
all(&self.top_right) &&
all(&self.bottom_left) &&
all(&self.bottom_right)
}
}