Consider rename SetForcedLineBreakBefore() in nsLineBox
Categories
(Core :: Layout: Block and Inline, task)
Tracking
()
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.
Assignee | ||
Comment 2•1 year ago
|
||
Hide HasForcedLineBreak() from public interface since it is used only in
nsLineBox
.
Make ScrollableOverflowRect()
const since there is no reason not to.
Updated•1 year ago
|
Assignee | ||
Comment 3•1 year ago
|
||
This is the option b) in bug 1839994 comment 0.
Assignee | ||
Comment 4•1 year ago
|
||
Rename mHasForcedLineBreak
to mHasForcedLineBreakAftersince block lines don't need to set this bit. This patch removes setting the bit in
SetFloatClearTypeBefore(), and adds an assertion in
HasForcedLineBreakAfter()` to ensure that.
Improve HasFloatClearType(Before|After)
implementation by using
FloatClearType(Before|After)
.
This patch doesn't change behavior.
![]() |
||
Comment 6•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2885551667c6
https://hg.mozilla.org/mozilla-central/rev/95d4dc214cbe
https://hg.mozilla.org/mozilla-central/rev/a4d5b8607193
Description
•