Bug 1442207: Remove unneeded arguments to nsIMutationObserver. r=smaug

aDocument is always content->OwnerDoc().
aContainer is always content->GetParent().

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

MozReview-Commit-ID: 4xwPCOnhyIL
This commit is contained in:
Emilio Cobos Álvarez
2018-03-01 12:36:58 +01:00
parent 8c82b58930
commit 0ff849122a
42 changed files with 369 additions and 729 deletions

View File

@@ -447,12 +447,11 @@ TableRowsCollection::HandleInsert(nsIContent* aContainer,
// nsIMutationObserver
void
TableRowsCollection::ContentAppended(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aFirstNewContent)
TableRowsCollection::ContentAppended(nsIContent* aFirstNewContent)
{
nsIContent* container = aFirstNewContent->GetParent();
if (!nsContentUtils::IsInSameAnonymousTree(mParent, aFirstNewContent) ||
!InterestingContainer(aContainer)) {
!InterestingContainer(container)) {
return;
}
@@ -460,37 +459,33 @@ TableRowsCollection::ContentAppended(nsIDocument* aDocument,
// appending into mParent, in which case we can provide the guess that we
// should insert at the end of the body, which can help us avoid potentially
// expensive work in the common case.
int32_t indexGuess = mParent == aContainer ? mFootStart : -1;
int32_t indexGuess = mParent == container ? mFootStart : -1;
// Insert each of the newly added content one at a time. The indexGuess should
// make insertions of a large number of elements cheaper.
for (nsIContent* content = aFirstNewContent;
content; content = content->GetNextSibling()) {
indexGuess = HandleInsert(aContainer, content, indexGuess);
indexGuess = HandleInsert(container, content, indexGuess);
}
}
void
TableRowsCollection::ContentInserted(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aChild)
TableRowsCollection::ContentInserted(nsIContent* aChild)
{
if (!nsContentUtils::IsInSameAnonymousTree(mParent, aChild) ||
!InterestingContainer(aContainer)) {
!InterestingContainer(aChild->GetParent())) {
return;
}
HandleInsert(aContainer, aChild);
HandleInsert(aChild->GetParent(), aChild);
}
void
TableRowsCollection::ContentRemoved(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aChild,
TableRowsCollection::ContentRemoved(nsIContent* aChild,
nsIContent* aPreviousSibling)
{
if (!nsContentUtils::IsInSameAnonymousTree(mParent, aChild) ||
!InterestingContainer(aContainer)) {
!InterestingContainer(aChild->GetParent())) {
return;
}