e4x: XML 1.0 Well-formedness constraint: Unique Att Spec not implemented

VERIFIED FIXED in mozilla1.8beta1

Status

()

P2
normal
VERIFIED FIXED
14 years ago
14 years ago

People

(Reporter: martin.honnen, Assigned: brendan)

Tracking

({js1.5})

Trunk
mozilla1.8beta1
x86
Windows XP
js1.5
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

(Reporter)

Description

14 years ago
The XML 1.0 specification at:
<http://www.w3.org/TR/2004/REC-xml-20040204/#sec-starttags>
says:
  "An attribute name MUST NOT appear more than once in the same start-tag or
empty-element tag."
however Spidermonkey currently (at least when tested with a recent Mozilla 1.8a
nightly with script inside <script type="text/javascript; e4x=1>) parses XML alike
  var god = <god name="Kibo" name="Xibo" />;
without throwing an error.
Rhino gives an error however:
  "error: Attribute "name" was already specified for element "god"."
I think Spidermonkey needs to test that well-formedness constraint too and throw
an error. Currently it indeed seems to have two attributes with the same name
e.g. xml.attributes().length() yields 2, toXMLString then yields markup with
other XML parsers would throw a well-formedness error on.
JavaScript test case is here:
<http://home.arcor.de/martin.honnen/mozillaBugs/e4x/attributeNameDuplicated.js>
HTML test case using that script is here:
<http://home.arcor.de/martin.honnen/mozillaBugs/e4x/attributeNameDuplicated.html>
(Assignee)

Updated

14 years ago
Assignee: general → brendan
Keywords: js1.5
Priority: -- → P2
Target Milestone: --- → mozilla1.8beta
(Assignee)

Comment 1

14 years ago
Created attachment 170858 [details] [diff] [review]
fix

I also shortened ATTRIBUTE to ATTR uniformly in js.msg.

/be
Attachment #170858 - Flags: review?(shaver)
(Assignee)

Updated

14 years ago
Status: NEW → ASSIGNED
Comment on attachment 170858 [details] [diff] [review]
fix

r=shaver
Attachment #170858 - Flags: review?(shaver) → review+
(Assignee)

Comment 3

14 years ago
Fixed, thanks^2.

/be
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
(Reporter)

Comment 4

14 years ago
Verified fixed with Mozilla 1.8b (Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.8b) Gecko/20050122)
Status: RESOLVED → VERIFIED

Comment 5

14 years ago
Created attachment 174991 [details]
e4x/Regress/regress-277664.js

Martin, with your permission this will be included in the javascript test
library.

Comment 6

14 years ago
e4x/Regress/regress-277664.js checked in.

Updated

14 years ago
Flags: testcase+
You need to log in before you can comment on or make changes to this bug.