Closed
Bug 188787
Opened 22 years ago
Closed 20 years ago
Incremental reflow problem when setting label
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
People
(Reporter: bzbarsky, Assigned: hyatt)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
application/vnd.mozilla.xul+xml
|
Details |
Setting .label or the label attribute on a XUL checkbox will cause the text in it to wrap to as narrow a width as possible, if it's in the same hbox as a spacer. Having the label be defined statically (via attribute) does _not_ lead to such wrapping. Testcase coming up; this is blocking making the helper app dialog not suck.
Reporter | ||
Comment 1•22 years ago
|
||
Reporter | ||
Comment 2•22 years ago
|
||
This may be easier to debug; not a problem with <radio> per se....
Attachment #111343 -
Attachment is obsolete: true
Reporter | ||
Comment 3•22 years ago
|
||
So... this makes "sense". As far as I can tell (and this could be deeply wrong; I'm still wrapping my brain around the code), here is what's up. We have a box that's basically 0 by 0 (0 by 238 twips, actually, if my printfs are not lying to me). This box is actually a nsBoxToBlockAdaptor that contains the <label> block. Now we trigger a reflow. The nsBoxToBlockAdaptor is first flown at its current width/height. It constructs an nsHTMLReflowState with the available sizes being the current width (0) and NS_INTRINSICSIZE It sets the computed width/height to the current width/height (0, 238) and flows its block. The block comes back with a desired width that's as small as possible and a corresponding desired height (it just wraps the text as much as it can). I tried setting the computed width to NS_INTRINSICSIZE and that "fixed" this bug (it broke sizing of all sorts of other things, however). It seems like we should flow the block at both current size and intrinsic size and take the max of the two, or something... still trying to understand what nsSprocketLayout is doing with this stuff and whether it can be improved without breaking other things...
Reporter | ||
Comment 4•22 years ago
|
||
Reporter | ||
Comment 5•22 years ago
|
||
Comment on attachment 111606 [details] [diff] [review] hack upon hack, is the adaptor This seems like a major hack to me. Then again, so does 90% of the code in that method.... I've been unable to make this do anything particularly incorrect, in my testing so far. Could someone please tell my why we should not be doing this (other than the obvious cost of an extra reflow)? Oh, and I suppose we could set mComputeMEW ourselves on the desired size (we'd need to instantiate our own). I've not managed to create a case where aDesiredSize.mComputeMEW is _not_ set....
Attachment #111606 -
Flags: superreview?(dbaron)
Attachment #111606 -
Flags: review?(hyatt)
Reporter | ||
Comment 6•22 years ago
|
||
Comment on attachment 111606 [details] [diff] [review] hack upon hack, is the adaptor This breaks the profile manager. :(
Attachment #111606 -
Attachment is obsolete: true
Attachment #111606 -
Flags: superreview?(dbaron)
Attachment #111606 -
Flags: superreview-
Attachment #111606 -
Flags: review?(hyatt)
Attachment #111606 -
Flags: review-
Comment 7•22 years ago
|
||
bz: how do tables cope? If I open Composer, insert an unconstrained table, and start typing text into it, it automagically resizes until the desired width of the table exceeds the available width, at which point the text starts wrapping.
Reporter | ||
Comment 8•22 years ago
|
||
I'm not sure I understand quite how tables cope yet.. there is the secondary problem that this algorithm we're talking about here is a bridge between two different box models, so it has to deal with some crap that tables don't need to handle....
Comment 9•22 years ago
|
||
Is there an easy way to find the "slack" space available and add that on first?
Comment 11•20 years ago
|
||
Fixed by the patch in bug 255270.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•