Bug 1343037 part 12. Implement nsTextEditorState::SetSelectionStart. r=ehsan

This introduces three behavior changes:

1)  Before this change, in cached mode, we did not enforce the "start <= end"
    invariant.
2)  Before this change, in cached mode, we did not fire "select" events on
    selectionStart changes.
3)  Changes the IDL type of HTMLInputElement's selectionStart attribute to
    "unsigned long" to match the spec and HTMLTextareaElement.

MozReview-Commit-ID: JM9XXMMPUHM
This commit is contained in:
Boris Zbarsky
2017-03-09 14:44:05 -05:00
parent 229548759d
commit f1bf8c9867
9 changed files with 147 additions and 79 deletions

View File

@@ -246,7 +246,7 @@ public:
// Methods for nsFormFillController so it can do selection operations on input
// types the HTML spec doesn't support them on, like "email".
int32_t GetSelectionStartIgnoringType(ErrorResult& aRv);
uint32_t GetSelectionStartIgnoringType(ErrorResult& aRv);
int32_t GetSelectionEndIgnoringType(ErrorResult& aRv);
void GetDisplayFileName(nsAString& aFileName) const;
@@ -717,8 +717,8 @@ public:
// XPCOM Select() is OK
Nullable<int32_t> GetSelectionStart(ErrorResult& aRv);
void SetSelectionStart(const Nullable<int32_t>& aValue, ErrorResult& aRv);
Nullable<uint32_t> GetSelectionStart(ErrorResult& aRv);
void SetSelectionStart(const Nullable<uint32_t>& aValue, ErrorResult& aRv);
Nullable<int32_t> GetSelectionEnd(ErrorResult& aRv);
void SetSelectionEnd(const Nullable<int32_t>& aValue, ErrorResult& aRv);