Closed
Bug 277355
Opened 20 years ago
Closed 20 years ago
Column layout mishandles margins on child divs [columns]
Categories
(Core :: Layout: Block and Inline, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bzbarsky, Assigned: roc)
Details
(Keywords: testcase)
Attachments
(4 files)
906 bytes,
text/html
|
Details | |
2.25 KB,
patch
|
bzbarsky
:
review-
bzbarsky
:
superreview-
|
Details | Diff | Splinter Review |
1.01 KB,
text/html
|
Details | |
3.13 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
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.
Reporter | ||
Comment 1•20 years ago
|
||
Reporter | ||
Updated•20 years ago
|
Assignee: nobody → roc
Reporter | ||
Comment 2•20 years ago
|
||
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?
Assignee | ||
Comment 3•20 years ago
|
||
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)
Reporter | ||
Comment 4•20 years ago
|
||
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...
Reporter | ||
Comment 5•20 years ago
|
||
Comment on attachment 172313 [details] [diff] [review] fix r- per comment 4.
Attachment #172313 -
Flags: superreview?(bzbarsky)
Attachment #172313 -
Flags: superreview-
Attachment #172313 -
Flags: review?(bzbarsky)
Attachment #172313 -
Flags: review-
Assignee | ||
Comment 6•20 years ago
|
||
appropriate testcase
Assignee | ||
Comment 7•20 years ago
|
||
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)
Reporter | ||
Updated•20 years ago
|
Attachment #173027 -
Attachment mime type: image/gif → text/html
Reporter | ||
Comment 8•20 years ago
|
||
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+
Assignee | ||
Comment 9•20 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 10•20 years ago
|
||
Though I bet there is one case this still misses: height:inherit on the child....
Assignee | ||
Comment 11•20 years ago
|
||
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.
Description
•