Bug 1349646 - Don't overflow -moz-inner-focus border. r=wisniewskit+471096
MozReview-Commit-ID: FFSI6cKZBha
This commit is contained in:
@@ -461,11 +461,23 @@ nsButtonFrameRenderer::GetButtonInnerFocusRect(const nsRect& aRect, nsRect& aRes
|
|||||||
aResult = aRect;
|
aResult = aRect;
|
||||||
aResult.Deflate(mFrame->GetUsedBorderAndPadding());
|
aResult.Deflate(mFrame->GetUsedBorderAndPadding());
|
||||||
|
|
||||||
nsMargin innerFocusPadding(0,0,0,0);
|
|
||||||
if (mInnerFocusStyle) {
|
if (mInnerFocusStyle) {
|
||||||
|
nsMargin innerFocusPadding(0,0,0,0);
|
||||||
mInnerFocusStyle->StylePadding()->GetPadding(innerFocusPadding);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImgDrawResult
|
ImgDrawResult
|
||||||
|
|||||||
27
layout/reftests/forms/button/1349646-ref.html
Normal file
27
layout/reftests/forms/button/1349646-ref.html
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html class="reftest-wait">
|
||||||
|
<style>
|
||||||
|
button {
|
||||||
|
padding: 0px;
|
||||||
|
border:none;
|
||||||
|
font-size: 64px;
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
button::-moz-focus-inner {
|
||||||
|
padding-inline-start: 0px;
|
||||||
|
padding-inline-end: 0px;
|
||||||
|
}
|
||||||
|
button:-moz-focusring::-moz-focus-inner {
|
||||||
|
border: 4px solid;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div>
|
||||||
|
<button id="button1"><span>Menu1</span></button>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
window.onload = () => {
|
||||||
|
button1.focus();
|
||||||
|
document.documentElement.classList.remove('reftest-wait');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</html>
|
||||||
27
layout/reftests/forms/button/1349646.html
Normal file
27
layout/reftests/forms/button/1349646.html
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html class="reftest-wait">
|
||||||
|
<style>
|
||||||
|
button {
|
||||||
|
padding: 0px;
|
||||||
|
border:none;
|
||||||
|
font-size: 64px;
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
button::-moz-focus-inner {
|
||||||
|
padding-inline-start: 20px;
|
||||||
|
padding-inline-end: 20px;
|
||||||
|
}
|
||||||
|
button:-moz-focusring::-moz-focus-inner {
|
||||||
|
border: 4px solid;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div>
|
||||||
|
<button id="button1"><span>Menu1</span></button>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
window.onload = () => {
|
||||||
|
button1.focus();
|
||||||
|
document.documentElement.classList.remove('reftest-wait');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</html>
|
||||||
@@ -41,3 +41,5 @@ fails-if(Android) == disabled-1.html disabled-1-ref.html
|
|||||||
== 1317351.html 1317351-ref.html
|
== 1317351.html 1317351-ref.html
|
||||||
|
|
||||||
== dynamic-text-indent.html dynamic-text-indent-ref.html
|
== dynamic-text-indent.html dynamic-text-indent-ref.html
|
||||||
|
|
||||||
|
== 1349646.html 1349646-ref.html
|
||||||
|
|||||||
Reference in New Issue
Block a user