Closed Bug 248172 Opened 20 years ago Closed 20 years ago

XMLSerializer corrupts namespace prefixes when XHTML namespace is used

Categories

(Core :: XML, defect)

x86
Linux
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: bedney, Assigned: peterv)

References

Details

(Keywords: fixed-aviary1.0, fixed1.7.5, regression)

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

The XMLSerializer corrupts namespace prefixes when the XHTML namespace is used.
Note that the DOM itself contains the correct namespace information (i.e. you
can poke around and get 'namespaceURI's and 'prefix's) but the serializer
corrupts the output.

Note that this did not occur in Mozilla 1.6 and earlier. This is a new bug for
Mozilla 1.7.

Reproducible: Always
Steps to Reproduce:
1.Run testcase
2.Note the errors in the testcase (its well documented)
3.

Actual Results:  
Got incorrect serialization results.

Expected Results:  
Correctly serialized the input.

Check the testcase. There's 4 separate testcases. The first 2 work, the last 2
don't. Note again that this is a Mozilla 1.7 issue.
Jonas: shouldn't the GetNodeInfo call in nsGenericHTMLElement::SetAttrAndNotify
(http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsGenericHTMLElement.cpp#1664)
use aPrefix?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch v1 (obsolete) — Splinter Review
Assignee: hjtoi-bugzilla → peterv
Status: NEW → ASSIGNED
Comment on attachment 151528 [details] [diff] [review]
v1

This seems like the right thing and it fixes the bug. I can't think of anything
that this could be breaking, you?
Attachment #151528 - Flags: review?(bugmail)
Comment on attachment 151528 [details] [diff] [review]
v1

I think there is some other bug filed on this issue, or at least it was talked
about in some other bug.
The same problem exists in XUL. r=me if you fix it there too.
Attachment #151528 - Flags: review?(bugmail) → review+
Comment on attachment 151528 [details] [diff] [review]
v1

sr=jst
Attachment #151528 - Flags: superreview+
Note that we probably get the wrong attribute for the mutation events (see
http://bugzilla.mozilla.org/show_bug.cgi?id=232009#c4).
Blocks: 155723
Attachment #151528 - Attachment is obsolete: true
Comment on attachment 151669 [details] [diff] [review]
Patch that was checked in

Carrying forward r/sr and asking for branch approval: trivial fix so that
attributes in XHTML and XUL elements don't lose their prefix. Low-risk.
Attachment #151669 - Flags: superreview+
Attachment #151669 - Flags: review+
Attachment #151669 - Flags: approval1.7.1?
Comment on attachment 151669 [details] [diff] [review]
Patch that was checked in

a=mkaply for 1.7.1
Attachment #151669 - Flags: approval1.7.1? → approval1.7.1+
Checked in to trunk and 1.7 branch.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Keywords: fixed1.7.1
Resolution: --- → FIXED
Whiteboard: needed-aviary1.0?
AVIARY_1_0_20040515_BRANCH does not checkin yet.
Fixed on the aviary branch now too.
Keywords: fixed-aviary1.0
Whiteboard: needed-aviary1.0?
I have been remiss in thanking everyone involved, especially Peter, for fixing
this bug so quickly. This was a showstopper for my product under 1.7.

Thanks guys!

Cheers,

- Bill
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: