Closed Bug 825999 Opened 11 years ago Closed 11 years ago

REGRESSION: overflow: hidden; on <button>s hides text but doesn't change the button's overflow area or that of its parents

Categories

(Core :: Layout: Form Controls, defect)

12 Branch
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: mcbain.asm, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: regression, testcase)

Attachments

(2 files)

Bug ID for previous issue with similar effect (resolved in 2010): 541382 (I don't know how to / can't re-open issues).

Regression of overflow handling on <button>s with a fixed width and overflow: hidden. Such buttons now behave as if their overflow was not hidden except that the overflow is not painted.

I noticed this on an existing site I wrote where such a button was nested in a sidebar. The site was designed to fill the viewport if the viewport was less than a certain width. Thus it never had a horizontal scrollbar for the page until this regression.

This regression causes space to appear to the right side of the sidebar with nothing in it and thus also cause a horizontal scrollbar for the page.

Attached is a test-case, using outline, that shows the effective (layout-affecting) width of a fixed width button with overflow compared to a normal div with the same styles. If you view this test-case in Firefox the effective width of the button is much larger than the div, which was not the case in prior versions of Firefox. If you view this in Chrome or Opera, no extra space is reserved for the overflowing text as expected. In all browsers, the overflowing text is not actually painted (as expected).
Hopefully this'll make it a link this time: bug 541382
Attachment #697123 - Attachment mime type: text/plain → text/html
Hmm.  Looks like this worked right in Firefox 11 but is already broken in Firefox 12.

Looks like the overflow area for the button includes the text (hence the effects on ancestor scrollbars and outlines), which isn't right.
Last Good: 73eaf1199ff0
First Bad: a915d5820eb8

Triggered by:
a915d5820eb8	Mats Palmgren — Bug 524925 - Consolidate overflow clipping checks to nsFrame::ApplyOverflowClipping(); and fix some code style nits. part=5/6 r=roc
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: 17 Branch → 12 Branch
Mats, could you take a look please?

At first glance, it looks like nsIFrame::FinishAndStoreOverflow used to call IsTableClip() for all frames but now we no longer do the equivalent of that or something?
Assignee: nobody → matspal
Summary: REGRESSION: overflow: hidden; on <button>s hides text but doesn't change effective layout width → REGRESSION: overflow: hidden; on <button>s hides text but doesn't change the button's overflow area or that of its parents
OS: Windows 7 → All
Hardware: x86_64 → All
roc, any idea what's going on here?
Using NEEDSINFO flag per comment 6.
Flags: needinfo?(roc)
Not off the top of my head.
Flags: needinfo?(roc)
Flags: needinfo?(matspal)
(In reply to Boris Zbarsky (:bz) from comment #5)
> At first glance, it looks like nsIFrame::FinishAndStoreOverflow used to call
> IsTableClip() for all frames but now we no longer do the equivalent of that
> or something?

Exactly so.  We now only do the overflow:hidden clipping for some frame types:
http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsFrame.h#594
adding "IsFrameOfType(nsIFrame::eReplacedContainsBlock)" there seems to fix it:
https://hg.mozilla.org/try/rev/e0941f547a54
(iirc, we only handle the non-scrollframe case here)

I'm going to investigate more to make sure I don't miss any cases this time...
and write regression tests since we apparently don't have any covering this.
Flags: needinfo?(matspal)
https://hg.mozilla.org/mozilla-central/rev/d0b6aff97358
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: