Open Bug 365131 Opened 18 years ago Updated 2 years ago

::first-letter handling should happen during frame construction, not reflow

Categories

(Core :: Layout: Block and Inline, defect)

x86
Linux
defect

Tracking

()

People

(Reporter: dbaron, Unassigned)

References

(Blocks 3 open bugs)

Details

I think ::first-letter handling should happen during frame construction, not reflow.  Computing what is the first letter can happen at frame construction time, and I think doing it there would be significantly simpler than the way we currently do it, during reflow.  It would also probably fix some :first-letter-related regressions from the reflow branch.

Fixing this would both reduce the cost of reflow and (I suspect) simplify the code involved.

See also bug 365130, about bidi reordering.
::first-letter can depend on the character data. Can we arrange for a character data change to trigger frame reconstruction?

E.g. I'm thinking of something like

div::first-letter { font-size:200%; }

<div>F<span>Lood</span></div>

where the F changes to " (a double-quote).
Wouldn't that make typing in textareas kinda slow?  If we reconstruct the frame, that means blowing away all the in-flows too...
It could be restricted to textframes in first-letters, probably.
Blocks: 362880
Bug 362880 comment 2 has some additional detail.
Blocks: 385615
Blocks: 442043
Blocks: 509685
I thought I had commented here a long time ago...

What would make this hard IMHO is that calculating the extent of the first-letter depends on cluster information which we get from textruns.
Well, I suppose we could do it in a pass right after frame construction; that would be good enough to solve the intrinsic width problems.
We can calculate cluster information earlier if we need to.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.