Making them non-overflow containers is valid but then we can't just
append them to mFrames since that'll put them on the last line which
may result in some lines in-between the pulled child and its
continuation. That violates the invariant that in-flow continuations
in the same parent must be on consecutive lines (unless they are
overflow containers in which case they need to be on the
[Excess]OverflowContainers lists).
(The crash happens because if we push the lines in-between the two
continuations to the OverflowLines, then we won't find the 2nd
continuation on the first line of OverflowLines.)
(Note also that this change triggers the assertion in
DrainExcessOverflowContainersList, and depends on bug 1680406
to fix that and merge the lists.)
Differential Revision: https://phabricator.services.mozilla.com/D99560
This patch is generated via the rename functionality in my editor; add
`mozilla::` prefix to `OverflowAreas` in headers; and remove the
`OverflowType` alias added in Part 1.
Differential Revision: https://phabricator.services.mozilla.com/D97235
Similar to the optional aContainingBlockSize parameter, both border and
padding should use logical coordinates in ReflowInput::mFrame's writing
mode.
Table frames that need to override border and padding can be simplified a bit.
However, DR_init_constraints_cookie and DR_init_offsets_cookie become more
complex, but they're only for debugging. I'm not planning to update their
internal APIs.
Differential Revision: https://phabricator.services.mozilla.com/D95369
`IS_TRUE_OVERFLOW_CONTAINER` is defined in nsContainerFrame.h, but is
already used in several places in nsIFrame. It really should be an
nsIFrame's method.
Differential Revision: https://phabricator.services.mozilla.com/D92007
The three implementations of StealFrame() -- nsContainerFrame,
nsBlockFrame, and nsInlineFrame -- all have assertions to guarantee
aChild can be found, so the operation shouldn't fail.
This change shouldn't change behavior at all.
Differential Revision: https://phabricator.services.mozilla.com/D91996
This patch moves the preferred aspect-ratio calculation from each
replaced elements' GetIntrinicRatio() into GetAspectRatio(), because
they share the same logic.
For nsImageFrame, the cached mIntrinsicRatio now stores only the image's
intrinsic ratio, not considering the aspect-ratio property.
This patch fixed "object-fit:contain" for canvas, image because
GetIntrinicRatio() no longer considers aspect-ratio. This also fixed
replaced elements' size when both "aspect-ratio:<ratio>" and
"contain:size" is specified.
This also makes us pass some of the aspect-ratio tests because we change
GetIntrinicRatio() into GetAspectRatio() in
nsLayoutUtils::IntrinsicForAxis() in Part5, which is used by nsBlockFrame
(via nsLayoutUtils::IntrinsicForContainer) to implement GetMinISize().
Differential Revision: https://phabricator.services.mozilla.com/D91229
nsContainerFrame.h was only using the enum nsLayoutUtils::IntrinsicISizeType,
which this patch moves to LayoutConstants.h instead.
Depends on D91505
Differential Revision: https://phabricator.services.mozilla.com/D91506
Also combine the border and padding arguments for
nsContainerFrame::ComputeSizeWithIntrinsicDimensions(), too. This method
is used as a helper to implement ComputeSize() for various replaced
elements. Its callers are all within nsIFrame's derived classes'
overridden methods, so I'm not bothering to convert them in a separate
patch.
This change shouldn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D90064
In the next part, I'm going to use ComputeSizeFlags as the arguments in
some ReflowInput's methods. Because nsIFrame.h includes ReflowInput.h,
to solve the circular dependency, ComputeSizeFlags needs to be moved to
somewhere else.
Also, revise the document for ComputeSizeFlag. The rest of the patch is
just dropping `nsIFrame::` and adding `mozilla::` as needed.
This change shouldn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D89542
We already use SetProperty() extensively for nsFrameList properties like
OutsideMarkerProperty(), BackdropProperty(), etc, so we can simplify the
interface by removing SetPropTableFrames().
Differential Revision: https://phabricator.services.mozilla.com/D88459
Because the frame property look-up is expensive, change the
SetOverflowFrames(), SetOverflowContainers(), and
SetExcessOverflowContainers() to return the frame list so that the
caller don't need to use Get methods to retrieve it again.
Differential Revision: https://phabricator.services.mozilla.com/D88458
Not all APIs added in this patch are used immediately, but for the sake of
completeness, they are all added.
Their document will be updated in Part 3 after adding the relevant APIs for
ExcessOverflowContainersProperty().
nsContainerFrame::DrainExcessOverflowContainersList() has several calls to set
OverflowContainersProperty() whose life cycle need special attention. We will
deal with them later in Part 4.
Differential Revision: https://phabricator.services.mozilla.com/D88456
It's useful to use `std::move()` to indicate the frames' ownership in one list
is transferred to the another list.
For a frame list managed by AutoFrameListPtr, after moving its frames to
another list, it can be automatically deleted when it is going out of
scope.
Differential Revision: https://phabricator.services.mozilla.com/D88455
`ListChildLists` lives in nsContainerFrame because I'm going to use it
to improve nsContainerFrame::List() in a later patch.
Differential Revision: https://phabricator.services.mozilla.com/D82602
Also, rename it to GetFirstNonAnonBoxInSubtree() to reflect its
functionality more precisely that it can return the argument aFrame
itself.
Differential Revision: https://phabricator.services.mozilla.com/D81000
The modifications are all straightforward conversion except the one in
nsMathMLContainerFrame, where it is simplified by calling the equivalent
BuildDisplayListForInline() helper.
Differential Revision: https://phabricator.services.mozilla.com/D78166
This is to prevent the assertion at the beginning of
DrainExcessOverflowContainersList().
The invariant is described in the comment revised in this patch. That
is, "only one overflow containers list exists for a given frame: either
its own OverflowContainersProperty or its prev-in-flow's
ExcessOverflowContainersProperty, not both."
Differential Revision: https://phabricator.services.mozilla.com/D77328
StealOverflowFrames() and RemovePropTableFrames() use TakeProperty() to
remove the property, and transfer the ownership to the caller. Since
TakeProperty() is already marked as [[nodiscard]], so should they.
Differential Revision: https://phabricator.services.mozilla.com/D77567
This is to prevent the assertion at the beginning of
DrainExcessOverflowContainersList().
The invariant is described in the comment revised in this patch. That
is, "only one overflow containers list exists for a given frame: either
its own OverflowContainersProperty or its prev-in-flow's
ExcessOverflowContainersProperty, not both."
Differential Revision: https://phabricator.services.mozilla.com/D77328
I left all the bits that related to grid container, such as setting
aStatus, NS_STATE_GRID_DID_PUSH_ITEMS, and aState.mIter in
nsGridContainerFrame::ReflowRowsInFragmentainer().
Differential Revision: https://phabricator.services.mozilla.com/D68492
--HG--
extra : moz-landing-system : lando
We have duplicated ReparentFrame and ReparentFrames define in both
nsBlockFrame and nsGridContainerFrame. We should move them into
nsContainerFrame.
Differential Revision: https://phabricator.services.mozilla.com/D68490
--HG--
extra : moz-landing-system : lando
Currently, when using ReflowChildFlags::ApplyRelativePositioning flag in
FinishReflowChild(), we (implicitly) force the callers to pass aWM and
aPos in the same writing-mode as the reflow input, i.e. the child's
writing-mode. This results in an unintuitive LogicalPoint conversion
`mContainerSize - mMetrics.PhysicalSize()` in
nsBlockReflowContext::PlaceBlock().
We should allow the callers to use their preferred aWM and aPos (either
in parent's wm or child's wm), and do the necessary conversion in
FinishReflowChild() (like we did to convert aDesiredSize from
ReflowOutput's wm to aWM).
Also, correct the documentation for aWM in ReflowChild() and
FinishReflowChild(). aWM doesn't need to be the containing frame's
writing-mode. It can be any as long as it is the writing-mode that aPos
is used.
Differential Revision: https://phabricator.services.mozilla.com/D65859
--HG--
extra : moz-landing-system : lando
::marker content gets handled like text from any other CSS pseudo-class.
Therefore, using HTMLListBulletAccessible ends up duplicating the content already exposed in the a11y tree.
Now, we only use HTMLListBulletAccessible for nsBulletFrames instead of all marker frames.
As part of this, remove nsContainerFrame::GetSpokenMarkerContent, since we no longer need it to retrieve ::marker content.
The bulk of its other work was done by nsBulletFrame::GetSpokenContent, which we now call directly.
It also handled producing a default bullet character for list-style-image, but it makes sense for this to live in the a11y code.
Differential Revision: https://phabricator.services.mozilla.com/D63443
--HG--
extra : moz-landing-system : lando
The entire comment deleted in nsContainerFrame.cpp belongs to
FinishReflowChild(), which is already documented in the header.
Change `aChildFrame` to `aKidFrame` for ReflowChild() to match its
implementation.
Differential Revision: https://phabricator.services.mozilla.com/D61885
--HG--
extra : moz-landing-system : lando
This provides stronger typing and removes a bunch of subtle constants matching.
Differential Revision: https://phabricator.services.mozilla.com/D61058
--HG--
extra : moz-landing-system : lando