Bug 119989 - Make use of Node::ownerDocument a compile time error
Summary: Make use of Node::ownerDocument a compile time error
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-18 20:19 PDT by Darin Adler
Modified: 2019-02-06 09:03 PST (History)
14 users (show)

See Also:


Attachments
Patch (10.57 KB, patch)
2013-08-18 21:15 PDT, Darin Adler
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2013-08-18 20:19:56 PDT
Make use of Node::ownerDocument a compile time error
Comment 1 Darin Adler 2013-08-18 21:11:08 PDT
The Node::document function is the one we should be using. Node::ownerDocument is only there to be part of the exported DOM binding for JavaScript.
Comment 2 Darin Adler 2013-08-18 21:15:38 PDT
Created attachment 209048 [details]
Patch
Comment 3 WebKit Commit Bot 2013-08-18 23:39:20 PDT
Comment on attachment 209048 [details]
Patch

Clearing flags on attachment: 209048

Committed r154264: <http://trac.webkit.org/changeset/154264>
Comment 4 WebKit Commit Bot 2013-08-18 23:39:23 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Andreas Kling 2013-08-19 12:20:10 PDT
View in context: https://bugs.webkit.org/attachment.cgi?id=209048&action=review

> Source/WebCore/ChangeLog:27
> +        Did not remove the null check at this time, although I'm pretty sure it's bogus. We can
> +        fix that when/if we change the return type of Element::document to a reference.

Document& document()! That would be great, and propagates nicely to the rendering code, too.
Comment 6 Darin Adler 2013-08-19 13:54:50 PDT
(In reply to comment #5)
> View in context: https://bugs.webkit.org/attachment.cgi?id=209048&action=review
> 
> > Source/WebCore/ChangeLog:27
> > +        Did not remove the null check at this time, although I'm pretty sure it's bogus. We can
> > +        fix that when/if we change the return type of Element::document to a reference.
> 
> Document& document()! That would be great, and propagates nicely to the rendering code, too.

Node::document() can’t return a reference because DocumentType objects don’t necessarily have a document. But any derived classes that are not base classes of DocumentType can change the function to return a reference.
Comment 7 Lucas Forschler 2019-02-06 09:03:41 PST
Mass moving XML DOM bugs to the "DOM" Component.