[Webkit-unassigned] [Bug 81656] Backspace/delete produces combined font/span from existing inline elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 1 06:29:53 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=81656


Aryeh Gregor <ayg at aryeh.name> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1




--- Comment #2 from Aryeh Gregor <ayg at aryeh.name>  2012-04-01 06:29:53 PST ---
Testing at <http://aryeh.name/tmp/editing/autoimplementation.html#delete> with input '<p><span style="font-size: large">1[]</span></p>', I find the spec says to produce:

  <p><span style="font-size: large">{}<br></span></p>

which is as requested.  Firefox 14.0a1 seems to remove the tag entirely in the second case, which is a bug.  Opera Next 12.00 alpha seems to behave per spec.  IE 10 Developer Preview deletes the entire paragraph here when you backspace, which is an egregious bug, but seems to leave the span/b tags alone.

Relevant parts of the spec are not exactly simple, but if you step through them I think you'll find that it matches the autoimplementation:

http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#the-delete-command
http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#delete-the-selection

Basically, in this case the text node is removed from its parent, then it notices that the block is now empty, so it adds a <br>.  The interesting line is

"""
If the block node of parent has no visible children, and parent is editable or an editing host, call createElement("br") on the context object and append the result as the last child of parent.
"""

"parent" here is the <span> or <b> or such, and this is run after its text node child is removed.  If you look at "View comments", this step was deliberately done before stripping wrappers like <span>/<b>, due to <https://www.w3.org/Bugs/Public/show_bug.cgi?id=13831>.  That was in turn inspired by WebKit bug 7360.


In summary, I think this bug is legitimate, and WebKit should match the spec.  Whatever code removes the empty tags here should come after the code that adds a <br> -- then by the time it checks whether the <span>/<b>/etc. is empty, it won't be, because it will have a <br> in it.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list