Bug 186377 - A node in contenteditable is removed when all characters in it are removed
Summary: A node in contenteditable is removed when all characters in it are removed
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: All Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-06 19:08 PDT by Kei Ito
Modified: 2018-06-07 13:10 PDT (History)
2 users (show)

See Also:


Attachments
Steps to Reproduce (413.44 KB, video/mp4)
2018-06-06 19:08 PDT, Kei Ito
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kei Ito 2018-06-06 19:08:55 PDT
Created attachment 342105 [details]
Steps to Reproduce

Summary:
A node in contenteditable is removed when all characters in it are removed by backspace key or delete key etc. if the "position" of the parent node is "relative".

Steps to Reproduce:
# 1. Save the code below as page.html.

<!doctype html>
<meta charset="utf-8">
<style>
.editable {
    margin: 20px;
    padding: 20px;
    background-color: #fcc;
}
.editable div {
    padding: 20px;
    background-color: #ccf;
}
.editable2 div {
    position: relative;
}
</style>
<div contenteditable="true" class="editable editable1">
    <div>ABC</div>
</div>
<div contenteditable="true" class="editable editable2">
    <div>DEF</div>
</div>

# 2. Open Safari
# 3. Drag and drop the page.html onto the address bar
# 4. Click the right of "ABC" and press Backspace 3 times
# 5. Click the right of "DEF" and press Backspace 3 times

You can try it on this page: https://codepen.io/wemotter/pen/jxegxw

Expected Results:
"ABC" and "DEF" are removed and the blue areas remains.

Actual Results:
"ABC" and "DEF" are removed and the first blue area remains but the second is removed.