Investigate if it is possible to remove StyleClear::Line
Categories
(Core :: Layout: Block and Inline, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Attachments
(6 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
As far as I can tell, StyleClear::Line
[1] is abused by BRFrame to report a inline break-after status when it has clear:none
[2]. The status is later carrying to nsLineBox
[3].
I'd like to investigate if it is possible to remove StyleClear::Line
, and use something else in nsLineBox
to represent the "inline break-after but no float clearance" idea. I can imaging by doing so, we can
- simplify the
clear
property implementation in style system becauseStyleClear
enum values and theclear
property values are the same. - make the inline break-before, break-after, and float clearance clearer. Currently, these idea are mix together already, so it's super hard to improve
break-before
andbreak-after
for block/flex/grid [4].
[1] https://searchfox.org/mozilla-central/rev/534b95e2e21caaea3e5932fd5a99e4961c942f89/layout/style/nsStyleConsts.h#156-163
[2] https://searchfox.org/mozilla-central/rev/534b95e2e21caaea3e5932fd5a99e4961c942f89/layout/generic/BRFrame.cpp#154-160
[3] https://searchfox.org/mozilla-central/rev/534b95e2e21caaea3e5932fd5a99e4961c942f89/layout/generic/nsBlockFrame.cpp#4786-4800
[4] https://drafts.csswg.org/css-break-3/#break-between
Assignee | ||
Comment 1•2 years ago
|
||
This patch shouldn't change the behavior.
- Rename BlockReflowState's
mFloatBreakType
tomTrailingClearFromPIF
since
it's the cached result ofFindTrailingClear()
from the block's prev-in-flow.
Note thatmTrailingClearFromPIF
can haveStyleClear::Line
, which is
not a float clear value. We'll removeStyleClear::Line
in a later part to
make this 100% correct. - Rename
nsLayoutUtils::CombineBreakType
toCombineClearType
as well as its
arguments. - Simplify FindTrailingClear()'s implementation.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D158221
Assignee | ||
Comment 3•2 years ago
|
||
Before this patch, StyleClear::Line indicates that the nsLineBox has break-after
but no float clearance (note we don't allow line break-before with clear:none);
StyleClear::None indicates the line has no break-before nor break-after.
In this patch, I added mHasBreak
bit in nsLineBox to indicate the line has a
break so that StyleClear can serve its original meaning -- the float clearance.
Now, instead of using StyleClear::None to clear the line break status, the caller
should use ClearBreak(); Similar to set SetInlineLineBreakBeforeAndReset() and
SetInlineLineBreakAfter on nsReflowStatus, SetBreakTypeBefore/SetBreakTypeAfter
on nsLineBox always sets break status with an optional float clearance
parameter.
This patch shouldn't change the behavior.
Depends on D158222
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D158224
Assignee | ||
Comment 5•2 years ago
|
||
- Print StyleClear value verbatim.
- Remove mAllFlags since I doubt anyone can decipher FlagBits from it.
Depends on D158225
Assignee | ||
Comment 7•2 years ago
|
||
- Rename
mBreakType
tomFloatClearType
in nsLineBox and nsReflowStatus and
the methods around it. - Rename
mBreakType
tomFloatClear
in nsStyleDisplay. - Many other method parameters or local variables rename such as from
aBreakType
toaClearType
.
Depends on D158226
Comment 9•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4344f8070f22
https://hg.mozilla.org/mozilla-central/rev/389cb54bc4b9
https://hg.mozilla.org/mozilla-central/rev/1447d36bc677
https://hg.mozilla.org/mozilla-central/rev/7439d7af7545
https://hg.mozilla.org/mozilla-central/rev/3000987ae9a1
https://hg.mozilla.org/mozilla-central/rev/cbbc4c7145a9
Description
•