Bug 1925478 - Simplify nsMathMLContainerFrame::DidReflowChildren. r=fredw

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D226144
This commit is contained in:
Emilio Cobos Álvarez 2024-10-18 19:19:48 +00:00
parent 28463c11dd
commit c1dda0bb6e
2 changed files with 12 additions and 20 deletions

View File

@ -1343,22 +1343,16 @@ nscoord nsMathMLContainerFrame::FixInterFrameSpacing(
}
/* static */
void nsMathMLContainerFrame::DidReflowChildren(nsIFrame* aFirst,
nsIFrame* aStop)
{
if (MOZ_UNLIKELY(!aFirst)) return;
for (nsIFrame* frame = aFirst; frame != aStop;
frame = frame->GetNextSibling()) {
NS_ASSERTION(frame, "aStop isn't a sibling");
if (frame->HasAnyStateBits(NS_FRAME_IN_REFLOW)) {
// finish off principal descendants, too
nsIFrame* grandchild = frame->PrincipalChildList().FirstChild();
if (grandchild) DidReflowChildren(grandchild, nullptr);
frame->DidReflow(frame->PresContext(), nullptr);
void nsMathMLContainerFrame::DidReflowChildren(nsIFrame* aFirst) {
for (nsIFrame* frame = aFirst; frame; frame = frame->GetNextSibling()) {
if (!frame->HasAnyStateBits(NS_FRAME_IN_REFLOW)) {
continue;
}
if (nsIFrame* grandchild = frame->PrincipalChildList().FirstChild()) {
// Finish off principal descendants, too
DidReflowChildren(grandchild);
}
frame->DidReflow(frame->PresContext(), nullptr);
}
}

View File

@ -361,12 +361,10 @@ class nsMathMLContainerFrame : public nsContainerFrame, public nsMathMLFrame {
void GatherAndStoreOverflow(ReflowOutput* aMetrics);
/**
* Call DidReflow() if the NS_FRAME_IN_REFLOW frame bit is set on aFirst and
* all its next siblings up to, but not including, aStop.
* aStop == nullptr meaning all next siblings with the bit set.
* The method does nothing if aFirst == nullptr.
* Call DidReflow() if the NS_FRAME_IN_REFLOW frame bit is set on aFirst
* and all its next siblings. The method does nothing if aFirst == nullptr.
*/
static void DidReflowChildren(nsIFrame* aFirst, nsIFrame* aStop = nullptr);
static void DidReflowChildren(nsIFrame* aFirst);
/**
* Recompute mIntrinsicISize if it's not already up to date.