From be3f78fea8c318f2a16a9ca8dbb57d1de7093bd6 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 9 Mar 2017 14:44:04 -0500 Subject: [PATCH] Bug 1343037 part 7. Get rid of nsIDOMHTMLTextareaElement's selectionDirection attribute. r=ehsan MozReview-Commit-ID: EQWxjgTdloR --- dom/html/HTMLTextAreaElement.cpp | 30 ++++--------------- .../html/nsIDOMHTMLTextAreaElement.idl | 1 - 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/dom/html/HTMLTextAreaElement.cpp b/dom/html/HTMLTextAreaElement.cpp index 937696726f28..5d55547abdd4 100644 --- a/dom/html/HTMLTextAreaElement.cpp +++ b/dom/html/HTMLTextAreaElement.cpp @@ -721,9 +721,8 @@ HTMLTextAreaElement::SetSelectionStart(const Nullable& aSelectionStart } nsAutoString direction; - nsresult rv = GetSelectionDirection(direction); - if (NS_FAILED(rv)) { - aError.Throw(rv); + GetSelectionDirection(direction, aError); + if (aError.Failed()) { return; } int32_t start, end; @@ -735,7 +734,7 @@ HTMLTextAreaElement::SetSelectionStart(const Nullable& aSelectionStart if (end < start) { end = start; } - rv = SetSelectionRange(start, end, direction); + nsresult rv = SetSelectionRange(start, end, direction); if (NS_FAILED(rv)) { aError.Throw(rv); } @@ -764,9 +763,8 @@ HTMLTextAreaElement::SetSelectionEnd(const Nullable& aSelectionEnd, } nsAutoString direction; - nsresult rv = GetSelectionDirection(direction); - if (NS_FAILED(rv)) { - aError.Throw(rv); + GetSelectionDirection(direction, aError); + if (aError.Failed()) { return; } int32_t start, end; @@ -778,7 +776,7 @@ HTMLTextAreaElement::SetSelectionEnd(const Nullable& aSelectionEnd, if (start > end) { start = end; } - rv = SetSelectionRange(start, end, direction); + nsresult rv = SetSelectionRange(start, end, direction); if (NS_FAILED(rv)) { aError.Throw(rv); } @@ -806,14 +804,6 @@ DirectionToName(nsITextControlFrame::SelectionDirection dir, nsAString& aDirecti } } -nsresult -HTMLTextAreaElement::GetSelectionDirection(nsAString& aDirection) -{ - ErrorResult error; - GetSelectionDirection(aDirection, error); - return error.StealNSResult(); -} - void HTMLTextAreaElement::GetSelectionDirection(nsAString& aDirection, ErrorResult& aError) { @@ -836,14 +826,6 @@ HTMLTextAreaElement::GetSelectionDirection(nsAString& aDirection, ErrorResult& a aError.Throw(rv); } -NS_IMETHODIMP -HTMLTextAreaElement::SetSelectionDirection(const nsAString& aDirection) -{ - ErrorResult error; - SetSelectionDirection(aDirection, error); - return error.StealNSResult(); -} - void HTMLTextAreaElement::SetSelectionDirection(const nsAString& aDirection, ErrorResult& aError) diff --git a/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl b/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl index 6e1d324bd672..38bdfd3a4f47 100644 --- a/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl +++ b/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl @@ -55,7 +55,6 @@ interface nsIDOMHTMLTextAreaElement : nsISupports void select(); void setSelectionRange(in long selectionStart, in long selectionEnd, [optional] in DOMString direction); - attribute DOMString selectionDirection; // Mozilla extensions