diff options
-rw-r--r-- | layout/forms/nsButtonFrameRenderer.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/layout/forms/nsButtonFrameRenderer.cpp b/layout/forms/nsButtonFrameRenderer.cpp index eaf1f82c14..5113572995 100644 --- a/layout/forms/nsButtonFrameRenderer.cpp +++ b/layout/forms/nsButtonFrameRenderer.cpp @@ -283,11 +283,23 @@ nsButtonFrameRenderer::GetButtonInnerFocusRect(const nsRect& aRect, nsRect& aRes GetButtonRect(aRect, aResult); aResult.Deflate(mFrame->GetUsedBorderAndPadding()); - nsMargin innerFocusPadding(0,0,0,0); if (mInnerFocusStyle) { + nsMargin innerFocusPadding(0,0,0,0); mInnerFocusStyle->StylePadding()->GetPadding(innerFocusPadding); + + nsMargin framePadding = mFrame->GetUsedPadding(); + + innerFocusPadding.top = std::min(innerFocusPadding.top, + framePadding.top); + innerFocusPadding.right = std::min(innerFocusPadding.right, + framePadding.right); + innerFocusPadding.bottom = std::min(innerFocusPadding.bottom, + framePadding.bottom); + innerFocusPadding.left = std::min(innerFocusPadding.left, + framePadding.left); + + aResult.Inflate(innerFocusPadding); } - aResult.Inflate(innerFocusPadding); } DrawResult @@ -372,7 +384,7 @@ nsButtonFrameRenderer::ReResolveStyles(nsPresContext* aPresContext) } #endif - // get styles assigned to -moz-inner-focus (ie dotted border on Windows) + // get styles assigned to -moz-focus-inner (ie dotted border on Windows) mInnerFocusStyle = styleSet->ProbePseudoElementStyle(mFrame->GetContent()->AsElement(), CSSPseudoElementType::mozFocusInner, |