Bug 1410895: Multiple cleanups on top. r=bz

MozReview-Commit-ID: GX3dfmWL083

--HG--
extra : rebase_source : 5ed1b625356d7f561559747fae30f2342459538a
This commit is contained in:
Emilio Cobos Álvarez 2017-10-23 16:06:50 +02:00
Родитель 273bc65bb1
Коммит 3f918ff3a0
3 изменённых файлов: 11 добавлений и 22 удалений

Просмотреть файл

@ -206,7 +206,7 @@ nsIContent::GetFlattenedTreeParentNodeInternal(FlattenedParentType aType) const
} }
} }
if (parent && nsContentUtils::HasDistributedChildren(parent) && if (nsContentUtils::HasDistributedChildren(parent) &&
nsContentUtils::IsInSameAnonymousTree(parent, this)) { nsContentUtils::IsInSameAnonymousTree(parent, this)) {
// This node is distributed to insertion points, thus we // This node is distributed to insertion points, thus we
// need to consult the destination insertion points list to // need to consult the destination insertion points list to
@ -218,9 +218,9 @@ nsIContent::GetFlattenedTreeParentNodeInternal(FlattenedParentType aType) const
parent = destInsertionPoints && !destInsertionPoints->IsEmpty() ? parent = destInsertionPoints && !destInsertionPoints->IsEmpty() ?
destInsertionPoints->LastElement()->GetParent() : nullptr; destInsertionPoints->LastElement()->GetParent() : nullptr;
} else if (HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) { } else if (HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) {
nsIContent* insertionParent = GetXBLInsertionParent(); if (nsIContent* insertionPoint = GetXBLInsertionPoint()) {
if (insertionParent) { parent = insertionPoint->GetParent();
parent = insertionParent; MOZ_ASSERT(parent);
} }
} }

Просмотреть файл

@ -4805,8 +4805,7 @@ nsContentUtils::HasMutationListeners(nsINode* aNode,
return false; return false;
} }
if (aNode->IsNodeOfType(nsINode::eCONTENT) && if (aNode->IsContent() && aNode->AsContent()->ChromeOnlyAccess()) {
static_cast<nsIContent*>(aNode)->ChromeOnlyAccess()) {
return false; return false;
} }
@ -4832,11 +4831,11 @@ nsContentUtils::HasMutationListeners(nsINode* aNode,
return true; return true;
} }
if (aNode->IsNodeOfType(nsINode::eCONTENT)) { if (aNode->IsContent()) {
nsIContent* content = static_cast<nsIContent*>(aNode); nsIContent* insertionPoint = aNode->AsContent()->GetXBLInsertionPoint();
nsIContent* insertionParent = content->GetXBLInsertionParent(); if (insertionPoint) {
if (insertionParent) { aNode = insertionPoint->GetParent();
aNode = insertionParent; MOZ_ASSERT(aNode);
continue; continue;
} }
} }

Просмотреть файл

@ -7491,17 +7491,7 @@ nsCSSFrameConstructor::GetRangeInsertionPoint(nsIContent* aContainer,
return insertionPoint; // Don't build the frames. return insertionPoint; // Don't build the frames.
} }
bool hasInsertion = false; if (insertionPoint.mMultiple || aStartChild->GetXBLInsertionPoint()) {
if (!insertionPoint.mMultiple) {
// XXXbz XBL2/sXBL issue
nsIDocument* document = aStartChild->GetComposedDoc();
// XXXbz how would |document| be null here?
if (document && aStartChild->GetXBLInsertionParent()) {
hasInsertion = true;
}
}
if (insertionPoint.mMultiple || hasInsertion) {
// We have an insertion point. There are some additional tests we need to do // We have an insertion point. There are some additional tests we need to do
// in order to ensure that an append is a safe operation. // in order to ensure that an append is a safe operation.
uint32_t childCount = 0; uint32_t childCount = 0;