diff --git a/layout/painting/nsCSSRenderingBorders.cpp b/layout/painting/nsCSSRenderingBorders.cpp index 6e71a6b4ddc6..e74a9bb5d21a 100644 --- a/layout/painting/nsCSSRenderingBorders.cpp +++ b/layout/painting/nsCSSRenderingBorders.cpp @@ -3214,6 +3214,14 @@ nsCSSBorderRenderer::DrawBorders() return; } + bool allBordersSameWidth = AllBordersSameWidth(); + + if (allBordersSameWidth && mBorderWidths[0] == 0.0) { + // Some of the allBordersSameWidth codepaths depend on the border + // width being greater than zero. + return; + } + AutoRestoreTransform autoRestoreTransform; Matrix mat = mDrawTarget->GetTransform(); @@ -3241,14 +3249,6 @@ nsCSSBorderRenderer::DrawBorders() mInnerRect.Round(); } - bool allBordersSameWidth = AllBordersSameWidth(); - - if (allBordersSameWidth && mBorderWidths[0] == 0.0) { - // Some of the allBordersSameWidth codepaths depend on the border - // width being greater than zero. - return; - } - // Initial values only used when the border colors/widths are all the same: ColorPattern color(ToDeviceColor(mBorderColors[eSideTop])); StrokeOptions strokeOptions(mBorderWidths[eSideTop]); // stroke width