mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 1391315 - Avoid using nsINode::GetChildAt() in TextEditRules::DocumentIsEmpty(); r=masayuki
This method will become a lot slower when bug 651120 lands.
This commit is contained in:
parent
32cc925261
commit
950a791753
@ -372,11 +372,10 @@ TextEditRules::DocumentIsEmpty()
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t childCount = rootElement->GetChildCount();
|
||||
for (uint32_t i = 0; i < childCount; i++) {
|
||||
nsINode* node = rootElement->GetChildAt(i);
|
||||
if (!EditorBase::IsTextNode(node) ||
|
||||
node->Length()) {
|
||||
for (nsIContent* child = rootElement->GetFirstChild();
|
||||
child; child = child->GetNextSibling()) {
|
||||
if (!EditorBase::IsTextNode(child) ||
|
||||
child->Length()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user