summaryrefslogtreecommitdiffstats
path: root/layout/generic/nsInlineFrame.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-12-06 23:39:47 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-12-06 23:39:47 +0100
commit642032029f65e9dc0d38fbb6d35ef656c73a292c (patch)
tree78a22bd12d679ab532db490d631ee69fa085aec1 /layout/generic/nsInlineFrame.cpp
parent50ef259a2df60d020ccb02d76dc5aa4835ee319e (diff)
parent2529b2edece0a0ed86553d1e73eef13c3848bf64 (diff)
downloadUXP-642032029f65e9dc0d38fbb6d35ef656c73a292c.tar
UXP-642032029f65e9dc0d38fbb6d35ef656c73a292c.tar.gz
UXP-642032029f65e9dc0d38fbb6d35ef656c73a292c.tar.lz
UXP-642032029f65e9dc0d38fbb6d35ef656c73a292c.tar.xz
UXP-642032029f65e9dc0d38fbb6d35ef656c73a292c.zip
Merge branch 'master' into release
Diffstat (limited to 'layout/generic/nsInlineFrame.cpp')
-rw-r--r--layout/generic/nsInlineFrame.cpp55
1 files changed, 9 insertions, 46 deletions
diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp
index 54d93c85a..7e188c247 100644
--- a/layout/generic/nsInlineFrame.cpp
+++ b/layout/generic/nsInlineFrame.cpp
@@ -199,8 +199,7 @@ nsInlineFrame::DestroyFrom(nsIFrame* aDestructRoot)
// Fixup the parent pointers for any child frames on the OverflowList.
// nsIFrame::DestroyFrom depends on that to find the sticky scroll
// container (an ancestor).
- nsIFrame* lineContainer = nsLayoutUtils::FindNearestBlockAncestor(this);
- DrainSelfOverflowListInternal(eForDestroy, lineContainer);
+ overflowFrames->ApplySetParent(this);
}
nsContainerFrame::DestroyFrom(aDestructRoot);
}
@@ -377,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) {
@@ -404,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 =
@@ -443,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;
@@ -495,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) {
@@ -505,11 +494,7 @@ 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) && !(aFlags & eForDestroy);
+ const bool doReparentSC = (aFlags & eInFirstLine);
RestyleManagerHandle restyleManager = PresContext()->RestyleManager();
for (nsIFrame* f = firstChild; f; f = f->GetNextSibling()) {
f->SetParent(this);
@@ -539,7 +524,7 @@ nsInlineFrame::DrainSelfOverflowList()
break;
}
}
- return DrainSelfOverflowListInternal(flags, lineContainer);
+ return DrainSelfOverflowListInternal(flags);
}
/* virtual */ bool
@@ -608,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);
@@ -1100,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);
@@ -1127,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();