Bug 128970 - Dragging nested spans inside contenteditable area results in destroying the parent span elements
Summary: Dragging nested spans inside contenteditable area results in destroying the p...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-18 06:31 PST by Hristo Chakarov
Modified: 2014-02-18 06:31 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hristo Chakarov 2014-02-18 06:31:42 PST
If I have nested span elements inside a contenteditable element, e.g.

<div contenteditable="true">
   <span><span><span>drag me</span></span></span>
</div>

and I select the root <span> element and drag the selection around the contenteditable <div>, when I drop the selection only the most nested <span> element is preserved. Others get destroyed.

Reproduced in Chrome and Safari (both latest): http://jsfiddle.net/ickata/s2Vz7/1/

In Chrome, if I replace <span> with <b> it works perfectly: http://jsfiddle.net/ickata/s2Vz7/2/ unless I add font-weight: normal to the <b> elements: http://jsfiddle.net/ickata/s2Vz7/3/

Same situation with <i> element: http://jsfiddle.net/ickata/s2Vz7/4/

In Safari both don't work properly - using <b> will work if I remove the display: inline-block property: http://jsfiddle.net/s2Vz7/5/

Video: http://ge.tt/100kPOK1/v/0