Closed Bug 466395 Opened 16 years ago Closed 16 years ago

misalignment of inline-blocks with fixed height and content overflowing at least 547px

Categories

(Core :: Layout: Block and Inline, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9.1b3

People

(Reporter: jwkbugzilla, Assigned: dbaron)

References

()

Details

(Keywords: testcase, verified1.9.1)

Attachments

(3 files)

Attached file Testcase
The testcase has an inline block like this:

<div style="display: inline-block; height: 100%;">
   much text
</div>

As soon as the text inside this block exceeds a certain height (maybe twice the window size?) this block is positioned in such a way that its bottom edge is where its top edge should be. This does not happen if the text inside the block doesn't reach "critical mass", and it also doesn't happen if the block is preceded by another inline block (or an image). And, of course, this doesn't happen in either Internet Explorer or Opera.

An Adblock Plus user noticed that issue on http://macbay.de/ - on this site #wrapper is the problematic block, and it only shows up correctly because it follows an image. If that image fails to load (for example because it was blocked by Adblock Plus) this bug strikes and makes the entire page unusable.

Reproduced in Firefox 3.0.4 and Minefield build 20081120.
Summary: Wrong positioning of inline blocks with procentual height → Wrong positioning of inline blocks with percent height
I bet nsLineLayout::VerticalAlignFrames is getting confused by a box having a baseline that's so far outside of itself because we're going above VERTICAL_ALIGN_FRAMES_NO_MINIMUM.  (The baseline is the position of the last line.)
Attached patch patchSplinter Review
Just as I thought.

The bug turns out to be quirks-mode only.  I added one test in quirks mode (fails without patch, passes with) and one in standards mode (passes with or without patch).
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Attachment #349681 - Flags: superreview?(roc)
Attachment #349681 - Flags: review?(roc)
Note that the condition required to cause the bug is that you need an inline-block whose content overflows it such that the baseline of the last line of the inline block is at least 547px (== 2^15 appunits) below the bottom of the inline-block.
Summary: Wrong positioning of inline blocks with percent height → misalignment of inline-blocks with fixed height and content overflowing it by more than 547px
Summary: misalignment of inline-blocks with fixed height and content overflowing it by more than 547px → misalignment of inline-blocks with fixed height and content overflowing at least 547px
Attachment #349681 - Flags: superreview?(roc)
Attachment #349681 - Flags: superreview+
Attachment #349681 - Flags: review?(roc)
Attachment #349681 - Flags: review+
Comment on attachment 349681 [details] [diff] [review]
patch

Very simple patch to fix a rather nasty bug (or at least postpone it to *much* larger sizes).
Attachment #349681 - Flags: approval1.9.1?
OS: Windows XP → All
Hardware: PC → All
Comment on attachment 349681 [details] [diff] [review]
patch

a191=beltzner
Attachment #349681 - Flags: approval1.9.1? → approval1.9.1+
http://hg.mozilla.org/mozilla-central/rev/11f15643c403
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b3
Given that this affects real-world sites that are broken without being aware of it - should this land on 1.9.0 branch as well? The patch is very simple and I don't see any risk there.
Blocks: abp
Keywords: fixed1.9.1
1.9.1
reftests: http://hg.mozilla.org/releases/mozilla-1.9.1/rev/2a0beb6161ed
pushed: http://hg.mozilla.org/releases/mozilla-1.9.1/rev/11f15643c403


trunk:
reftests: http://hg.mozilla.org/mozilla-central/rev/b7d995725e14

verified FIXED on builds: 
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090505 Minefield/3.6a1pre ID:20090505030940

and

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b5pre) Gecko/20090505 Shiretoko/3.5b5pre ID:20090505030932
Status: RESOLVED → VERIFIED
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: