Bug 18210 - DOMParser reports parsing errors differently than
Summary: DOMParser reports parsing errors differently than
Status: RESOLVED DUPLICATE of bug 13057
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-29 12:56 PDT by Nicholas C. Zakas
Modified: 2019-02-06 09:03 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas C. Zakas 2008-03-29 12:56:39 PDT
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.
Comment 1 Alexey Proskuryakov 2008-04-01 00:29:58 PDT
I cannot reproduce this. Try entering the following into the address bar:

javascript:alert((new XMLSerializer).serializeToString((new DOMParser()).parseFromString("<xml>", "text/xml")))
Comment 2 Nicholas C. Zakas 2008-04-06 12:39:14 PDT
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.
Comment 3 Alexey Proskuryakov 2008-04-06 23:56:37 PDT

*** This bug has been marked as a duplicate of 13057 ***
Comment 4 Lucas Forschler 2019-02-06 09:03:43 PST
Mass moving XML DOM bugs to the "DOM" Component.