Closed Bug 1839994 Opened 1 year ago Closed 3 months ago

Consider rename SetForcedLineBreakBefore() in nsLineBox

Categories

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

task

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

SetForcedLineBreakBefore() is confusing because it's all about float clearance for a block line, and not related forced inline line break.

Per naming suggestions by fantasai in matrix:

SetClearBefore()? :)
Or maybe SetFloatClearTypeBefore(), to parallel HasFloatClearTypeAfter() a few lines below
Or compromise and go with SetFloatClearBefore / HasFloatClearAfter / etc. ? :)
I guess options are
a) Shortest option: (Has|Set)Clear(Before|After)
b) Longest option: (Has|Set)FloatClearType(Before|After)
c) Halfway option: (Has|Set)FloatClear(Before|After)
I'm guessing for historical reasons (<br clear> existed before CSS clear) this is all mixed up with “break”
But my recommendation would be to keep Break as referring only to line break or page break, just use Clear when talking about clearance stuff

My preference would be b) since it complements the existing HasFloatClearTypeAfter().

The idea was, if you go with a) or c) you should rename HasFloatClearTypeAfter(). :) I agree they should be consistent.

Blocks: 1277128

Hide HasForcedLineBreak() from public interface since it is used only in
nsLineBox.

Make ScrollableOverflowRect() const since there is no reason not to.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

Rename mHasForcedLineBreak to mHasForcedLineBreakAftersince block lines don't need to set this bit. This patch removes setting the bit inSetFloatClearTypeBefore(), and adds an assertion inHasForcedLineBreakAfter()` to ensure that.

Improve HasFloatClearType(Before|After) implementation by using
FloatClearType(Before|After).

This patch doesn't change behavior.

Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/2885551667c6
Part 1 - Minor clean-up in nsLineBox interfaces. r=dholbert
https://hg.mozilla.org/integration/autoland/rev/95d4dc214cbe
Part 2 - Rename (Has|Set)ForcedLineBreakBefore to (Has|Set)FloatClearTypeBefore. r=dholbert
https://hg.mozilla.org/integration/autoland/rev/a4d5b8607193
Part 3 - Improve the implementation and docs around mHasForcedLineBreak and mFloatClearType. r=dholbert
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: