Bug 541382. Buttons with non-visible overflow should clip their contents. r=roc

This commit is contained in:
Boris Zbarsky
2010-01-25 11:03:43 -05:00
parent 74077f515c
commit 1c87be06b3
4 changed files with 20 additions and 2 deletions

View File

@@ -179,8 +179,9 @@ nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Put the foreground outline and focus rects on top of the children
set.Content()->AppendToTop(&onTop);
// clips to our padding box for <input>s but not <button>s.
if (IsInput()) {
// clips to our padding box for <input>s but not <button>s, unless
// they have non-visible overflow..
if (IsInput() || GetStyleDisplay()->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE) {
nsMargin border = GetStyleBorder()->GetActualBorder();
nsRect rect(aBuilder->ToReferenceFrame(this), GetSize());
rect.Deflate(border);