Bug 18210
| Summary: | DOMParser reports parsing errors differently than | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Nicholas C. Zakas <webkit> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | ap, cdumez |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
Nicholas C. Zakas
The DOMParser object doesn't report parsing errors. The following will cause a parser error in both Firefox and Opera:
var xmldom = (new DOMParser()).parseFromString("<xml>", "text/xml");
The returned value is a document whose document element is <parseerror/> in Firefox and Opera; in WebKit it is <xml/> and no error occurs.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
I cannot reproduce this. Try entering the following into the address bar:
javascript:alert((new XMLSerializer).serializeToString((new DOMParser()).parseFromString("<xml>", "text/xml")))
Nicholas C. Zakas
Perhaps my original subject was incorrect. In Opera and FF, the <parsererror> element is the document element. In WebKit, it's inserted at the point of the parser error. This seems like a bug that should be fixed for interoperability.
Alexey Proskuryakov
*** This bug has been marked as a duplicate of 13057 ***
Lucas Forschler
Mass moving XML DOM bugs to the "DOM" Component.