<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>223877</bug_id>
          
          <creation_ts>2021-03-29 00:16:14 -0700</creation_ts>
          <short_desc>HTMLInputElement.setRangeText does not update text value if HTMLInputElement is disconnected</short_desc>
          <delta_ts>2022-07-19 21:05:39 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=237720</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Diego Pino">dpino</reporter>
          <assigned_to name="Diego Pino">dpino</assigned_to>
          <cc>cdumez</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1744702</commentid>
    <comment_count>0</comment_count>
    <who name="Diego Pino">dpino</who>
    <bug_when>2021-03-29 00:16:14 -0700</bug_when>
    <thetext>HTMLInputElement.setRangeText does not update text value</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744839</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-03-29 12:50:42 -0700</bug_when>
    <thetext>Would you be able to provide a reproduction case?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1745919</commentid>
    <comment_count>2</comment_count>
    <who name="Diego Pino">dpino</who>
    <bug_when>2021-03-31 19:08:48 -0700</bug_when>
    <thetext>(In reply to Chris Dumez from comment #1)
&gt; Would you be able to provide a reproduction case?

It seems it doesn&apos;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&apos;t crash and has proper values.
element.value = &apos;0123456789&apos;
element.setRangeText(&apos;ABC&apos;, 0, 0, &apos;select&apos;)
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 &quot;somexyzing&quot; but got &quot;set range text&quot;
FAIL value dirty flag behavior after setRangeText on input not in body assert_equals: Calling setRangeText should set the value dirty flag expected &quot;somexyzing&quot; but got &quot;set range text&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1746908</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-04-05 00:17:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/76207934&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1885293</commentid>
    <comment_count>4</comment_count>
    <who name="Diego Pino">dpino</who>
    <bug_when>2022-07-19 21:05:39 -0700</bug_when>
    <thetext>Fixed by https://bugs.webkit.org/show_bug.cgi?id=237720.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>