Bug 1425440 - Get rid of GetChildAt_Deprecated in IMEContentObserver, r=catalinb

This commit is contained in:
Andrea Marchesini
2018-01-05 15:23:25 +01:00
parent 0c160ffa23
commit 1230cf5f62
2 changed files with 0 additions and 23 deletions

View File

@@ -1263,23 +1263,6 @@ IMEContentObserver::ClearAddedNodesDuringDocumentChange()
", finished storing consecutive nodes", this));
}
// static
nsIContent*
IMEContentObserver::GetChildNode(nsINode* aParent, int32_t aOffset)
{
if (!aParent->HasChildren() || aOffset < 0 ||
aOffset >= static_cast<int32_t>(aParent->Length())) {
return nullptr;
}
if (!aOffset) {
return aParent->GetFirstChild();
}
if (aOffset == static_cast<int32_t>(aParent->Length() - 1)) {
return aParent->GetLastChild();
}
return aParent->GetChildAt_Deprecated(aOffset);
}
bool
IMEContentObserver::IsNextNodeOfLastAddedNode(nsINode* aParent,
nsIContent* aChild) const

View File

@@ -188,12 +188,6 @@ private:
bool IsSafeToNotifyIME() const;
bool IsEditorComposing() const;
/**
* nsINode::GetChildAt() is slow. So, this avoids to use it if it's
* first child or last child of aParent.
*/
static nsIContent* GetChildNode(nsINode* aParent, int32_t aOffset);
// Following methods are called by DocumentObserver when
// beginning to update the contents and ending updating the contents.
void BeginDocumentUpdate();