<?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>42849</bug_id>
          
          <creation_ts>2010-07-22 13:57:16 -0700</creation_ts>
          <short_desc>Incorrect merging of LIs using backspace</short_desc>
          <delta_ts>2017-07-18 08:29:59 -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>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Julie Parent">jparent</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>enrica</cc>
    
    <cc>rniwa</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>254969</commentid>
    <comment_count>0</comment_count>
      <attachid>62335</attachid>
    <who name="Julie Parent">jparent</who>
    <bug_when>2010-07-22 13:57:16 -0700</bug_when>
    <thetext>Created attachment 62335
Test case

Repro steps:
1. Start with a bold tag wrapping a list (or attached test file):
&lt;div contentEditable&gt;
&lt;b&gt;
&lt;ul&gt;&lt;li&gt;asdf&lt;/li&gt;&lt;li&gt;Backspace here&lt;/li&gt;&lt;/ul&gt;
&lt;/b&gt;
&lt;/div&gt;
2. Put your cursor at the start of the &quot;Backspace here&quot; line
3. Hit backspace.

Result (HTML got crazy, renders with a large gap between &quot;asdf&quot; and &quot;Backspace here&quot;):
&lt;div contenteditable&gt;
&lt;b&gt;
&lt;ul&gt;&lt;li&gt;asdf&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal; &quot;&gt;&lt;b&gt;&lt;ul style=&quot;display: inline !important; &quot;&gt;&lt;li style=&quot;display: inline !important; &quot;&gt;Backspace here&lt;/li&gt;&lt;/ul&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/b&gt;
&lt;/div&gt;

Expected result (list items just merge):
&lt;div contentEditable&gt;
&lt;b&gt;
&lt;ul&gt;&lt;li&gt;asdfBackspace here&lt;/li&gt;&lt;/ul&gt;
&lt;/b&gt;
&lt;/div&gt;

Notes:
* If you continue to hit backspace, the cursor is rendered to the left of the &quot;B&quot; in &quot;Backspace&quot;, but the character removed is the &quot;f&quot; in &quot;asdf&quot;, then the &quot;d&quot;, then the &quot;s&quot;, etc, so the character being removed and the visual indication of the character to be removed do not match.
* This also occurs with &lt;i&gt; or &lt;u&gt; tags instead of &lt;b&gt;
* This also occurs if you put your cursor at the end of the &quot;asdf&quot; line and hit delete.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>256067</commentid>
    <comment_count>1</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2010-07-26 09:22:51 -0700</bug_when>
    <thetext>The current results are clearly wrong, but I think the expected result is to remove the bullet for the &quot;Backspace here&quot; item.  Hitting backspace again should merge the list items.

This is a variation of bug 35281 (which may fix this, I haven&apos;t tested).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>256068</commentid>
    <comment_count>2</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2010-07-26 09:25:11 -0700</bug_when>
    <thetext>Oh, I should clarify that the behavior I described matches IE, while the behavior Julie described matches Firefox.  I think IE&apos;s behavior is better since it gives you another way to break out of lists and it&apos;s easy to tap the backspace key again if you want to merge.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>256079</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-07-26 09:59:28 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; The current results are clearly wrong, but I think the expected result is to remove the bullet for the &quot;Backspace here&quot; item.  Hitting backspace again should merge the list items.

By removing the bullet, you mean to merge the LIs and insert a br/div?  Because that sounds like the most reasonable thing to do here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>256206</commentid>
    <comment_count>4</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2010-07-26 13:47:56 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #1)
&gt; &gt; The current results are clearly wrong, but I think the expected result is to remove the bullet for the &quot;Backspace here&quot; item.  Hitting backspace again should merge the list items.
&gt; 
&gt; By removing the bullet, you mean to merge the LIs and insert a br/div?  Because that sounds like the most reasonable thing to do here.

No, I mean that the expected output should be like:
&lt;b&gt;
&lt;ul&gt;&lt;li&gt;asdf&lt;/li&gt;&lt;/ul&gt;
&lt;div&gt;Backspace here&lt;/div&gt;
&lt;/b&gt;

In IE, the &lt;div&gt; is actually a &lt;p&gt;, but WebKit uses &lt;div&gt; for paragraphs.  Pressing backspace a second time would produce Julie&apos;s suggested output (i.e., merge the paragraph into the list item).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>256271</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-07-26 15:11:34 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; No, I mean that the expected output should be like:
&gt; &lt;b&gt;
&gt; &lt;ul&gt;&lt;li&gt;asdf&lt;/li&gt;&lt;/ul&gt;
&gt; &lt;div&gt;Backspace here&lt;/div&gt;
&gt; &lt;/b&gt;

Oh, right. That works as well. So if we had another list child after &quot;backspace here&quot; (i.e. three LIs in the total), will you split the list (end up with ULs)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>256273</commentid>
    <comment_count>6</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2010-07-26 15:12:52 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt;  So if we had another list child after &quot;backspace here&quot; (i.e. three LIs in the total), will you split the list (end up with ULs)?

Yes, that&apos;s right.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>256300</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-07-26 15:50:41 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #5)
&gt; &gt;  So if we had another list child after &quot;backspace here&quot; (i.e. three LIs in the total), will you split the list (end up with ULs)?
&gt; 
&gt; Yes, that&apos;s right.

Ok, I agree with you.  That&apos;s probably the best we can do here.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>62335</attachid>
            <date>2010-07-22 13:57:16 -0700</date>
            <delta_ts>2010-07-22 13:57:16 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>brokebbackspace.html</filename>
            <type>text/html</type>
            <size>87</size>
            <attacher name="Julie Parent">jparent</attacher>
            
              <data encoding="base64">PGRpdiBjb250ZW50RWRpdGFibGU+DQo8Yj4NCjx1bD48bGk+YXNkZjwvbGk+PGxpPkJhY2tzcGFj
ZSBoZXJlPC9saT48L3VsPg0KPC9iPg0KPC9kaXY+
</data>

          </attachment>
      

    </bug>

</bugzilla>