diff options
author | Moonchild <moonchild@palemoon.org> | 2022-07-22 18:25:57 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-07-22 18:25:57 +0000 |
commit | fa714cba354c831df3ca39237c3ccfd78c185d6c (patch) | |
tree | e5b7939bc9296f37d0e25e13191884a176e27868 | |
parent | d73c4c046d46cfc794f0eaf6444e14a958b32bb9 (diff) | |
download | uxp-fa714cba354c831df3ca39237c3ccfd78c185d6c.tar.gz |
Issue #1970 - Part 4: Don't overflow -moz-focus-inner border.
-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, |