<?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>225513</bug_id>
          
          <creation_ts>2021-05-07 08:01:29 -0700</creation_ts>
          <short_desc>Contenteditable inverts tag nesting</short_desc>
          <delta_ts>2021-05-14 08:02:19 -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>Safari 14</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>macOS 11</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Victor Borràs">victor</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>megan_gardner</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1757864</commentid>
    <comment_count>0</comment_count>
    <who name="Victor Borràs">victor</who>
    <bug_when>2021-05-07 08:01:29 -0700</bug_when>
    <thetext>STEPS TO REPRODUCE:
1. Add a &lt;div&gt; with contenteditable.
2. Add the following markup: &lt;a href=&quot;#&quot;&gt;&lt;mark&gt;link&lt;/mark&gt;&lt;/a&gt;a.
3. In the browser window, type something between &quot;link&quot; and &quot;a&quot;.

EXPECTED BEHAVIOR:
The nesting order for the tags is kept, and the new character is added outside of them.

CURRENT BEHAVIOR:
The caracter is added to the mark tag and nesting gets inverted, resulting in this:
&lt;mark&gt;&lt;a href=&quot;#&quot;&gt;link&lt;/a&gt;a&lt;/mark&gt;a

Reproduction: https://codepen.io/vborrasc/pen/XWMrRpe</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1760071</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-05-14 08:02:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/78017071&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>