Right floats don't line up in a shrink-to-fit abs.pos. (breaks layout of menus/tabs/buttons at www.mozilla.org)

VERIFIED FIXED

Status

()

Core
Layout: R & A Pos
VERIFIED FIXED
14 years ago
13 years ago

People

(Reporter: mats, Assigned: mats)

Tracking

({regression, testcase})

Trunk
regression, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(6 attachments, 1 obsolete attachment)

(Assignee)

Description

14 years ago
Floats don't line up in a shrink-to-fit abs.pos.
This is a followup from bug 201897 comment 69.
(Assignee)

Comment 1

14 years ago
Created attachment 167187 [details]
Testcase #1
(Assignee)

Comment 2

14 years ago
Created attachment 167188 [details]
Testcase #2
Attachment #167187 - Attachment is obsolete: true
(Assignee)

Comment 3

14 years ago
Before reflow: availWidth=1073741824 aContainingBlockWidth=-1
After 1st reflow: kidDesiredSize.width=560 kidDesiredSize.mMaxElementWidth=280
availWidth=14350
Before reflow: availWidth=560 aContainingBlockWidth=14350
After 2nd reflow: kidDesiredSize.width=560
(Assignee)

Comment 4

14 years ago
Created attachment 167191 [details]
Testcase #3 (float:left)

float:left seems to work:

Before reflow: availWidth=1073741824 aContainingBlockWidth=-1
After 1st reflow: kidDesiredSize.width=840 kidDesiredSize.mMaxElementWidth=280
availWidth=14350
Before reflow: availWidth=840 aContainingBlockWidth=14350
After 2nd reflow: kidDesiredSize.width=840
(Assignee)

Comment 5

14 years ago
I think the reported preferred width of 560 is wrong in an unconstrained reflow.
Maybe the following block has something to do with it?
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/html/base/src/nsBlockReflowContext.cpp&rev=1.124&mark=439-459#435

(mSpace.width==NS_UNCONSTRAINEDSIZE on the 1st reflow there)
Summary: Floats don't line up in a shrink-to-fit abs.pos. → Right floats don't line up in a shrink-to-fit abs.pos.
(Assignee)

Comment 7

14 years ago
Created attachment 167204 [details]
Trace
(Assignee)

Comment 8

14 years ago
Created attachment 167206 [details] [diff] [review]
wallpaper

FWIW, this fixes the problem...
Isn't mAvailSpaceRect.XMost() be NS_UNCONSTRAINEDSIZE for an unconstrained reflow?
(Assignee)

Comment 10

14 years ago
Sometimes, see attachment 167204 [details] (which is without the wallpaper).
Why was the second float ok but not the third?

You should never do arithmetic on NS_UNCONSTRAINEDSIZE.
(Assignee)

Comment 12

14 years ago
(In reply to comment #11)
> Why was the second float ok but not the third?

Don't know yet...

> You should never do arithmetic on NS_UNCONSTRAINEDSIZE.

That I do know - but it still fixes the problem ;-)
(Assignee)

Comment 13

14 years ago
Created attachment 167222 [details]
Trace 2

It seems the problem occurs when setting psd->mRightEdge = NS_UNCONSTRAINEDSIZE

in nsLineLayout::UpdateBand(), it seems placing right floats after that isn't
working...
(Assignee)

Comment 15

14 years ago
Created attachment 167224 [details] [diff] [review]
wallpaper 2

Here is another wallpaper that seems to fix the problem also...
In nsLineLayout::UpdateBand() we are not really doing anything "to advance" in
the case when psd->mRightEdge is set to NS_UNCONSTRAINEDSIZE.
So this patch is just a wild guess... maybe there is code somewhere that
reasons
along the line of "hey, we tried to place a float but we didn't advance on the
line so let's move to the next line" ... or something...
(Assignee)

Comment 16

14 years ago
Comment on attachment 167224 [details] [diff] [review]
wallpaper 2

Note that this triggers a CRAZY_WIDTH(xmost) check in
nsBlockFrame::PostPlaceLine() though:
Area(ul)(3)@0x87801fc: line=0x878f1d8 xmost=1073741824
Area(li)(3)@0x87808e0: line=0x8780a68 xmost=1073743154
...

Comment 17

14 years ago
*** Bug 272099 has been marked as a duplicate of this bug. ***

Comment 18

14 years ago
*** Bug 272197 has been marked as a duplicate of this bug. ***
Blocks: 201897
No longer depends on: 201897

Comment 19

14 years ago
*** Bug 272601 has been marked as a duplicate of this bug. ***

Comment 20

14 years ago
*** Bug 272391 has been marked as a duplicate of this bug. ***

Comment 21

14 years ago
*** Bug 272734 has been marked as a duplicate of this bug. ***
Tweaking summary in the hope that it will reduce the number of dupes filed.
Summary: Right floats don't line up in a shrink-to-fit abs.pos. → Right floats don't line up in a shrink-to-fit abs.pos. (breaks menus at www.mozilla.org)

Comment 23

14 years ago
*** Bug 272770 has been marked as a duplicate of this bug. ***

Comment 24

14 years ago
*** Bug 272831 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 25

14 years ago
*** Bug 272887 has been marked as a duplicate of this bug. ***

Updated

14 years ago
Flags: blocking1.8a6?

Comment 26

14 years ago
*** Bug 272909 has been marked as a duplicate of this bug. ***

Comment 27

14 years ago
*** Bug 273000 has been marked as a duplicate of this bug. ***
*** Bug 273005 has been marked as a duplicate of this bug. ***
*** Bug 273204 has been marked as a duplicate of this bug. ***
*** Bug 273219 has been marked as a duplicate of this bug. ***
*** Bug 273331 has been marked as a duplicate of this bug. ***

Comment 32

14 years ago
*** Bug 273362 has been marked as a duplicate of this bug. ***

Updated

14 years ago
Summary: Right floats don't line up in a shrink-to-fit abs.pos. (breaks menus at www.mozilla.org) → Right floats don't line up in a shrink-to-fit abs.pos. (breaks menus/tabs at www.mozilla.org)

Comment 33

14 years ago
Tweaking the subject again along the dupes.
Summary: Right floats don't line up in a shrink-to-fit abs.pos. (breaks menus/tabs at www.mozilla.org) → Right floats don't line up in a shrink-to-fit abs.pos. (breaks layout of menus/tabs/buttons at www.mozilla.org)
This is working in the latest nightly Firefox build on Windows 2004-12-06-08-trunk
The buttons on www.mozilla.org are lined up correctly.

Comment 35

14 years ago
Yes, this was fixed by the "Patch rev. 10" in bug 201897, which was checked in
2004-12-05 16:27.
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Flags: blocking1.8a6?
Resolution: --- → FIXED
verified per my comment #34
Status: RESOLVED → VERIFIED
*** Bug 273430 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 38

14 years ago
*** Bug 273443 has been marked as a duplicate of this bug. ***
*** Bug 273559 has been marked as a duplicate of this bug. ***
*** Bug 273629 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.