Bug 1493043 - Change function arguments in RestyleManager from nsIFrame& to nsIFrame* r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D6452

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2018-09-21 17:45:49 +00:00
parent 57067c9ef0
commit 1fdd6d2def
3 changed files with 21 additions and 21 deletions

View File

@ -1921,9 +1921,9 @@ RestyleManager::AnimationsWithDestroyedFrame
#ifdef DEBUG
static bool
IsAnonBox(const nsIFrame& aFrame)
IsAnonBox(const nsIFrame* aFrame)
{
return aFrame.Style()->IsAnonBox();
return aFrame->Style()->IsAnonBox();
}
static const nsIFrame*
@ -1937,15 +1937,15 @@ FirstContinuationOrPartOfIBSplit(const nsIFrame* aFrame)
}
static const nsIFrame*
ExpectedOwnerForChild(const nsIFrame& aFrame)
ExpectedOwnerForChild(const nsIFrame* aFrame)
{
const nsIFrame* parent = aFrame.GetParent();
if (aFrame.IsTableFrame()) {
const nsIFrame* parent = aFrame->GetParent();
if (aFrame->IsTableFrame()) {
MOZ_ASSERT(parent->IsTableWrapperFrame());
parent = parent->GetParent();
}
if (IsAnonBox(aFrame) && !aFrame.IsTextFrame()) {
if (IsAnonBox(aFrame) && !aFrame->IsTextFrame()) {
if (parent->IsLineFrame()) {
parent = parent->GetParent();
}
@ -1953,11 +1953,11 @@ ExpectedOwnerForChild(const nsIFrame& aFrame)
nullptr : FirstContinuationOrPartOfIBSplit(parent);
}
if (aFrame.IsBulletFrame()) {
if (aFrame->IsBulletFrame()) {
return FirstContinuationOrPartOfIBSplit(parent);
}
if (aFrame.IsLineFrame()) {
if (aFrame->IsLineFrame()) {
// A ::first-line always ends up here via its block, which is therefore the
// right expected owner. That block can be an
// anonymous box. For example, we could have a ::first-line on a columnated
@ -1967,7 +1967,7 @@ ExpectedOwnerForChild(const nsIFrame& aFrame)
return parent;
}
if (aFrame.IsLetterFrame()) {
if (aFrame->IsLetterFrame()) {
// Ditto for ::first-letter. A first-letter always arrives here via its
// direct parent, except when it's parented to a ::first-line.
if (parent->IsLineFrame()) {
@ -1987,13 +1987,13 @@ ExpectedOwnerForChild(const nsIFrame& aFrame)
// We've handled already anon boxes and bullet frames, so now we're looking at
// a frame of a DOM element or pseudo. Hop through anon and line-boxes
// generated by our DOM parent, and go find the owner frame for it.
while (parent && (IsAnonBox(*parent) || parent->IsLineFrame())) {
while (parent && (IsAnonBox(parent) || parent->IsLineFrame())) {
auto* pseudo = parent->Style()->GetPseudo();
if (pseudo == nsCSSAnonBoxes::tableWrapper()) {
const nsIFrame* tableFrame = parent->PrincipalChildList().FirstChild();
MOZ_ASSERT(tableFrame->IsTableFrame());
// Handle :-moz-table and :-moz-inline-table.
parent = IsAnonBox(*tableFrame) ? parent->GetParent() : tableFrame;
parent = IsAnonBox(tableFrame) ? parent->GetParent() : tableFrame;
} else {
// We get the in-flow parent here so that we can handle the OOF anonymous
// boxed to get the correct parent.
@ -2016,12 +2016,12 @@ ServoRestyleState::AssertOwner(const ServoRestyleState& aParent) const
// chains of ServoRestyleStates in some cases where it's just not worth it.
#ifdef DEBUG
if (aParent.mOwner) {
const nsIFrame* owner = ExpectedOwnerForChild(*mOwner);
const nsIFrame* owner = ExpectedOwnerForChild(mOwner);
if (owner != aParent.mOwner) {
MOZ_ASSERT(IsAnonBox(*owner),
MOZ_ASSERT(IsAnonBox(owner),
"Should only have expected owner weirdness when anon boxes are involved");
bool found = false;
for (; owner; owner = ExpectedOwnerForChild(*owner)) {
for (; owner; owner = ExpectedOwnerForChild(owner)) {
if (owner == aParent.mOwner) {
found = true;
break;
@ -2034,7 +2034,7 @@ ServoRestyleState::AssertOwner(const ServoRestyleState& aParent) const
}
nsChangeHint
ServoRestyleState::ChangesHandledFor(const nsIFrame& aFrame) const
ServoRestyleState::ChangesHandledFor(const nsIFrame* aFrame) const
{
if (!mOwner) {
MOZ_ASSERT(!mChangesHandled);
@ -2399,7 +2399,7 @@ public:
uint32_t equalStructs;
mComputedHint = oldStyle->CalcStyleDifference(&aNewStyle, &equalStructs);
mComputedHint = NS_RemoveSubsumedHints(
mComputedHint, mParentRestyleState.ChangesHandledFor(*aTextFrame));
mComputedHint, mParentRestyleState.ChangesHandledFor(aTextFrame));
}
if (mComputedHint) {
@ -2515,7 +2515,7 @@ UpdateOneAdditionalComputedStyle(nsIFrame* aFrame,
aOldContext.CalcStyleDifference(newStyle, &equalStructs);
if (!aFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) {
childHint = NS_RemoveSubsumedHints(
childHint, aRestyleState.ChangesHandledFor(*aFrame));
childHint, aRestyleState.ChangesHandledFor(aFrame));
}
if (childHint) {
@ -2685,7 +2685,7 @@ RestyleManager::ProcessPostTraversal(
} else {
maybeAnonBoxChild = primaryFrame;
changeHint = NS_RemoveSubsumedHints(
changeHint, aRestyleState.ChangesHandledFor(*styleFrame));
changeHint, aRestyleState.ChangesHandledFor(styleFrame));
}
// If the parent wasn't restyled, the styles of our anon box parents won't

View File

@ -105,10 +105,10 @@ public:
#ifdef DEBUG
void AssertOwner(const ServoRestyleState& aParentState) const;
nsChangeHint ChangesHandledFor(const nsIFrame&) const;
nsChangeHint ChangesHandledFor(const nsIFrame*) const;
#else
void AssertOwner(const ServoRestyleState&) const {}
nsChangeHint ChangesHandledFor(const nsIFrame&) const
nsChangeHint ChangesHandledFor(const nsIFrame*) const
{
return mChangesHandled;
}

View File

@ -10781,7 +10781,7 @@ nsIFrame::UpdateStyleOfOwnedChildFrame(
// frame tree.
if (!aChildFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) {
childHint = NS_RemoveSubsumedHints(
childHint, aRestyleState.ChangesHandledFor(*aChildFrame));
childHint, aRestyleState.ChangesHandledFor(aChildFrame));
}
if (childHint) {
if (childHint & nsChangeHint_ReconstructFrame) {