mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-25 01:01:52 +00:00
Bug 926268 - Don't include the full frame bounds in nsDisplayBorder if we're only painting one side. r=roc
This commit is contained in:
parent
a5ea556613
commit
70481ebbac
@ -2548,10 +2548,30 @@ nsDisplayBorder::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsRect
|
||||
nsDisplayBorder::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
|
||||
{
|
||||
nsRect borderBounds(ToReferenceFrame(), mFrame->GetSize());
|
||||
borderBounds.Inflate(mFrame->StyleBorder()->GetImageOutset());
|
||||
*aSnap = true;
|
||||
return borderBounds;
|
||||
const nsStyleBorder *styleBorder = mFrame->StyleBorder();
|
||||
nsRect borderBounds(ToReferenceFrame(), mFrame->GetSize());
|
||||
if (styleBorder->IsBorderImageLoaded()) {
|
||||
borderBounds.Inflate(mFrame->StyleBorder()->GetImageOutset());
|
||||
return borderBounds;
|
||||
} else {
|
||||
nsMargin border = styleBorder->GetComputedBorder();
|
||||
nsRect result;
|
||||
if (border.top > 0) {
|
||||
result = nsRect(borderBounds.X(), borderBounds.Y(), borderBounds.Width(), border.top);
|
||||
}
|
||||
if (border.right > 0) {
|
||||
result.UnionRect(result, nsRect(borderBounds.XMost() - border.right, borderBounds.Y(), border.right, borderBounds.Height()));
|
||||
}
|
||||
if (border.bottom > 0) {
|
||||
result.UnionRect(result, nsRect(borderBounds.X(), borderBounds.YMost() - border.bottom, borderBounds.Width(), border.bottom));
|
||||
}
|
||||
if (border.left > 0) {
|
||||
result.UnionRect(result, nsRect(borderBounds.X(), borderBounds.Y(), border.left, borderBounds.Height()));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// Given a region, compute a conservative approximation to it as a list
|
||||
|
Loading…
Reference in New Issue
Block a user