mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 21:18:35 +00:00
Bug 1349646 - Don't overflow -moz-inner-focus border. r=wisniewskit+471096
MozReview-Commit-ID: FFSI6cKZBha --HG-- extra : rebase_source : 8b858372c528a7dd0b936f9edec1aa49f8ba8c23
This commit is contained in:
parent
fa05c8f6c5
commit
541443c523
@ -461,11 +461,23 @@ nsButtonFrameRenderer::GetButtonInnerFocusRect(const nsRect& aRect, nsRect& aRes
|
||||
aResult = aRect;
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
== dynamic-text-indent.html dynamic-text-indent-ref.html
|
||||
|
||||
== 1349646.html 1349646-ref.html
|
||||
|
Loading…
x
Reference in New Issue
Block a user