From 755062e72eb86981a702563457d0e91c0ed949c0 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 a120c17dcb4..ee1b436119b 100644 --- a/source +++ b/source @@ -48646,6 +48646,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. @@ -48655,9 +48658,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".

@@ -50627,15 +50631,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