mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-02 12:07:52 +00:00
Bug 1001994. r=roc
This commit is contained in:
parent
dee96fd3f7
commit
1eba32a97e
@ -176,6 +176,20 @@ nsInlineFrame::PeekOffsetCharacter(bool aForward, int32_t* aOffset,
|
||||
return CONTINUE;
|
||||
}
|
||||
|
||||
void
|
||||
nsInlineFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
||||
{
|
||||
nsFrameList* overflowFrames = GetOverflowFrames();
|
||||
if (overflowFrames) {
|
||||
// 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);
|
||||
}
|
||||
nsContainerFrame::DestroyFrom(aDestructRoot);
|
||||
}
|
||||
|
||||
void
|
||||
nsInlineFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
@ -422,11 +436,12 @@ nsInlineFrame::DrainSelfOverflowListInternal(DrainFlags aFlags,
|
||||
if (aLineContainer && aLineContainer->GetPrevContinuation()) {
|
||||
ReparentFloatsForInlineChild(aLineContainer, firstChild, true);
|
||||
}
|
||||
const bool inFirstLine = (aFlags & eInFirstLine);
|
||||
const bool doReparentSC =
|
||||
(aFlags & eInFirstLine) && !(aFlags & eForDestroy);
|
||||
RestyleManager* restyleManager = PresContext()->RestyleManager();
|
||||
for (nsIFrame* f = firstChild; f; f = f->GetNextSibling()) {
|
||||
f->SetParent(this);
|
||||
if (inFirstLine) {
|
||||
if (doReparentSC) {
|
||||
restyleManager->ReparentStyleContext(f);
|
||||
nsLayoutUtils::MarkDescendantsDirty(f);
|
||||
}
|
||||
|
@ -63,6 +63,8 @@ public:
|
||||
virtual FrameSearchResult PeekOffsetCharacter(bool aForward, int32_t* aOffset,
|
||||
bool aRespectClusters = true) MOZ_OVERRIDE;
|
||||
|
||||
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
||||
|
||||
// nsIHTMLReflow overrides
|
||||
virtual void AddInlineMinWidth(nsRenderingContext *aRenderingContext,
|
||||
InlineMinWidthData *aData) MOZ_OVERRIDE;
|
||||
@ -165,6 +167,9 @@ private:
|
||||
enum DrainFlags {
|
||||
eDontReparentFrames = 1, // skip reparenting the overflow list frames
|
||||
eInFirstLine = 2, // the request is for an inline descendant of a nsFirstLineFrame
|
||||
eForDestroy = 4, // the request is from DestroyFrom; in this case we do the
|
||||
// minimal work required since the frame is about to be
|
||||
// destroyed (just fixup parent pointers)
|
||||
};
|
||||
/**
|
||||
* Move any frames on our overflow list to the end of our principal list.
|
||||
|
Loading…
x
Reference in New Issue
Block a user