<?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>252281</bug_id>
          
          <creation_ts>2023-02-14 18:50:54 -0800</creation_ts>
          <short_desc>REGRESSION (259904@main): window.getSelection() is empty for selection inside textarea</short_desc>
          <delta_ts>2023-04-22 12:21:37 -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>HTML Editing</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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>
          <dependson>216325</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yury Semikhatsky">yurys</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>darin</cc>
    
    <cc>m.goleb+bugzilla</cc>
    
    <cc>rniwa</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1933671</commentid>
    <comment_count>0</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2023-02-14 18:50:54 -0800</bug_when>
    <thetext>After https://commits.webkit.org/259904@main the following page shows empty selection when selecting some text inside the textarea, it was selected text before the change.


data:text/html,&lt;textarea&gt;Some text&lt;/textarea&gt;&lt;div&gt;empty&lt;/div&gt;
&lt;script&gt;
document.addEventListener(&apos;selectionchange&apos;, () =&gt; {
  let div = document.querySelector(&quot;div&quot;);
  div.textContent = window.getSelection().toString();
});
&lt;/script&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1933673</commentid>
    <comment_count>1</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-02-14 18:54:19 -0800</bug_when>
    <thetext>This is expected behavior change from enabling live range selection.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1934100</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2023-02-16 00:05:50 -0800</bug_when>
    <thetext>This is behavior that matches other web browsers and an intentional change. I’m not sure there’s anything more to say about this. We may want to close this bug unless there is additional insight about the effects of this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1934196</commentid>
    <comment_count>3</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2023-02-16 08:59:27 -0800</bug_when>
    <thetext>&gt; This is behavior that matches other web browsers and an intentional change.

In Chromium example above does capture actual selection within the text area. In Firefox it doesn&apos;t.

With that said, feel free to close this. If this is an intentional change in the behavior, we&apos;ll update our test expectations.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1934718</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2023-02-17 13:31:47 -0800</bug_when>
    <thetext>I think we should work together to decide what the behavior should be. I had no idea that Chromium and Firefox had different behavior.

We should add coverage in Web Platform Tests, write the behavior in some standard, and make sure all the browsers match for interoperability.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1935636</commentid>
    <comment_count>5</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2023-02-21 15:41:12 -0800</bug_when>
    <thetext>To avoid confusion, when talking about updating our tests I meant Playwright test expectations for WebKit (we noticed the change in the behavior with a recent WebKit roll).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1950511</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-04-21 16:47:43 -0700</bug_when>
    <thetext>Looks like at least one Apple internal website is broken due to this behavior difference. We may need to restore the old behavior of WebKit...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1950545</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-04-22 00:10:20 -0700</bug_when>
    <thetext>Reopening this bug to restore the old behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1950548</commentid>
    <comment_count>8</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-04-22 00:52:16 -0700</bug_when>
    <thetext>&lt;rdar://107622423&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1950549</commentid>
    <comment_count>9</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-04-22 00:52:18 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/13063</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1950586</commentid>
    <comment_count>10</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-04-22 12:21:35 -0700</bug_when>
    <thetext>Committed 263280@main (b6892f51e01e): &lt;https://commits.webkit.org/263280@main&gt;

Reviewed commits have been landed. Closing PR #13063 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>