summaryrefslogtreecommitdiff
path: root/layout/generic/nsInlineFrame.cpp
diff options
context:
space:
mode:
authorMats Palmgren <mats@mozilla.com>2019-11-29 10:48:50 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-11-29 10:48:50 +0100
commit6ea8e51aaa192d920ffd6b8a7d4cc4e998d7222a (patch)
treec1eb96e91f59a8bbf8afe08c085829411b1f254c /layout/generic/nsInlineFrame.cpp
parent013ef52eddc20d97d821195de85b4de27877dc58 (diff)
downloaduxp-6ea8e51aaa192d920ffd6b8a7d4cc4e998d7222a.tar.gz
Remove unnecessary calls to ReparentFloatsForInlineChild in
nsInlineFrame.
Diffstat (limited to 'layout/generic/nsInlineFrame.cpp')
-rw-r--r--layout/generic/nsInlineFrame.cpp49
1 files changed, 7 insertions, 42 deletions
diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp
index 5a04f0cd1e..7e188c247e 100644
--- a/layout/generic/nsInlineFrame.cpp
+++ b/layout/generic/nsInlineFrame.cpp
@@ -376,8 +376,6 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
bool lazilySetParentPointer = false;
- nsIFrame* lineContainer = aReflowInput.mLineLayout->LineContainerFrame();
-
// Check for an overflow list with our prev-in-flow
nsInlineFrame* prevInFlow = (nsInlineFrame*)GetPrevInFlow();
if (prevInFlow) {
@@ -403,12 +401,6 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
mFrames.SetFrames(*prevOverflowFrames);
lazilySetParentPointer = true;
} else {
- // Assign all floats to our block if necessary
- if (lineContainer && lineContainer->GetPrevContinuation()) {
- ReparentFloatsForInlineChild(lineContainer,
- prevOverflowFrames->FirstChild(),
- true);
- }
// Insert the new frames at the beginning of the child list
// and set their parent pointer
const nsFrameList::Slice& newFrames =
@@ -442,14 +434,13 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
if (aReflowInput.mLineLayout->GetInFirstLine()) {
flags = DrainFlags(flags | eInFirstLine);
}
- DrainSelfOverflowListInternal(flags, lineContainer);
+ DrainSelfOverflowListInternal(flags);
}
- // Set our own reflow state (additional state above and beyond
- // aReflowInput)
+ // Set our own reflow state (additional state above and beyond aReflowInput)
InlineReflowInput irs;
irs.mPrevFrame = nullptr;
- irs.mLineContainer = lineContainer;
+ irs.mLineContainer = aReflowInput.mLineLayout->LineContainerFrame();
irs.mLineLayout = aReflowInput.mLineLayout;
irs.mNextInFlow = (nsInlineFrame*) GetNextInFlow();
irs.mSetParentPointer = lazilySetParentPointer;
@@ -494,8 +485,7 @@ nsInlineFrame::AttributeChanged(int32_t aNameSpaceID,
}
bool
-nsInlineFrame::DrainSelfOverflowListInternal(DrainFlags aFlags,
- nsIFrame* aLineContainer)
+nsInlineFrame::DrainSelfOverflowListInternal(DrainFlags aFlags)
{
AutoFrameListPtr overflowFrames(PresContext(), StealOverflowFrames());
if (overflowFrames) {
@@ -504,9 +494,6 @@ nsInlineFrame::DrainSelfOverflowListInternal(DrainFlags aFlags,
// correct parent pointer. This is sometimes skipped by Reflow.
if (!(aFlags & eDontReparentFrames)) {
nsIFrame* firstChild = overflowFrames->FirstChild();
- if (aLineContainer && aLineContainer->GetPrevContinuation()) {
- ReparentFloatsForInlineChild(aLineContainer, firstChild, true);
- }
const bool doReparentSC = (aFlags & eInFirstLine);
RestyleManagerHandle restyleManager = PresContext()->RestyleManager();
for (nsIFrame* f = firstChild; f; f = f->GetNextSibling()) {
@@ -537,7 +524,7 @@ nsInlineFrame::DrainSelfOverflowList()
break;
}
}
- return DrainSelfOverflowListInternal(flags, lineContainer);
+ return DrainSelfOverflowListInternal(flags);
}
/* virtual */ bool
@@ -606,23 +593,8 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
while (frame) {
// Check if we should lazily set the child frame's parent pointer.
if (irs.mSetParentPointer) {
- bool havePrevBlock =
- irs.mLineContainer && irs.mLineContainer->GetPrevContinuation();
nsIFrame* child = frame;
do {
- // If our block is the first in flow, then any floats under the pulled
- // frame must already belong to our block.
- if (havePrevBlock) {
- // This has to happen before we update frame's parent; we need to
- // know frame's ancestry under its old block.
- // The blockChildren.ContainsFrame check performed by
- // ReparentFloatsForInlineChild here may be slow, but we can't
- // easily avoid it because we don't know where 'frame' originally
- // came from. If we really really have to optimize this we could
- // cache whether frame->GetParent() is under its containing blocks
- // overflowList or not.
- ReparentFloatsForInlineChild(irs.mLineContainer, child, false);
- }
child->SetParent(this);
if (inFirstLine) {
restyleManager->ReparentStyleContext(child);
@@ -1098,20 +1070,13 @@ nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
return; // XXX does this happen? why?
}
- nsIFrame* lineContainer = aReflowInput.mLineLayout->LineContainerFrame();
-
// Check for an overflow list with our prev-in-flow
nsFirstLineFrame* prevInFlow = (nsFirstLineFrame*)GetPrevInFlow();
if (prevInFlow) {
AutoFrameListPtr prevOverflowFrames(aPresContext,
prevInFlow->StealOverflowFrames());
if (prevOverflowFrames) {
- // Assign all floats to our block if necessary
- if (lineContainer && lineContainer->GetPrevContinuation()) {
- ReparentFloatsForInlineChild(lineContainer,
- prevOverflowFrames->FirstChild(),
- true);
- }
+ // Reparent the new frames and their style contexts.
const nsFrameList::Slice& newFrames =
mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);
ReparentChildListStyle(aPresContext, newFrames, this);
@@ -1125,7 +1090,7 @@ nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
// aReflowInput)
InlineReflowInput irs;
irs.mPrevFrame = nullptr;
- irs.mLineContainer = lineContainer;
+ irs.mLineContainer = aReflowInput.mLineLayout->LineContainerFrame();
irs.mLineLayout = aReflowInput.mLineLayout;
irs.mNextInFlow = (nsInlineFrame*) GetNextInFlow();