<?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>24362</bug_id>
          
          <creation_ts>2009-03-04 10:48:32 -0800</creation_ts>
          <short_desc>Cannot backspace out of list at start of contentEditable region</short_desc>
          <delta_ts>2013-03-15 07:22:53 -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>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://www.mozilla.org/editor/midasdemo/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>35281</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Annie Sullivan">sullivan</reporter>
          <assigned_to name="Tony Chang">tony</assigned_to>
          <cc>ayg</cc>
    
    <cc>eric</cc>
    
    <cc>jparent</cc>
    
    <cc>justin.garcia</cc>
    
    <cc>michaelthomas</cc>
    
    <cc>rniwa</cc>
    
    <cc>shezbaig.wk</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>112234</commentid>
    <comment_count>0</comment_count>
    <who name="Annie Sullivan">sullivan</who>
    <bug_when>2009-03-04 10:48:32 -0800</bug_when>
    <thetext>Steps to reproduce:

1. Go to Midas Demo: http://www.mozilla.org/editor/midasdemo/
2. Check &quot;View HTML Source&quot; and type the following HTML:
&lt;ul&gt;&lt;li&gt;a&lt;/li&gt;&lt;/ul&gt;
3. Uncheck &quot;View HTML Source&quot; and put the cursor before the &apos;a&apos; character.
4. Press backspace.

Actual result:
Nothing happens

Expected result:
List item deleted.

This affects Google Docs. Possibly related to bug 11331?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112638</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-03-06 11:48:33 -0800</bug_when>
    <thetext>There seems to be code to specifically enable this:

void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)


            // When the caret is at the start of the editable area in an empty list item, break out of the list item.
            if (endingSelection().visibleStart().previous(true).isNull()) {
                if (breakOutOfEmptyListItem()) {
                    typingAddedToOpenCommand();
                    return;
                }
            }

Obviously that code is not working. :)

Will investigate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112643</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-03-06 12:29:13 -0800</bug_when>
    <thetext>Oh, that code is working fine.  This bug is asking to be able to remove the list item even when the list item isn&apos;t empty. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>140407</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2009-08-14 18:15:46 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Oh, that code is working fine.  This bug is asking to be able to remove the
&gt; list item even when the list item isn&apos;t empty. :)

Firefox and TextEdit on Mac removes the bullet (i.e. unlistify the text).  I think we should fix this behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>192352</commentid>
    <comment_count>4</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2010-02-21 21:32:01 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; Oh, that code is working fine.  This bug is asking to be able to remove the
&gt; &gt; list item even when the list item isn&apos;t empty. :)
&gt; 
&gt; Firefox and TextEdit on Mac removes the bullet (i.e. unlistify the text).  I
&gt; think we should fix this behavior.

To clarify: Firefox only removes the bullet if it&apos;s the first item in the list.  Otherwise, it merges with the previous list item.

I will investigate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>192762</commentid>
    <comment_count>5</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2010-02-22 19:42:36 -0800</bug_when>
    <thetext>Ok, I think we want to go with IE&apos;s and TextEdit&apos;s behavior here.  If the cursor is at the beginning of a list item, it unindents it.  Once unindented, pressing backspace a second time merges the text with the previous item.

Before I can fix the list behavior, I need to fix bug 35281 (otherwise, the second backspace would result in two separate lists).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>453307</commentid>
    <comment_count>6</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-08-18 13:30:46 -0700</bug_when>
    <thetext>The behavior I specced is roughly

* If at the beginning of the first &lt;li&gt; in the list, unindent the &lt;li&gt;, leaving it on a separate line from whatever is before it.  Then a second backspace merges it into the previous block.
* If at the beginning of an &lt;li&gt; that&apos;s not the first in the list, merge with the previous &lt;li&gt;, keeping the contents on separate lines (add &lt;br&gt; if necessary).  Then a second backspace merges it to the same line as the previous item.

http://aryeh.name/spec/editing/editing.html#the-delete-command

According to my notes, this behavior doesn&apos;t match any browser, but I felt it made more sense than what any browser did.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>855980</commentid>
    <comment_count>7</comment_count>
    <who name="Shezan Baig">shezbaig.wk</who>
    <bug_when>2013-03-15 07:22:53 -0700</bug_when>
    <thetext>Can I submit a patch for this bug without waiting for bug 35281?  The fix for this seems much simpler.

The fact that the second backspace doesn&apos;t merge the lists is an issue that only happens if there is a previous list item, and that isn&apos;t the case here.

This bug is specifically to do with being at the start of a contentEditable region, (and I would extend it to include start of table-cells), so by definition there is no previous list item.  So I don&apos;t think it should be blocked by bug 35281.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>