<?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>197047</bug_id>
          
          <creation_ts>2019-04-17 19:02:17 -0700</creation_ts>
          <short_desc>Update UIKit when a cut causes a selection change</short_desc>
          <delta_ts>2019-04-19 20:06:55 -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>New Bugs</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Megan Gardner">megan_gardner</reporter>
          <assigned_to name="Megan Gardner">megan_gardner</assigned_to>
          <cc>bdakin</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>thorton</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1528372</commentid>
    <comment_count>0</comment_count>
    <who name="Megan Gardner">megan_gardner</who>
    <bug_when>2019-04-17 19:02:17 -0700</bug_when>
    <thetext>Update UIKIt when a cut causes a selection change</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528373</commentid>
    <comment_count>1</comment_count>
      <attachid>367711</attachid>
    <who name="Megan Gardner">megan_gardner</who>
    <bug_when>2019-04-17 19:05:28 -0700</bug_when>
    <thetext>Created attachment 367711
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528377</commentid>
    <comment_count>2</comment_count>
    <who name="Megan Gardner">megan_gardner</who>
    <bug_when>2019-04-17 19:14:33 -0700</bug_when>
    <thetext>&lt;rdar://problem/36311563&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528378</commentid>
    <comment_count>3</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-04-17 19:38:41 -0700</bug_when>
    <thetext>This looks reasonable! A couple of brief comments:

- I think we want the same logic in -pasteForWebView:. There&apos;s the reverse of this bug, where if a user (1) copies something, (2) makes a ranged selection, and then (3) pastes, one would expect the undo/redo buttons to show up, but the copy/paste/cut buttons are still there, probably because we don&apos;t tell UIKit that the selection changes. I *think* this would also be fixed by applying your fix to the paste case. But if you prefer, we can do this as a followup.

- I believe writing an API test for this shouldn&apos;t be *too* bad. I&apos;ve recently written some tests in KeyboardInputTestsIOS.mm that focus editable fields and check the state of UIBarButtonItemGroups. You might be able to use these tests as a template.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528593</commentid>
    <comment_count>4</comment_count>
    <who name="Megan Gardner">megan_gardner</who>
    <bug_when>2019-04-18 14:26:48 -0700</bug_when>
    <thetext>After several hours of trying, a test has been determined to be unfeasible. I&apos;ll fix the copy bug in a followup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528606</commentid>
    <comment_count>5</comment_count>
      <attachid>367711</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-04-18 14:57:53 -0700</bug_when>
    <thetext>Comment on attachment 367711
Patch

Clearing flags on attachment: 367711

Committed r244438: &lt;https://trac.webkit.org/changeset/244438&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528608</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-04-18 14:57:55 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528853</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2019-04-19 14:01:55 -0700</bug_when>
    <thetext>What about when the webpage itself calls execCommand(&quot;Cut&quot;)? Do we eventually need a different solution to make sure that case is also correctly handled?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1529015</commentid>
    <comment_count>8</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-04-19 20:06:55 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #7)
&gt; What about when the webpage itself calls execCommand(&quot;Cut&quot;)? Do we
&gt; eventually need a different solution to make sure that case is also
&gt; correctly handled?

Yes, I think we need a different solution for that to work (which may obviate the need for this change). In fact, there&apos;s a FIXME for it elsewhere in this file:

    (WKContentViewInteraction.mm:5656) // FIXME: We need to figure out what to do if the selection is changed by Javascript.

We may, for example, want to consider having UIKit re-validate its input assistant items after executing an editing command.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>367711</attachid>
            <date>2019-04-17 19:05:28 -0700</date>
            <delta_ts>2019-04-18 14:57:53 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-197047-20190417190527.patch</filename>
            <type>text/plain</type>
            <size>1469</size>
            <attacher name="Megan Gardner">megan_gardner</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjQ0MTk3CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0L0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCmluZGV4IDQ1M2UwZWY2YjgzMmM5MjE5
MmRmMzhiZDgyZTA1ODQ0NjEwNDRjNDQuLjg0YjFhMWQzMGJkYjIyOTAxNmNkOGY1ZDc0NTRmZGEw
MWRiNDlhMTMgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCisrKyBiL1NvdXJj
ZS9X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