<?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>140388</bug_id>
          
          <creation_ts>2015-01-13 04:23:34 -0800</creation_ts>
          <short_desc>Range is incorrectly normalized after adding into selection for u HTML element.</short_desc>
          <delta_ts>2023-03-28 15:52:49 -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>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</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>a.delura</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>a.delura</cc>
    
    <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>enrica</cc>
    
    <cc>gsnedders</cc>
    
    <cc>pkoszulinski</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1060801</commentid>
    <comment_count>0</comment_count>
      <attachid>244507</attachid>
    <who name="">a.delura</who>
    <bug_when>2015-01-13 04:23:34 -0800</bug_when>
    <thetext>Created attachment 244507
Reproduction example

Creating range for text node in u HTML element and adding it to selection cause incorrectly range normalization to it&apos;s parent. See attached example for more details. Please note, that this bug occur not only for u element but for inline elements in general i.e. i, em, b. This bug does not occur for block elements like p or div.

This behaviour impact http://dev.ckeditor.com/ticket/12690 in CKEditor.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1060802</commentid>
    <comment_count>1</comment_count>
    <who name="">a.delura</who>
    <bug_when>2015-01-13 04:27:39 -0800</bug_when>
    <thetext>Reproduced on latest nightly r178314</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1060812</commentid>
    <comment_count>2</comment_count>
    <who name="Piotrek Koszuliński (Reinmar)">pkoszulinski</who>
    <bug_when>2015-01-13 05:49:39 -0800</bug_when>
    <thetext>Rephrasing the bug report: Selection anchored in a text node inside an inline element (e.g. &lt;u&gt;) is incorrectly normalised by Webkit - it is moved to a text node outside that &lt;u&gt; element.

While Webkit normalising an element-anchored selection to a closest text node is a fact (a sad one :)), I would expect that it does not affect selections anchored in text nodes. This looks like some pretty new regression, because I&apos;ve never seen Webkit doing this.

Of course, none other browser behave this way, but that&apos;s due to the fact that none other browser normalise selection.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061054</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-01-13 20:38:27 -0800</bug_when>
    <thetext>Can you figure out when this started? That would significantly increase the chances of this being fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1889868</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-08 17:42:29 -0700</bug_when>
    <thetext>I am able to reproduce this bug in Safari 15.6 on macOS 12.5 using attached test case and it returns &quot;f&quot; in the console while in other browsers (Chrome Canary 106 and Firefox Nightly 105), it returns &quot;o&quot; in the console. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1890356</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-08-10 11:04:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/98460579&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1944402</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-03-27 15:38:02 -0700</bug_when>
    <thetext>Safari 16.4 shows &apos;f&apos; (not expected) but Safari Technology Preview 166 show &apos;o&apos; in Console. Used &quot;Private Window&quot; to reproduce this.

Can we mark this as &quot;RESOLVED CONFIGURATION CHANGED&quot;, since it seems to be fixed in STP166.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1944780</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-03-28 15:52:49 -0700</bug_when>
    <thetext>Yeah, this seems to be working now.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>244507</attachid>
            <date>2015-01-13 04:23:34 -0800</date>
            <delta_ts>2015-01-13 04:23:34 -0800</delta_ts>
            <desc>Reproduction example</desc>
            <filename>webkit-bug.html</filename>
            <type>text/html</type>
            <size>597</size>
            <attacher>a.delura</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KICA8bWV0YSBjaGFyc2V0PSJ1dGYtOCI+CiAg
PHRpdGxlPldlYmtpdCBidWc8L3RpdGxlPgo8L2hlYWQ+Cjxib2R5PmY8dT5vPC91Pgo8c2NyaXB0
IGlkPSJqc2Jpbi1qYXZhc2NyaXB0Ij4NCi8vIFNlbGVjdGluZyB0ZXh0IG5vZGUgaW4gdSBlbGVt
ZW50Lg0KdmFyIG8gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCd1JykuY2hpbGROb2Rlc1swXTsN
Cg0KLy8gQ3JlYXRpbmcgcmFuZ2UganVzdCBiZWZvcmUgIm8iIGNoYXJhY3RlciBpbiB1IGVsZW1l
bnQuDQp2YXIgcmFuZ2UgPSBkb2N1bWVudC5jcmVhdGVSYW5nZSgpOw0KcmFuZ2Uuc2V0U3RhcnQo
bywgMCk7DQpyYW5nZS5zZXRFbmQobywgMCk7DQoNCndpbmRvdy5nZXRTZWxlY3Rpb24oKS5hZGRS
YW5nZShyYW5nZSk7DQoNCi8vIFJhbmdlIGlzIGluY29ycmVjdGx5IG5vcm1hbGl6ZWQgdG8gImYi
IHRleHQgbm9kZSwgYnV0IHNob3VsZCBiZSBrZXB0IGluICJvIg0KY29uc29sZS5sb2cod2luZG93
LmdldFNlbGVjdGlvbigpLmdldFJhbmdlQXQoMCkuc3RhcnRDb250YWluZXIudGV4dENvbnRlbnQp
Owo8L3NjcmlwdD4KPC9ib2R5Pgo8L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>