[reflow branch] intrinsic widths computed incorrectly for ::first-letter

Assigned to



12 years ago
8 months ago


(Reporter: dbaron, Assigned: dbaron)


(Depends on: 1 bug, Blocks: 2 bugs)

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [first letter])


(1 attachment)

nsFirstLetterFrame needs to implement AddInlineMinWidth, AddInlinePrefWidth, GetMinWidth, and GetPrefWidth.
Created attachment 247589 [details]

The first and third tables should intrinsically size around the pref widh; the second and fourth around the min width.
So I did the implementations.  It turns out that making this really work requires splitting the first-letter at frame-construction time rather than at reflow.  This probably means:

 * making nsCSSFrameConstructor::CreateLetterFrame and nsCSSFrameConstructor::CreateFloatingLetterFrame actually do the split, and create the continuation with aIsFluid==PR_FALSE

 * removing the code that does the splits from nsTextFrame

 * moving the style context munging from nsFirstLetterFrame::Init to nsCSSFrameConstructor::CreateLetterFrame (if we even want the continuation letter frame at all!)

 * removing the first-letter-related code from nsLineLayout.

I propose doing this as a separate patch after the reflow branch lands.
Summary: [reflow branch] nsFirstLetterFrame: implement all 4 intrinsic width functions → [reflow branch] intrinsic widths computed incorrectly for ::first-letter
Duplicate of this bug: 877955
Duplicate of this bug: 1025447

Comment 6

3 years ago
Another test case, demonstrating how this bug has affected one of my websites in the wild:

This has been a long-standing and it doesn't look like it's received much attention.
It sounds like a fix would require a lot of familiarity with the codebase but is there anything an external contributor could to to help speed up the process?

Comment 9

8 months ago
I understand that it is a longstanding issue requiering fundamental core changes but can we hope a fix?
You need to log in before you can comment on or make changes to this bug.