[Webkit-unassigned] [Bug 175071] New: Deleting the content of an absolute positioned div causes the div to be deleted as well

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 2 09:28:11 PDT 2017


            Bug ID: 175071
           Summary: Deleting the content of an absolute positioned div
                    causes the div to be deleted as well
           Product: WebKit
           Version: Safari 10
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML Editing
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jalkut at red-sweater.com
                CC: wenson_hsieh at apple.com

Created attachment 316965

  --> https://bugs.webkit.org/attachment.cgi?id=316965&action=review

Example file demonstrating the bug

If the text content of a position:absolute div element inside an editable div is deleted, then the absolute-positioned div is deleted as well.

1. Open AbsoluteContentDeletioon.html in Safari or a WebKit nightly.
2. Select all the text "Delete Me" within the red div.
3. Press the delete key to delete it.
4. Type anything.


The newly typed text should reside inside a div.


The typed text has been converted to a styled span mimicking the style of the div.

If the div in question is not positioned absolutely, then deleting the content of the div preserves the div in the hierarchy, and the newly typed text will still be in the div.

Note that even gradually editing the content so that it becomes empty is sufficient to cause the container div to abruptly disappear. For example position the cursor at the end of "Delete Me" and press backspace several times until you backspace over the initial "D". The same result is observed.

This has a practical side-effect of causing a bug with the open source TinyMCE editor, because it relies upon inserting an absolute-positioned div to "catch" the contents of pasted text in some instances, so that it can manipulate it before transferring it to the actual insertion point. Before it pastes the content into the div, it deletes the content, which on WebKit, causes the container div to disappear and throw things into disarray.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170802/0e2e74f1/attachment.html>

More information about the webkit-unassigned mailing list