mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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:
parent
4e78755303
commit
e517d21de8
1 changed files with 8 additions and 2 deletions
|
@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue