Open Bug 1048582 Opened 10 years ago Updated 2 years ago

Should be consistent about whether nsHTMLReflowMetrics wants frame's writing mode or parent's writing mode

Categories

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

defect

Tracking

()

People

(Reporter: dbaron, Unassigned)

Details

I was looking at nsHTMLReflowMetrics, whose constructor takes either a writing mode, or a reflow state from which it can get the writing mode. It should be documented whether this is supposed to be the frame's writing mode or its parent's writing mode (and same for reflow state). Then we should be consistent about whether we pass the frame's or the parent's. Some callers pass the frame's, such as: nsBulletFrame::Get{Min,Pref}ISize nsColumnSetFrame::ReflowChildren nsFlexContainerFrame::MeasureFlexItemContentHeight nsFlexContainerFrame::SizeItemInCrossAxis nsFlexContainerFrame::DoFlexLayout while some callers pass the parent's, such as: nsAbsoluteContainingBlock::ReflowAbsoluteFrame nsBlockFrame::ReflowBullet (and its 3 callers) nsBlockReflowContext::nsBlockReflowContext nsCanvasFrame::Reflow nsContainerFrame::ReflowOverflowContainerChildren nsHTMLFramesetFrame::ReflowPlaceChild nsHTMLCanvasFrame::Reflow while some (for inlines) use the line writing mode: nsLineLayout::ReflowFrame while some callers pick yet other options, such as: nsFrame::RefreshSizeCache nsFrame::DoLayout nsHTMLScrollFrame::ReflowContents (this list compiled from the first half of the alphabet in layout/generic/ns[A-M]* ) This API was introduced in https://hg.mozilla.org/mozilla-central/rev/72591e9d49a8 and https://hg.mozilla.org/mozilla-central/rev/63a4ad62401a
Flags: needinfo?(jfkthame)
Yes indeed, we should clarify this and make things consistent. Offhand, I'm inclined to say we should be using the parent's writing mode, but I'd like to know what Simon thinks.
Flags: needinfo?(jfkthame) → needinfo?(smontagu)
In general, I agree the parent's writing mode, but perhaps we can't be 100% consistent? Using the line writing mode for inlines seems to me a legitimate exception to the rule.
Flags: needinfo?(smontagu)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.