Bug 1702216 - Fix optimization to account for outline offset.

(this wasn't caught by the reftests in layout/reftests/outline but was
caught by some WPT).

MANUAL PUSH: Orange CLOSED TREE
This commit is contained in:
Emilio Cobos Álvarez 2021-04-02 19:54:59 +02:00
parent 1a85ea7596
commit a7fe655066

View File

@ -951,18 +951,19 @@ nsCSSRendering::CreateBorderRendererForNonThemedOutline(
return Nothing(); return Nothing();
} }
const nscoord offset = ourOutline->mOutlineOffset.ToAppUnits();
nsRect innerRect = aInnerRect;
innerRect.Inflate(offset);
// If the dirty rect is completely inside the border area (e.g., only the // If the dirty rect is completely inside the border area (e.g., only the
// content is being painted), then we can skip out now // content is being painted), then we can skip out now
// XXX this isn't exactly true for rounded borders, where the inside curves // XXX this isn't exactly true for rounded borders, where the inside curves
// may encroach into the content area. A safer calculation would be to // may encroach into the content area. A safer calculation would be to
// shorten insideRect by the radius one each side before performing this test. // shorten insideRect by the radius one each side before performing this test.
if (aInnerRect.Contains(aDirtyRect)) { if (innerRect.Contains(aDirtyRect)) {
return Nothing(); return Nothing();
} }
const nscoord offset = ourOutline->mOutlineOffset.ToAppUnits();
nsRect innerRect = aInnerRect;
innerRect.Inflate(offset);
nscoord width = ourOutline->GetOutlineWidth(); nscoord width = ourOutline->GetOutlineWidth();
StyleBorderStyle outlineStyle; StyleBorderStyle outlineStyle;