Bug 1425440 - Get rid of GetChildAt_Deprecated in IMEContentObserver, r=catalinb
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user