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

NEW
Unassigned

Status

()

Core
Editor
P3
normal
16 years ago
11 years ago

People

(Reporter: Pascal Byrne, Unassigned)

Tracking

Trunk
Future
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
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>

Comment 1

16 years ago
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.

Comment 2

16 years ago
Created attachment 93793 [details]
Testcase demonstrating empty elements dissapearing

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)

Comment 3

16 years ago
-->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)

Updated

16 years ago
Priority: -- → P3
Target Milestone: --- → Future
QA Contact: sujay → editor
Assignee: kinmoz → nobody
You need to log in before you can comment on or make changes to this bug.