Closed Bug 63559 Opened 24 years ago Closed 24 years ago

DOMParser loses HTML element attributes

Categories

(Core :: XML, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9

People

(Reporter: hjtoi-bugzilla, Assigned: hjtoi-bugzilla)

Details

(Keywords: dataloss, Whiteboard: [fixinhand])

Attachments

(4 files)

When parsing an XML document that contains HTML elements, we lose attributes on
the HTML elements. We get an assertion that attribute stylesheet could not be
loaded (which is needed to add those attributes).
Priority: -- → P2
Target Milestone: --- → mozilla0.8
I will not be able to check this in for 0.8, moving to 0.9.
Target Milestone: mozilla0.8 → mozilla0.9
I am not completely sure this is the right fix yet, but at least it *seems* to
work. We still try to set the attributes via the stylesheet, but if we do not
get a stylesheet we use the alternative method. It used to be so that if there
was no document we'd use the alternative method.
Status: NEW → ASSIGNED
Whiteboard: [fixinhand]
The last patch looks good to me. r=jst
Looks good to me as well - sr=vidur. I'm not sure I understand why
nsHTMLUnknownElement doesn't use the generic SetAttribute, but that's a
different issue.
This patch didn't work for me when loading an XHTML document using document.load().

Here's a testcase
http://www.ece.rice.edu/~brentmh/swi/js/test.html

--Brent
My sample that I just attached (slightly modified from your version) works fine.
Maybe the problem is with your testcase, or maybe it is because your testcase
uses unknown namespace (not XHTML).
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Marking verified fixed in the March 1 build.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: