Closed Bug 277355 Opened 21 years ago Closed 21 years ago

Column layout mishandles margins on child divs [columns]

Categories

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

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: roc)

Details

(Keywords: testcase)

Attachments

(4 files)

BUILD: 2005-01-06-08 trunk build STEPS TO REPRODUCE: 1) Load attached testcase 2) Note that text overlaps when it should not NOTES: It basically looks like the right margin is being ignored. A little experimentation shows that this is indeed what is happening -- the right margin is ignored (eg setting the left margin to 0 makes the text fill the column, instead of just the first 14em of the column.
Attached file Testcase
Assignee: nobody → roc
So one problem, based on printfs I stuck in, is that when we go to reflow the child and create its reflow state, we end up calling into Init() with aContainingBlockWidth == -1. So this code calls ComputeContainingBlockRectangle, which uses aContainingBlockRS->mComputedWidth as the aContainingBlockWidth. In this case, that happens to be NS_SHRINKWRAPWIDTH (why?). So when we're in ComputeBlockBoxData() we end up ignoring the availableWidth, since aContainingBlockWidth is shrink-wrap, and set mComputedWidth to NS_UNCONSTRAINEDSIZE. So it looks like the column-content block is screwing up somehow, probably by not doing a constrained reflow correctly after it does a size-finding reflow.... But why is it doing a size-finding reflow if it knows the column width?
Keywords: testcase
OS: Linux → All
Attached patch fixSplinter Review
One issue is that nsColumnSetFrame needs to pass in a 'fake' containing block width so we get the right CB width. A bigger issue was that -moz-column-content frames were getting 'display:inline' (initial value) which was causing confusion since we always create block frames for them. They should have display:inherit (in case we ever want to allow tables to be columnized, for example).
Attachment #172313 - Flags: superreview?(bzbarsky)
Attachment #172313 - Flags: review?(bzbarsky)
Comment on attachment 172313 [details] [diff] [review] fix Hmm.... So why is this the right thing to do? This will keep the reflow state from computing a height at all; is that what we want? That is should percentage heights in columns work? I don't think they will, with this patch...
Attachment #172313 - Flags: superreview?(bzbarsky)
Attachment #172313 - Flags: superreview-
Attachment #172313 - Flags: review?(bzbarsky)
Attachment #172313 - Flags: review-
Attached file testcase
appropriate testcase
Attached patch fixSplinter Review
OK, so this passes the correct height into the reflow state and also whacks ua.css so that the column block carries it down to any %-height children. It fixes the testcase.
Attachment #173028 - Flags: superreview?(bzbarsky)
Attachment #173028 - Flags: review?(bzbarsky)
Attachment #173027 - Attachment mime type: image/gif → text/html
Comment on attachment 173028 [details] [diff] [review] fix r+sr=bzbarsky. Guess we're saved from the quirks percent-height handling by the column-set frame... ;)
Attachment #173028 - Flags: superreview?(bzbarsky)
Attachment #173028 - Flags: superreview+
Attachment #173028 - Flags: review?(bzbarsky)
Attachment #173028 - Flags: review+
checked in
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Though I bet there is one case this still misses: height:inherit on the child....
Yeah, for that we need to mess around with the style context tree like we do for scrollframes.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: