From 40f7a4a6260e6624c489c5afd3cb8c4f508d5070 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Tue, 14 Mar 2017 17:34:23 -0400 Subject: [PATCH] Do not change input/textarea text selection for the same value Fixes #2412. --- source | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/source b/source index e0740c987e9..7770b40fbcb 100644 --- a/source +++ b/source @@ -48644,6 +48644,9 @@ You cannot submit this form when the field is incorrect.

On setting:

    +
  1. Let oldValue be the element's value.

  2. +
  3. Set the element's value to the new value.

  4. @@ -48653,9 +48656,10 @@ You cannot submit this form when the field is incorrect.
  5. Invoke the value sanitization algorithm, if the element's type attribute's current state defines one.

  6. -
  7. If the element has a text entry cursor position, move the text entry cursor position to - the end of the text control, unselecting any selected text and resetting the selection direction to "none".

  8. +
  9. If the new value is different from oldValue and the element has a text entry + cursor position, move the text entry cursor position to the end of the text control, + unselecting any selected text and resetting the + selection direction to "none".

@@ -50625,15 +50629,19 @@ interface HTMLTextAreaElement : HTMLElement { perform the following steps:

    +
  1. Let oldAPIValue be this element's API value.

  2. +
  3. Set this element's raw value to the new value.

  4. Set this element's dirty value flag to true.

  5. -
  6. Move the text entry cursor position to the end of the text control, unselecting any - selected text and resetting the selection - direction to "none".

  7. +
  8. If the new API value is different from + oldAPIValue, then move the text entry cursor position to the end of the text control, + unselecting any selected text and resetting the + selection direction to "none".

The textLength IDL attribute must