Open
Bug 603881
Opened 14 years ago
Updated 2 years ago
deleting the entire content of contenteditable div containing an empty div as child is deleting even the empty div.
Categories
(Core :: DOM: Editor, defect)
Tracking
()
UNCONFIRMED
People
(Reporter: tgvrs_santhosh, Unassigned)
Details
(Whiteboard: DUPEME?)
Attachments
(1 file)
1.38 MB,
application/octet-stream
|
Details |
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•14 years ago
|
Version: unspecified → Trunk
Reporter | ||
Comment 1•14 years ago
|
||
web-ex recording of the bug.
Updated•14 years ago
|
Component: General → Editor
QA Contact: general → editor
Comment 2•14 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•14 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•14 years ago
|
||
Hmm, I didn't seem to be able to find the duplicate bug that I had in mind...
Comment 5•4 years ago
|
||
https://codepen.io/SaschaNaz/pen/rNVdOPg
Seems the behavior is reversed, now the span disappears but not div.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•