Open Bug 160659 Opened 22 years ago Updated 3 years ago

composer removed line added to source tab (div with attributes)

Categories

(Core :: DOM: Editor, defect, P5)

x86
Linux
defect

Tracking

()

Future

People

(Reporter: pbyrne, Unassigned)

Details

Attachments

(1 file)

In composer when I go to the edit source tab and try to add the line:-
<div id="overDiv" style="position: absolute; z-index: 1;"></div>

directly beneath the line with <body>, the inserted line is removed when I
return to normal mode. This is the releive

</style></head><body style="color: rgb(255,255,255); background-color:
rgb(0,0,0);" link="#000099" vlink="#990099" alink="#000099">
<!-- I want to add div here-->
<script src="overlib.js" language="JavaScript"><!-- overLIB (c) Erik Bosrup -->
</script>
I see this on 2002073008 WinME.

As a workaround, put some content (a space will do) inside the <div> element,
e.g. <div id="overDiv" style="position: absolute; z-index: 1;"> </div> 

Same thing happens with other elements (I tried <p> and <b>)

Not sure what's meant to happen with the HTML rewriting, but I'd guess that
elements shouldn't be removed just because they've no content, especially if
they have attributes.

Steps to reproduce:
1) Open new composer doc
2) go to source view
3) add a line with empty elements (e.g. <div></div>)
4) add non-empty for comparision (e.g. <div> </div>)
5) Switch to Normal view
6) Switch back to Source view
7) see that the empty element has been removed.
This is more odd than I thought. The empty element will not dissapear if there
is no whitespace either side of it, but will dissapear if there is whitespace.

Steps to reproduce:

1) Save this file locally and load it into composer.
2) Switch between Source and Normal views a couple of times, observe that
nothing changes.
3) Switch to Source view and add a space before or after the empty &lt;b&gt;
element.
4) Switch between Source and Normal views a couple of times
5) Observe that the empty &lt;b&gt; element dissapears.

(I need to get a new build, but am on dialup so it might be a while)
-->core
confirm based on comment 1

Kin--should this go to the dom to text or is it an editor:core issue?
Assignee: syd → kin
Status: UNCONFIRMED → NEW
Component: Editor: Composer → Editor: Core
Ever confirmed: true
Summary: composer removed line added to source tab → composer removed line added to source tab (div with attributes)
Priority: -- → P3
Target Milestone: --- → Future
QA Contact: sujay → editor
Assignee: kinmoz → nobody

Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority.

If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.

Severity: normal → S4
Priority: P3 → P5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: