Bug 18210

Summary: DOMParser reports parsing errors differently than
Product: WebKit Reporter: Nicholas C. Zakas <webkit>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, cdumez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   

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.