зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1414666 part 2 - A few formatting improvements after mass conversion of PresContext()->PresShell() to PresShell(). r=emilio
MozReview-Commit-ID: FoEnINS0Jbk
This commit is contained in:
Родитель
1c2b8c222e
Коммит
770a2228d1
|
@ -4132,9 +4132,8 @@ void HTMLMediaElement::SetPlayedOrSeeked(bool aValue)
|
|||
if (!frame) {
|
||||
return;
|
||||
}
|
||||
frame->PresShell()->FrameNeedsReflow(frame,
|
||||
nsIPresShell::eTreeChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
frame->PresShell()->FrameNeedsReflow(frame, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -7266,8 +7266,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
PresShell* shell =
|
||||
static_cast<PresShell*>(frame->PresShell());
|
||||
PresShell* shell = static_cast<PresShell*>(frame->PresShell());
|
||||
switch (aEvent->mMessage) {
|
||||
case eTouchMove:
|
||||
case eTouchCancel:
|
||||
|
@ -7296,8 +7295,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
|||
break;
|
||||
}
|
||||
|
||||
shell = static_cast<PresShell*>(
|
||||
contentFrame->PresShell());
|
||||
shell = static_cast<PresShell*>(contentFrame->PresShell());
|
||||
if (shell) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -3278,8 +3278,7 @@ nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect,
|
|||
}
|
||||
|
||||
if (aFlags & IGNORE_ROOT_SCROLL_FRAME) {
|
||||
nsIFrame* rootScrollFrame =
|
||||
aFrame->PresShell()->GetRootScrollFrame();
|
||||
nsIFrame* rootScrollFrame = aFrame->PresShell()->GetRootScrollFrame();
|
||||
if (rootScrollFrame) {
|
||||
builder.SetIgnoreScrollFrame(rootScrollFrame);
|
||||
}
|
||||
|
@ -4763,8 +4762,7 @@ nsLayoutUtils::IsViewportScrollbarFrame(nsIFrame* aFrame)
|
|||
if (!aFrame)
|
||||
return false;
|
||||
|
||||
nsIFrame* rootScrollFrame =
|
||||
aFrame->PresShell()->GetRootScrollFrame();
|
||||
nsIFrame* rootScrollFrame = aFrame->PresShell()->GetRootScrollFrame();
|
||||
if (!rootScrollFrame)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -200,9 +200,8 @@ nsMeterFrame::AttributeChanged(int32_t aNameSpaceID,
|
|||
aAttribute == nsGkAtoms::min )) {
|
||||
nsIFrame* barFrame = mBarDiv->GetPrimaryFrame();
|
||||
NS_ASSERTION(barFrame, "The meter frame should have a child with a frame!");
|
||||
PresShell()->FrameNeedsReflow(barFrame,
|
||||
nsIPresShell::eResize,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
PresShell()->FrameNeedsReflow(barFrame, nsIPresShell::eResize,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
InvalidateFrame();
|
||||
}
|
||||
|
||||
|
|
|
@ -761,7 +761,7 @@ nsRangeFrame::AttributeChanged(int32_t aNameSpaceID,
|
|||
}
|
||||
} else if (aAttribute == nsGkAtoms::orient) {
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eResize,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3044,9 +3044,8 @@ nsBlockFrame::AttributeChanged(int32_t aNameSpaceID,
|
|||
if (ancestor) {
|
||||
// XXX Not sure if this is necessary anymore
|
||||
if (ancestor->RenumberList()) {
|
||||
PresShell()->
|
||||
FrameNeedsReflow(ancestor, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(ancestor, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,8 +95,7 @@ nsContainerFrame::SetInitialChildList(ChildListID aListID,
|
|||
"The placeholder should points to a backdrop frame");
|
||||
}
|
||||
#endif
|
||||
nsFrameList* list =
|
||||
new (PresShell()) nsFrameList(aChildList);
|
||||
nsFrameList* list = new (PresShell()) nsFrameList(aChildList);
|
||||
SetProperty(BackdropProperty(), list);
|
||||
} else {
|
||||
MOZ_ASSERT_UNREACHABLE("Unexpected child list");
|
||||
|
@ -118,9 +117,8 @@ nsContainerFrame::AppendFrames(ChildListID aListID,
|
|||
mFrames.AppendFrames(this, aFrameList);
|
||||
|
||||
if (aListID != kNoReflowPrincipalList) {
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,9 +140,8 @@ nsContainerFrame::InsertFrames(ChildListID aListID,
|
|||
mFrames.InsertFrames(this, aPrevFrame, aFrameList);
|
||||
|
||||
if (aListID != kNoReflowPrincipalList) {
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1987,9 +1984,8 @@ nsContainerFrame::AttributeChanged(int32_t aNameSpaceID,
|
|||
|
||||
// XXX Not sure if this is necessary anymore
|
||||
if (RenumberList()) {
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
|
|
|
@ -2150,9 +2150,8 @@ nsImageFrame::AttributeChanged(int32_t aNameSpaceID,
|
|||
}
|
||||
if (nsGkAtoms::alt == aAttribute)
|
||||
{
|
||||
PresShell()->FrameNeedsReflow(this,
|
||||
nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -3311,9 +3311,9 @@ public:
|
|||
|
||||
virtual void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override {
|
||||
mFrame->PresShell()->PaintCount(mFrameName, aCtx,
|
||||
mFrame->PresContext(),
|
||||
mFrame, ToReferenceFrame(),
|
||||
mColor);
|
||||
mFrame->PresContext(),
|
||||
mFrame, ToReferenceFrame(),
|
||||
mColor);
|
||||
}
|
||||
NS_DISPLAY_DECL_NAME("nsDisplayReflowCount", TYPE_REFLOW_COUNT)
|
||||
protected:
|
||||
|
@ -3324,7 +3324,7 @@ protected:
|
|||
#define DO_GLOBAL_REFLOW_COUNT_DSP(_name) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
|
||||
PresShell()->IsPaintingFrameCounts()) { \
|
||||
PresShell()->IsPaintingFrameCounts()) { \
|
||||
aLists.Outlines()->AppendNewToTop( \
|
||||
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name)); \
|
||||
} \
|
||||
|
@ -3333,7 +3333,7 @@ protected:
|
|||
#define DO_GLOBAL_REFLOW_COUNT_DSP_COLOR(_name, _color) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
|
||||
PresShell()->IsPaintingFrameCounts()) { \
|
||||
PresShell()->IsPaintingFrameCounts()) { \
|
||||
aLists.Outlines()->AppendNewToTop( \
|
||||
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name, _color)); \
|
||||
} \
|
||||
|
|
|
@ -270,9 +270,8 @@ nsTableColGroupFrame::RemoveChild(nsTableColFrame& aChild,
|
|||
}
|
||||
}
|
||||
|
||||
PresShell()->FrameNeedsReflow(this,
|
||||
nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -2578,7 +2578,7 @@ nsTableFrame::AppendFrames(ChildListID aListID,
|
|||
Dump(true, true, true);
|
||||
#endif
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
SetGeometryDirty();
|
||||
}
|
||||
|
||||
|
@ -2750,7 +2750,7 @@ nsTableFrame::HomogenousInsertFrames(ChildListID aListID,
|
|||
}
|
||||
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
SetGeometryDirty();
|
||||
#ifdef DEBUG_TABLE_CELLMAP
|
||||
printf("=== TableFrame::InsertFrames\n");
|
||||
|
|
|
@ -219,7 +219,7 @@ nsTableRowFrame::AppendFrames(ChildListID aListID,
|
|||
}
|
||||
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
tableFrame->SetGeometryDirty();
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ nsTableRowFrame::InsertFrames(ChildListID aListID,
|
|||
tableFrame->InsertCells(cellChildren, GetRowIndex(), colIndex);
|
||||
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
tableFrame->SetGeometryDirty();
|
||||
}
|
||||
|
||||
|
@ -284,9 +284,8 @@ nsTableRowFrame::RemoveFrame(ChildListID aListID,
|
|||
// Remove the frame and destroy it
|
||||
mFrames.DestroyFrame(aOldFrame);
|
||||
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
|
||||
tableFrame->SetGeometryDirty();
|
||||
}
|
||||
|
|
|
@ -1489,9 +1489,8 @@ nsTableRowGroupFrame::AppendFrames(ChildListID aListID,
|
|||
if (rows.Length() > 0) {
|
||||
nsTableFrame* tableFrame = GetTableFrame();
|
||||
tableFrame->AppendRows(this, rowIndex, rows);
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
tableFrame->SetGeometryDirty();
|
||||
}
|
||||
}
|
||||
|
@ -1539,9 +1538,8 @@ nsTableRowGroupFrame::InsertFrames(ChildListID aListID,
|
|||
int32_t rowIndex = (prevRow) ? prevRow->GetRowIndex() + 1 : startRowIndex;
|
||||
tableFrame->InsertRows(this, rows, rowIndex, true);
|
||||
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
tableFrame->SetGeometryDirty();
|
||||
}
|
||||
}
|
||||
|
@ -1561,9 +1559,8 @@ nsTableRowGroupFrame::RemoveFrame(ChildListID aListID,
|
|||
// remove the rows from the table (and flag a rebalance)
|
||||
tableFrame->RemoveRows(*rowFrame, 1, true);
|
||||
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
tableFrame->SetGeometryDirty();
|
||||
}
|
||||
mFrames.DestroyFrame(aOldFrame);
|
||||
|
|
|
@ -122,7 +122,7 @@ nsTableWrapperFrame::AppendFrames(ChildListID aListID,
|
|||
// Reflow the new caption frame. It's already marked dirty, so
|
||||
// just tell the pres shell.
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -141,7 +141,7 @@ nsTableWrapperFrame::InsertFrames(ChildListID aListID,
|
|||
// Reflow the new caption frame. It's already marked dirty, so
|
||||
// just tell the pres shell.
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -161,9 +161,8 @@ nsTableWrapperFrame::RemoveFrame(ChildListID aListID,
|
|||
// Remove the frame and destroy it
|
||||
mCaptionFrames.DestroyFrame(aOldFrame);
|
||||
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN); // also means child removed
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1030,9 +1030,8 @@ nsBoxFrame::RemoveFrame(ChildListID aListID,
|
|||
aOldFrame->Destroy();
|
||||
|
||||
// mark us dirty and generate a reflow command
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1067,9 +1066,8 @@ nsBoxFrame::InsertFrames(ChildListID aListID,
|
|||
SetDebugOnChildList(state, mFrames.FirstChild(), true);
|
||||
#endif
|
||||
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1101,9 +1099,8 @@ nsBoxFrame::AppendFrames(ChildListID aListID,
|
|||
|
||||
// XXXbz why is this NS_FRAME_FIRST_REFLOW check here?
|
||||
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1228,8 +1225,8 @@ nsBoxFrame::AttributeChanged(int32_t aNameSpaceID,
|
|||
UpdateMouseThrough();
|
||||
}
|
||||
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
else if (aAttribute == nsGkAtoms::ordinal) {
|
||||
nsIFrame* parent = GetParentXULBox(this);
|
||||
|
@ -1242,9 +1239,8 @@ nsBoxFrame::AttributeChanged(int32_t aNameSpaceID,
|
|||
StyleDisplay()->mDisplay != mozilla::StyleDisplay::MozPopup) {
|
||||
parent->XULRelayoutChildAtOrdinal(this);
|
||||
// XXXldb Should this instead be a tree change on the child or parent?
|
||||
PresShell()->
|
||||
FrameNeedsReflow(parent, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
PresShell()->FrameNeedsReflow(parent, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
}
|
||||
// If the accesskey changed, register for the new value
|
||||
|
@ -1256,8 +1252,8 @@ nsBoxFrame::AttributeChanged(int32_t aNameSpaceID,
|
|||
mContent->IsXULElement(nsGkAtoms::tree)) {
|
||||
// Reflow ourselves and all our children if "rows" changes, since
|
||||
// nsTreeBodyFrame's layout reads this from its parent (this frame).
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -945,7 +945,7 @@ nsMenuPopupFrame::ShowPopup(bool aIsContextMenu)
|
|||
// do we need an actual reflow here?
|
||||
// is SetPopupPosition all that is needed?
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
|
||||
if (mPopupType == ePopupTypeMenu) {
|
||||
nsCOMPtr<nsISound> sound(do_CreateInstance("@mozilla.org/sound;1"));
|
||||
|
|
|
@ -1792,9 +1792,8 @@ nsTreeBodyFrame::MarkDirtyIfSelect()
|
|||
// XXX optimize this more
|
||||
|
||||
mStringWidth = -1;
|
||||
PresShell()->FrameNeedsReflow(this,
|
||||
nsIPresShell::eTreeChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2920,8 +2919,8 @@ nsTreeBodyFrame::PaintTreeBody(gfxContext& aRenderingContext,
|
|||
|
||||
if (oldPageCount != mPageLength || mHorzWidth != CalcHorzWidth(GetScrollParts())) {
|
||||
// Schedule a ResizeReflow that will update our info properly.
|
||||
PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eResize,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
int32_t rowCount = mRowCount;
|
||||
|
|
Загрузка…
Ссылка в новой задаче