Bug 1343037 part 3. Get rid of nsIDOMHTMLTextareaElement's selectionStart and selectionEnd accessors. r=ehsan
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 09 Mar 2017 14:44:04 -0500
changeset 347102 3512debaa707969651b661c4bad61a04f4bf2c55
parent 347101 0ea9a26ce33a2564857185e844b3697cb5f448ec
child 347103 08db504dc8e4d9387b4b48626150b6f846df0558
push id31491
push usercbook@mozilla.com
push dateMon, 13 Mar 2017 14:24:00 +0000
treeherdermozilla-central@8d9fd089cabd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1343037
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1343037 part 3. Get rid of nsIDOMHTMLTextareaElement's selectionStart and selectionEnd accessors. r=ehsan MozReview-Commit-ID: Ca95YfRaq9r
dom/html/HTMLTextAreaElement.cpp
dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -685,55 +685,31 @@ NS_IMETHODIMP
 HTMLTextAreaElement::GetTextLength(int32_t *aTextLength)
 {
   NS_ENSURE_ARG_POINTER(aTextLength);
   *aTextLength = GetTextLength();
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-HTMLTextAreaElement::GetSelectionStart(int32_t *aSelectionStart)
-{
-  NS_ENSURE_ARG_POINTER(aSelectionStart);
-
-  ErrorResult error;
-  Nullable<uint32_t> selStart(GetSelectionStart(error));
-  if (error.Failed()) {
-    return error.StealNSResult();
-  }
-
-  *aSelectionStart = int32_t(selStart.Value());
-  return error.StealNSResult();
-}
-
 Nullable<uint32_t>
 HTMLTextAreaElement::GetSelectionStart(ErrorResult& aError)
 {
   int32_t selStart, selEnd;
   nsresult rv = GetSelectionRange(&selStart, &selEnd);
 
   if (NS_FAILED(rv) && mState.IsSelectionCached()) {
     return Nullable<uint32_t>(mState.GetSelectionProperties().GetStart());
   }
   if (NS_FAILED(rv)) {
     aError.Throw(rv);
   }
   return Nullable<uint32_t>(selStart);
 }
 
-NS_IMETHODIMP
-HTMLTextAreaElement::SetSelectionStart(int32_t aSelectionStart)
-{
-  ErrorResult error;
-  Nullable<uint32_t> selStart(aSelectionStart);
-  SetSelectionStart(selStart, error);
-  return error.StealNSResult();
-}
-
 void
 HTMLTextAreaElement::SetSelectionStart(const Nullable<uint32_t>& aSelectionStart,
                                        ErrorResult& aError)
 {
   int32_t selStart = 0;
   if (!aSelectionStart.IsNull()) {
     selStart = aSelectionStart.Value();
   }
@@ -760,55 +736,31 @@ HTMLTextAreaElement::SetSelectionStart(c
     end = start;
   }
   rv = SetSelectionRange(start, end, direction);
   if (NS_FAILED(rv)) {
     aError.Throw(rv);
   }
 }
 
-NS_IMETHODIMP
-HTMLTextAreaElement::GetSelectionEnd(int32_t *aSelectionEnd)
-{
-  NS_ENSURE_ARG_POINTER(aSelectionEnd);
-
-  ErrorResult error;
-  Nullable<uint32_t> selEnd(GetSelectionEnd(error));
-  if (error.Failed()) {
-    return error.StealNSResult();
-  }
-
-  *aSelectionEnd = int32_t(selEnd.Value());
-  return NS_OK;
-}
-
 Nullable<uint32_t>
 HTMLTextAreaElement::GetSelectionEnd(ErrorResult& aError)
 {
   int32_t selStart, selEnd;
   nsresult rv = GetSelectionRange(&selStart, &selEnd);
 
   if (NS_FAILED(rv) && mState.IsSelectionCached()) {
     return Nullable<uint32_t>(mState.GetSelectionProperties().GetEnd());
   }
   if (NS_FAILED(rv)) {
     aError.Throw(rv);
   }
   return Nullable<uint32_t>(selEnd);
 }
 
-NS_IMETHODIMP
-HTMLTextAreaElement::SetSelectionEnd(int32_t aSelectionEnd)
-{
-  ErrorResult error;
-  Nullable<uint32_t> selEnd(aSelectionEnd);
-  SetSelectionEnd(selEnd, error);
-  return error.StealNSResult();
-}
-
 void
 HTMLTextAreaElement::SetSelectionEnd(const Nullable<uint32_t>& aSelectionEnd,
                                      ErrorResult& aError)
 {
   int32_t selEnd = 0;
   if (!aSelectionEnd.IsNull()) {
     selEnd = aSelectionEnd.Value();
   }
--- a/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl
@@ -49,18 +49,16 @@ interface nsIDOMHTMLTextAreaElement : ns
   // http://www.whatwg.org/specs/web-apps/current-work/#the-constraint-validation-api
   readonly attribute boolean               willValidate;
   readonly attribute nsIDOMValidityState   validity;
   readonly attribute DOMString             validationMessage;
   boolean checkValidity();
   void setCustomValidity(in DOMString error);
 
   void select();
-           attribute long                  selectionStart;
-           attribute long                  selectionEnd;
   void setSelectionRange(in long selectionStart, in long selectionEnd, [optional] in DOMString direction);
            attribute DOMString             selectionDirection;
 
 
   // Mozilla extensions
   // Please make sure to update the HTMLTextAreaElement Web IDL interface to
   // mirror the list of Mozilla extensions here when changing it.
   readonly attribute nsIControllers   controllers;