Closed Bug 1017932 Opened 6 years ago Closed 6 years ago

Document() constructor should return Document object (not XMLDocument)

Categories

(Core :: DOM: Core & HTML, defect)

32 Branch
x86_64
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: crimsteam, Assigned: bzbarsky)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0 (Beta/Release)
Build ID: 20140506152807

Steps to reproduce:

Per DOM:
http://dom.spec.whatwg.org/#dom-document
"Unlike createDocument() this constructor does not return an XMLDocument object, but a document (Document object)."

Firefox return XMLDocument with acces to load method. Other browsers don't support this constructor so there is still much space for possible change.
There are all sorts of places where we return XMLDocument where specs are sort of trying to return Document (e.g. DOMParser).

I guess it would be pretty simple to fix this particular one, assuming the web can deal with actual Document instances.  Right now we never return those from anywhere.
Assignee: nobody → bzbarsky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Whiteboard: [need review]
Comment on attachment 8431286 [details] [diff] [review]
Don't expose the XMLDocument bits on the return value of new Document

Review of attachment 8431286 [details] [diff] [review]:
-----------------------------------------------------------------

Wish we could just instantiate nsDocument :-(.
Attachment #8431286 - Flags: review?(peterv) → review+
https://hg.mozilla.org/mozilla-central/rev/15aa216cebf9
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [need review]
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.