Closed
Bug 381703
Opened 17 years ago
Closed 17 years ago
nsFirstLetterFrame shouldn't compute its size before reflow
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
People
(Reporter: roc, Assigned: roc)
References
Details
Attachments
(2 files, 1 obsolete file)
243 bytes,
text/html
|
Details | |
3.35 KB,
patch
|
dbaron
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
The attached testcase shows a bug where the available width passed to a text frame for text after a first-letter ("ab d") is not being adjusted for the width of the first-letter "a". This leads to the text not wrapping where it should. The cause is that "ab d" is wrapped in an nsFirstLetterFrame, which had had ComputeSize() called on it, which returned zero for the width. Then when it gets reflowed the reflow state's ComputedWidth() is not NS_UNCONSTRAINEDSIZE so we don't adjust the available width in nsLineLayout::ReflowFrame: if (reflowState.ComputedWidth() == NS_UNCONSTRAINEDSIZE) reflowState.availableWidth = psd->mRightEdge - psd->mX; I think the best fix is to make nsFirstLetterFrame behave like inlines and text, overriding ComputeSize to return NS_UNCONSTRAINEDSIZE. I'll attach a patch for that. It's a bit unfortunate that non-first-letter text is wrapped in nsFirstLetterFrames. I guess it's simpler that way. (The styles are correct because only the true first-letter has the right pseudo-style.) I don't see an easy way to make a reftest for this...
Assignee | ||
Comment 1•17 years ago
|
||
Hmm, I wonder if this works with floating first-letters. Maybe ComputeSize should only be overridden for non-first-letter nsFirstLetterFrames.
Assignee | ||
Comment 2•17 years ago
|
||
I like this better. True first-letters keep the current behaviour of computing their size in ComputeSize(); non-first-letters behave like spans.
Attachment #265793 -
Attachment is obsolete: true
Attachment #265794 -
Flags: superreview?(dbaron)
Attachment #265794 -
Flags: review?(dbaron)
Comment on attachment 265794 [details] [diff] [review] better patch >+ // We're behaving like a span; don't compute size before reflow. How about: We're wrapping the text *after* the first letter, so behave like an inline frame. ? r+sr=dbaron
Attachment #265794 -
Flags: superreview?(dbaron)
Attachment #265794 -
Flags: superreview+
Attachment #265794 -
Flags: review?(dbaron)
Attachment #265794 -
Flags: review+
Comment 4•17 years ago
|
||
The patch was already landed, so is this bug fixed?
Assignee | ||
Comment 5•17 years ago
|
||
yes
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•