<?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>105323</bug_id>
          
          <creation_ts>2012-12-18 10:04:36 -0800</creation_ts>
          <short_desc>when contentEditable=true inside contentEditable=false inside contentEditable=true, backspace behavior is wrong</short_desc>
          <delta_ts>2021-05-21 16:09:40 -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>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=226091</see_also>
          <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>0</everconfirmed>
          <reporter name="Johannes Wilm">johanneswilm</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>enrica</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>793777</commentid>
    <comment_count>0</comment_count>
    <who name="Johannes Wilm">johanneswilm</who>
    <bug_when>2012-12-18 10:04:36 -0800</bug_when>
    <thetext>A contenteditable=false element inside a contenteditable=true element can be delted by hitting backspace. However, if there is a contenteditable=true inside the contenteditable=false, then this is not working.

See attached test file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>793779</commentid>
    <comment_count>1</comment_count>
      <attachid>179974</attachid>
    <who name="Johannes Wilm">johanneswilm</who>
    <bug_when>2012-12-18 10:05:31 -0800</bug_when>
    <thetext>Created attachment 179974
a testcase of contenteditable=false inside contenteditable=true</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807294</commentid>
    <comment_count>2</comment_count>
      <attachid>182773</attachid>
    <who name="Johannes Wilm">johanneswilm</who>
    <bug_when>2013-01-15 07:48:05 -0800</bug_when>
    <thetext>Created attachment 182773
test case showing contenteditable=false inside contenteditable=true

this case shows three different cases and how they are handled differently by the delete command:

Try to delete the three contenteditable=false areas using backspace/del, and the results are very different -- one can be deleted without problems, one spills its contents into the outer container, and the last one cannot be deleted at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807705</commentid>
    <comment_count>3</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2013-01-15 14:38:50 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Created an attachment (id=182773) [details]
&gt; test case showing contenteditable=false inside contenteditable=true
&gt; 
&gt; this case shows three different cases and how they are handled differently by the delete command:
&gt; 
&gt; Try to delete the three contenteditable=false areas using backspace/del, and the results are very different -- one can be deleted without problems, one spills its contents into the outer container, and the last one cannot be deleted at all.

The mixed editablity scenarios are very tricky and our support is definitely not complete.
Part of the reason is that there are many situations in which it is unclear what the right thing to do is.
Not much progress has been done in this area, since it has always been considered an uncommon scenario and the reason is that we have seen very few bugs in this area.
I believe WebKit handles fairly well documents containing editable and non editable portions, the problems appear when we nest them.
I don&apos;t know the scope of what you&apos;re trying to accomplish, but maybe you can consider an approach where you avoid nested editable/non-editable elements. I&apos;ll be happy to provide any guidance in this area.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807723</commentid>
    <comment_count>4</comment_count>
    <who name="Johannes Wilm">johanneswilm</who>
    <bug_when>2013-01-15 15:04:12 -0800</bug_when>
    <thetext>Hi,
and thanks for the advice.

The places where I already use noneditable parts inside editable parts is when adding elements to the text flow, that are autogenerated (the writer presses a button). For example, imagine this:

&lt;p&gt;London, UK, &lt;span class=&quot;timepoint&quot; data-jstime=&quot;738039459093&quot; contenteditable=&quot;false&quot;&gt;Oct. 2, 2012, 2:34pm GMT&lt;span&gt;: The Queen announced an extra allowance on cat food this morning.&lt;/p&gt;

The time stamp is something the writer can enter by clicking a button. He can subsequently remove it again by deleting it in the text, either by selecitng it or by hitting the backspace key while the cursor is directly behind it. 

In this case, Webkit works fine already.

However, when going to the more complicated case of a nested editable part, it instide kind of knocks the back wall out. In this example: http://sourcefabric.github.com/BookJS/test.html scroll to the fifth page (the one with the headline &quot;Some text part&quot;). The footnotes on that page are created in this nested manner. If you move the cursor behind one of the footnote references in the main text and hit &quot;Backspace&quot;, you would imagine that the footnote reference as well as the entire footnote would disappear. This would happen if Webkit would delte the entire non-editable element as it does in the case above. Instead it is as if the ack wall is being knocked out.

As I understand it, if changed, it would follow this logic:

&quot;UAs should offer a way for the user to delete text and elements, including non-editable descendants, e.g. as the default action of keydown events whose identifiers are &apos;U+0008&apos; or &apos;U+007F&apos;.&quot;  

http://www.w3.org/TR/2008/WD-html5-20080610/editing.html

If you have suggestions as how to achieve this in another way, please let me know!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807909</commentid>
    <comment_count>5</comment_count>
    <who name="Johannes Wilm">johanneswilm</who>
    <bug_when>2013-01-15 18:37:44 -0800</bug_when>
    <thetext>One question: I understand that you guys don&apos;t plan on fixing/standardizing this behavior in the short-term due to resource constraints. But are you guys also opposed to the idea that others take it upon themselves to try to fix this? editabel and non-editable should work in a nested way the way I read the specifications that have been released about this the last few years, right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>808438</commentid>
    <comment_count>6</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2013-01-16 09:41:41 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; One question: I understand that you guys don&apos;t plan on fixing/standardizing this behavior in the short-term due to resource constraints. But are you guys also opposed to the idea that others take it upon themselves to try to fix this? editabel and non-editable should work in a nested way the way I read the specifications that have been released about this the last few years, right?

WebKit is an OpenSource project and anyone is welcome to contribute. The changes go through the normal review process as any contribution to the project and once they have been reviewed they can be checked in.
Please remember that this is one of the most complicated areas of the system and making changes is a non trivial task even for developers that have very experienced with WebKit.
I&apos;ll be happy to review and provide guidance if you decide to tackle this.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>179974</attachid>
            <date>2012-12-18 10:05:31 -0800</date>
            <delta_ts>2013-01-15 07:48:05 -0800</delta_ts>
            <desc>a testcase of contenteditable=false inside contenteditable=true</desc>
            <filename>test_contenteditable.html</filename>
            <type>text/html</type>
            <size>850</size>
            <attacher name="Johannes Wilm">johanneswilm</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8dGl0bGU+dGVzdCBjb250ZW50ZWRpdGFibGUgd2Via2l0IGltcGxlbWVu
dGF0aW9uPC90aXRsZT4KPC9oZWFkPgo8Ym9keT4KPGRpdiBjb250ZW50ZWRpdGFibGU9InRydWUi
PgoKVGhpcyBpcyBvbmUgY29udGVudGVkaXRhYmxlIGFyZS4gPHNwYW4gY29udGVudGVkaXRhYmxl
PSJmYWxzZSI+KDxzcGFuIGNvbnRlbnRlZGl0YWJsZT0idHJ1ZSIgc3R5bGU9ImJhY2tncm91bmQt
Y29sb3I6cmVkOyI+VGhpcyBpcyBhIHNlcGFyYXRlIGVkaXRhYmxlIGFyZWEuPC9zcGFuPik8L3Nw
YW4+IEhlcmUgdGhlIGZpcnN0IGFyZWEgY29udGludWVzLgo8L2Rpdj4KPGRpdiBjb250ZW50ZWRp
dGFibGU9InRydWUiPlRoZSBzZWNvbmQgY29udGVudGVkaXRhYmxlIGFyZXMgaXMgaW5zaWRlIGEg
cGFyZW50aGVzaXMgdGhhdCBpcyBub3QgZWRpdGFibGUuIFdoZW4gYSBub24tZWRpdGFibGUgZWxl
bWVudCBpcyBpbnNpZGUgYW4gZWRpdGFibGUgZWxlbWVudCA8c3BhbiBjb250ZW50ZWRpdGFibGU9
ImZhbHNlIj4oc3VjaCBhcyB0aGlzIG9uZSk8L3NwYW4+LCBpdCBjYW4gdXN1YWxseSBiZSByZW1v
dmVkIGJ5IGhpdHRpbmcgdGhlIGJhY2tzcGFjZSBrZXkgYWZ0ZXIgaXQuIEhvd2V2ZXIsIHdoZW4g
aW5zaWRlIG9mIHRoYXQgbm9uLWVkaXRhYmxlIGVsZW1lbnQgdGhlcmUgaXMgYW4gZWRpdGFibGUg
ZWxlbWVudCwgYXMgaW4gdGhlIGFib3ZlIGV4YW1wbGUsIGl0IGNhbm5vdCBiZSByZW1vdmVkLiBJ
bnN0ZWFkLCB0aGUgcGFydHMgZm9sbG93aW5nIHRoZSBhcmUgbW92ZWQgaW5zaWRlIG9mIGJvdGgg
bm9uZWRpdGFibGUgYW5kIGVkaXRhYmxlIGVsZW1lbnRzLgoKPC9ib2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>182773</attachid>
            <date>2013-01-15 07:48:05 -0800</date>
            <delta_ts>2013-01-15 07:48:05 -0800</delta_ts>
            <desc>test case showing contenteditable=false inside contenteditable=true</desc>
            <filename>test_contenteditable.html</filename>
            <type>text/html</type>
            <size>1219</size>
            <attacher name="Johannes Wilm">johanneswilm</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8dGl0bGU+dGVzdCBjb250ZW50ZWRpdGFibGUgd2Via2l0IGltcGxlbWVu
dGF0aW9uPC90aXRsZT4KPC9oZWFkPgo8Ym9keT4KPGRpdiBjb250ZW50ZWRpdGFibGU9InRydWUi
PgoKVGhpcyBpcyBvbmUgY29udGVudGVkaXRhYmxlIGFyZS4gPHNwYW4gY29udGVudGVkaXRhYmxl
PSJmYWxzZSIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6Ymx1ZTsiPig8c3BhbiBjb250ZW50ZWRp
dGFibGU9InRydWUiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOnJlZDsiPlRoaXMgaXM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