Bug 223877 - HTMLInputElement.setRangeText does not update text value if HTMLInputElement is disconnected
Summary: HTMLInputElement.setRangeText does not update text value if HTMLInputElement ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Diego Pino
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-29 00:16 PDT by Diego Pino
Modified: 2022-07-19 21:05 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Pino 2021-03-29 00:16:14 PDT
HTMLInputElement.setRangeText does not update text value
Comment 1 Chris Dumez 2021-03-29 12:50:42 PDT
Would you be able to provide a reproduction case?
Comment 2 Diego Pino 2021-03-31 19:08:48 PDT
(In reply to Chris Dumez from comment #1)
> Would you be able to provide a reproduction case?

It seems it doesn't happen in all cases. It happens when an HTMLInputElement or HTMLTextAreaElement are disconnected.

There are actually two LayoutTests that already test this case:

* fast/forms/setrangetext.html
* imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-value-interactions.html

LayoutTests/fast/forms/setrangetext-expected.txt

Check that setRangeText() on disconnected elements doesn't crash and has proper values.
element.value = '0123456789'
element.setRangeText('ABC', 0, 0, 'select')
FAIL element.value should be ABC0123456789. Was 0123456789.

LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-value-interactions-expected.txt

FAIL value dirty flag behavior after setRangeText on textarea not in body assert_equals: Calling setRangeText should set the value dirty flag expected "somexyzing" but got "set range text"
FAIL value dirty flag behavior after setRangeText on input not in body assert_equals: Calling setRangeText should set the value dirty flag expected "somexyzing" but got "set range text"
Comment 3 Radar WebKit Bug Importer 2021-04-05 00:17:15 PDT
<rdar://problem/76207934>
Comment 4 Diego Pino 2022-07-19 21:05:39 PDT
Fixed by https://bugs.webkit.org/show_bug.cgi?id=237720.