When Midas clones paragraph nodes it copies the "id" attribute

RESOLVED WORKSFORME

Status

()

Core
Editor
RESOLVED WORKSFORME
11 years ago
2 months ago

People

(Reporter: Victor, Unassigned)

Tracking

1.8 Branch
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.8) Gecko/20071015 SUSE/2.0.0.8-1.1 Firefox/2.0.0.8
Build Identifier: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.8) Gecko/20071015 SUSE/2.0.0.8-1.1 Firefox/2.0.0.8

According to HTML 4.01 spec, "id ... This attribute assigns a name to an element. This name must be unique in a document."
So, Midas must exclude id attribute when copying a node.

Reproducible: Always

Steps to Reproduce:
1. In a Midas editor (e.g. http://www.mozilla.org/editor/midasdemo/)
2. use raw HTML mode to input the following HTML:
<p id="1">1</p><p id="2">2</p>
3. Switch to WYSIWYG, press enter just after "1"
4. A paragraph is created:
<p id="1">1</p><p id="1"><br></p><p id="2">2</p>

Actual Results:  
The new paragraph has the same id as the previous.

Expected Results:  
Must not have id.
(Reporter)

Comment 1

11 years ago
By the way. I have a javascript variable that points to some existing paragraph (i.e. DOM Element). After I press enter and the new paragraph is added, the variable points to the new empty paragraph. Quite confusing.
(Reporter)

Comment 2

11 years ago
Oh, sorry. The last remark is actually my glitch, caused by the bug in question.
Component: General → Editor
Product: Firefox → Core
QA Contact: general → editor
Version: unspecified → 1.8 Branch
WFM with Firefox 6.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.