Remove nsReflowStatus::mTruncated
Categories
(Core :: Layout, enhancement, P3)
Tracking
()
People
(Reporter: heycam, Assigned: TYLin)
References
Details
Attachments
(7 files, 1 obsolete file)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1464761 Part 2 - Remove IsTruncated() in nsTableRowFrame::ReflowCellFrame(). r?jfkthame,dholbert
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1464761 Part 3 - Remove IsTruncated() in nsColumnSetFrame::ReflowChildren(). r?jfkthame,dholbert
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
384 bytes,
text/html
|
Details | |
77.84 KB,
image/png
|
Details | |
406 bytes,
text/html
|
Details |
Assignee | ||
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•2 years ago
|
||
I'd like to morph this bug into completely remove nsReflowStatus::mTruncated
bit and its getter and setter [1] for the following reasons:
- The purpose of this flag is for a non-top-of-page child frame to report that it cannot fit in the remaining available block-size [2], but only float [3] and table row frame [4] ever look at this bit. The callers can check the above condition themselves, and no need for every frame types to call
NS_FRAME_SET_TRUNCATION
at the end ofReflow()
. - The code checking orthogonal reflow in
nsReflowStatus::UpdateTruncated
[5] is not 100% correct becauseReflowOutput
might be initialized in child frame's writing-mode according to the document [6], and the ReflowOutput for flex item is an example [7].
[1] https://searchfox.org/mozilla-central/rev/1ce190047b9556c3c10ab4de70a0e61d893e2954/layout/generic/nsIFrame.h#276-283
[2] https://searchfox.org/mozilla-central/rev/1ce190047b9556c3c10ab4de70a0e61d893e2954/layout/generic/nsIFrame.cpp#257-260
[3] https://searchfox.org/mozilla-central/rev/1ce190047b9556c3c10ab4de70a0e61d893e2954/layout/generic/BlockReflowState.cpp#869
[4] https://searchfox.org/mozilla-central/rev/1ce190047b9556c3c10ab4de70a0e61d893e2954/layout/tables/nsTableRowFrame.cpp#1099
[5] https://searchfox.org/mozilla-central/rev/1ce190047b9556c3c10ab4de70a0e61d893e2954/layout/generic/nsIFrame.cpp#253-256
[6] https://searchfox.org/mozilla-central/rev/1ce190047b9556c3c10ab4de70a0e61d893e2954/layout/generic/ReflowOutput.h#171-175
[7] https://searchfox.org/mozilla-central/rev/1ce190047b9556c3c10ab4de70a0e61d893e2954/layout/generic/nsFlexContainerFrame.cpp#5692
Assignee | ||
Comment 4•2 years ago
|
||
The complicated if-statement is checking the float with the
following conditions:
- It is reflowed under a constrained available block-size.
- Its position is not at the top of the page.
- It has break-inside:avoid style.
- Its reflow status is not fully complete or its block-size exceeds
the available block-size. - It is a first-in-flow.
The condition 1, 2, and 4 are equivalent to reflowStatus.IsTruncated()
in the
previous if-statement. Also, assuming the float frame implements break-avoid, it
should report break-before if ShouldAvoidBreakInside()
is true.
FlowAndPlaceFloat() has already handled this via IsInlineBreakBefore()
check,
which covers condition 3 and 5.
The code coverage confirms that the branch in never reached.
https://coverage.moz.tools/#revision=e6e2286d2ac25001127a1cf54a87a95fb435c734&path=layout%2Fgeneric%2FBlockReflowState.cpp&view=file&line=877
But, we are going to remove IsTruncated() bit in a later patch, so instead of
removing the unused if-statement, we use part of it to replace the
IsTruncated().
Depends on D151457
Updated•2 years ago
|
Assignee | ||
Comment 5•2 years ago
|
||
We call NS_FRAME_SET_TRUNCATION (via nsReflowStatus::UpdateTruncated) in the end
of every frame's Reflow() to update nsReflowStatus::mTruncated bit. In the
following patches, I'm going to rewrite all the callers of IsTruncated(), and
ultimately remove the mTruncated bit.
In this patch, I rewrite the callsite in ReflowCellFrame() by moving
nsReflowStatus::UpdateTruncated logic [1] into it. Note that we use an assertion
in ReflowCellFrame to make sure nsTableRowFrame and nsTableCellFrame have the
same writing-mode.
The only test covering the code path is layout/reftests/bugs/409084-1a.html
.
Depends on D151458
Assignee | ||
Comment 6•2 years ago
|
||
In nsReflowStatus::UpdateTruncated(), mTruncated can be true only when
mIsTopOfPage is false. However, when we reflow -moz-column-content, we always
set mIsTopOfPage to true. Therefore, IsTruncated() always returns false, i.e.
!IsTruncated()
is always true.
Depends on D151459
Assignee | ||
Comment 7•2 years ago
|
||
In the description of the mTruncated bit, its purpose is the same as calling
SetInlineLineBreakBeforeAndReset(). We've removed all its usages in previous
patches, so the bit is no longer needed.
Depends on D151460
Comment 8•2 years ago
|
||
Here's a testcase whose behavior changes (for the worse, I think) with the current version of Part 1 here.
If this isn't a bug that's caught by our existing test suite, then let's be sure we include a version of this as a paged reftest (or a print WPT test) in some patch on this bug, to have automated coverage for this.
Comment 9•2 years ago
|
||
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Comment 14•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a344865b3232
https://hg.mozilla.org/mozilla-central/rev/b40423a5defb
https://hg.mozilla.org/mozilla-central/rev/e006e49cadba
https://hg.mozilla.org/mozilla-central/rev/fedad204cc81
Updated•2 years ago
|
Description
•