зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1383641 - GetFlatTextLengthInRange shouldn't use nsIDOMNode version of nsRange::SetStart. r=masayuki
nsGenericDOMDataNode::SetData uses GetFlatTextLengthInRange. But GetFlatTextLengthInRange still use nsIDOMNode. It means that we need additional QI twice. So we should use nsINode version directly instead. MozReview-Commit-ID: 3FX0uPGh53O --HG-- extra : rebase_source : 1a4689ae8744062af8cc1f112b89075ddf3e1271
This commit is contained in:
Родитель
a46b077ea1
Коммит
27cd039649
|
@ -166,18 +166,30 @@ public:
|
|||
}
|
||||
nsresult SetToRangeStart(nsRange* aRange) const
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(mNode));
|
||||
return aRange->SetStart(domNode, mOffset);
|
||||
if (!IsValid()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
ErrorResult errorResult;
|
||||
aRange->SetStart(*mNode, mOffset, errorResult);
|
||||
return errorResult.StealNSResult();
|
||||
}
|
||||
nsresult SetToRangeEnd(nsRange* aRange) const
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(mNode));
|
||||
return aRange->SetEnd(domNode, mOffset);
|
||||
if (!IsValid()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
ErrorResult errorResult;
|
||||
aRange->SetEnd(*mNode, mOffset, errorResult);
|
||||
return errorResult.StealNSResult();
|
||||
}
|
||||
nsresult SetToRangeEndAfter(nsRange* aRange) const
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(mNode));
|
||||
return aRange->SetEndAfter(domNode);
|
||||
if (!IsValid()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
ErrorResult errorResult;
|
||||
aRange->SetEndAfter(*mNode, errorResult);
|
||||
return errorResult.StealNSResult();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче