Bug 1447889 part 10. Remove nsIDOMRange::DeleteContents. r=mystor

MozReview-Commit-ID: IoXz0pS6zAa
This commit is contained in:
Boris Zbarsky 2018-03-27 00:35:21 -04:00
parent 1731f12f9d
commit 86c4629290
3 changed files with 5 additions and 12 deletions

View File

@ -2401,12 +2401,6 @@ nsRange::CutContents(DocumentFragment** aFragment)
return rv;
}
NS_IMETHODIMP
nsRange::DeleteContents()
{
return CutContents(nullptr);
}
void
nsRange::DeleteContents(ErrorResult& aRv)
{

View File

@ -22,7 +22,6 @@ interface nsIDOMRange : nsISupports
void setEndBefore(in nsIDOMNode refNode);
void setEndAfter(in nsIDOMNode refNode);
void deleteContents();
nsIDOMDocumentFragment extractContents();
nsIDOMDocumentFragment cloneContents();
void insertNode(in nsIDOMNode newNode);

View File

@ -2839,8 +2839,6 @@ nsFrameSelection::SetAncestorLimiter(nsIContent *aLimiter)
nsresult
nsFrameSelection::DeleteFromDocument()
{
nsresult res;
// If we're already collapsed, then we do nothing (bug 719503).
bool isCollapsed;
int8_t index = GetIndexFromSelectionType(SelectionType::eNormal);
@ -2856,9 +2854,11 @@ nsFrameSelection::DeleteFromDocument()
RefPtr<Selection> selection = mDomSelections[index];
for (uint32_t rangeIdx = 0; rangeIdx < selection->RangeCount(); ++rangeIdx) {
RefPtr<nsRange> range = selection->GetRangeAt(rangeIdx);
res = range->DeleteContents();
if (NS_FAILED(res))
return res;
ErrorResult res;
range->DeleteContents(res);
if (res.Failed()) {
return res.StealNSResult();
}
}
// Collapse to the new location.