Set zero to mImageRegion.{height,width} if {bottom,right} is auto.

Let's follow how Gecko does for this part (in nsRuleNode::ComputeListData).
We set mImageRegion.height or mImageRegion.width to zero if bottom or right is
None (i.e. auto).
This commit is contained in:
Boris Chiou 2017-06-08 18:21:40 +08:00
parent 4e78755303
commit e517d21de8

View file

@ -3327,8 +3327,14 @@ fn static_assert() {
Either::First(rect) => {
self.gecko.mImageRegion.x = rect.left.unwrap_or(Au(0)).0;
self.gecko.mImageRegion.y = rect.top.unwrap_or(Au(0)).0;
self.gecko.mImageRegion.height = rect.bottom.unwrap_or(Au(0)).0 - self.gecko.mImageRegion.y;
self.gecko.mImageRegion.width = rect.right.unwrap_or(Au(0)).0 - self.gecko.mImageRegion.x;
self.gecko.mImageRegion.height = match rect.bottom {
Some(value) => value.0 - self.gecko.mImageRegion.y,
None => 0,
};
self.gecko.mImageRegion.width = match rect.right {
Some(value) => value.0 - self.gecko.mImageRegion.x,
None => 0,
};
}
}
}