deleting the entire content of contenteditable div containing an empty div as child is deleting even the empty div.

UNCONFIRMED
Unassigned

Status

()

Core
Editor
UNCONFIRMED
8 years ago
8 years ago

People

(Reporter: tgvrs_santhosh, Unassigned)

Tracking

Trunk
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: DUPEME?)

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3
Build Identifier: version 4.0b6

deleting the entire content of contenteditable div containing an empty div as child is deleting even the empty div.

For Example, load the below htm code.


<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
<HTML>
<HEAD>
<title>Div Test</title>
</HEAD>
<BODY>
	<div contenteditable="true" id="sampleDiv">Mozilla<div></div></div>
	<br/>
	<div contenteditable="true" id="sampleDiv">Mozilla<span></span></div>
</BODY>
</HTML>

Now, delete the first "Mozilla" text. The Div has an empty div as child initially. Now, if you see the html structure from firebug, the empty div has been deleted.

At the same time, try deleting the second "Mozilla" text. The Div has an empty span as child initially. Now, if you see the html structure from firebug, the empty span is there.

The behavior should be same for both and i expect deleting the entire text content should not delete the empty div.

Reproducible: Always

Steps to Reproduce:
load the below htm code.


<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
<HTML>
<HEAD>
<title>Div Test</title>
</HEAD>
<BODY>
	<div contenteditable="true" id="sampleDiv">Mozilla<div></div></div>
	<br/>
	<div contenteditable="true" id="sampleDiv">Mozilla<span></span></div>
</BODY>
</HTML>

Now, delete the first "Mozilla" text. The Div has an empty div as child initially. Now, if you see the html structure from firebug, the empty div has been deleted.

At the same time, try deleting the second "Mozilla" text. The Div has an empty span as child initially. Now, if you see the html structure from firebug, the empty span is there.

The behavior should be same for both and i expect deleting the entire text content should not delete the empty div.
Actual Results:  
deleting the entire text content is deleting the empty div child.

Expected Results:  
deleting the entire text content should not delete the empty div child.
(Reporter)

Updated

8 years ago
Version: unspecified → Trunk
(Reporter)

Comment 1

8 years ago
Created attachment 482787 [details]
webex recording of the bug.

web-ex recording of the bug.
Component: General → Editor
QA Contact: general → editor

Comment 2

8 years ago
This is a dupe of another bug, but I don't have enough time to track down that bug # right now...
Whiteboard: DUPEME?
(Reporter)

Comment 3

8 years ago
Hi Ehsan,

As you mentioned, I tried to track the bug which is same as this one but i failed. Can you help me in tracking down the bug?

Comment 4

8 years ago
Hmm, I didn't seem to be able to find the duplicate bug that I had in mind...
You need to log in before you can comment on or make changes to this bug.