Bug 27931 - JSNodeCustom should call document() instead of scriptExecutionContext()
Summary: JSNodeCustom should call document() instead of scriptExecutionContext()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-02 02:04 PDT by Adam Barth
Modified: 2009-08-02 20:50 PDT (History)
1 user (show)

See Also:


Attachments
Patch v1 (3.43 KB, patch)
2009-08-02 02:24 PDT, Adam Barth
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Barth 2009-08-02 02:04:12 PDT
As required by Darin Adler.
Comment 1 Darin Adler 2009-08-02 02:10:20 PDT
The key issue here is that we want to call an inline function, not a virtual function.

The inline function could be document() or it could be an inline version of scriptExecutionContext(). See the Node::prefix() function for an example of this design pattern.
Comment 2 Adam Barth 2009-08-02 02:24:12 PDT
Created attachment 33947 [details]
Patch v1
Comment 3 Darin Adler 2009-08-02 02:50:45 PDT
Comment on attachment 33947 [details]
Patch v1

On reflection, I don't think this patch is right.

Document is derived from ScriptExecutionContext, so there's no need to overload toJSDOMGlobalObject to take a Document*. The JSNodeCustom.cpp change can stand alone. No need to change JSDOMGLobalObject.h and .cpp.

I'm changing my review to review-.
Comment 4 Adam Barth 2009-08-02 02:56:28 PDT
> No need to change JSDOMGLobalObject.h and .cpp.

True.  I guess all you're saving is the fake RTTI branch.  I'll spin up a new version of the patch tomorrow.  I have the Node* change in my try at the moment, so it will take a bit of time to rebuild.
Comment 5 Darin Adler 2009-08-02 02:59:33 PDT
(In reply to comment #4)
> > No need to change JSDOMGLobalObject.h and .cpp.
> 
> True.  I guess all you're saving is the fake RTTI branch.  I'll spin up a new
> version of the patch tomorrow.  I have the Node* change in my try at the
> moment, so it will take a bit of time to rebuild.

I must be really tired! I think it *is* worthwhile to save the fake RTTI branch. Sorry for going back and forth on this so much.
Comment 6 Darin Adler 2009-08-02 03:00:09 PDT
Comment on attachment 33947 [details]
Patch v1

I changed my mind again and I think this patch is good as-is.
Comment 7 Adam Barth 2009-08-02 20:50:06 PDT
Comment on attachment 33947 [details]
Patch v1

Clearing review flag on attachment: 33947

Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/bindings/js/JSDOMGlobalObject.cpp
	M	WebCore/bindings/js/JSDOMGlobalObject.h
	M	WebCore/bindings/js/JSNodeCustom.cpp
Committed r46710
	M	WebCore/ChangeLog
	M	WebCore/bindings/js/JSDOMGlobalObject.h
	M	WebCore/bindings/js/JSDOMGlobalObject.cpp
	M	WebCore/bindings/js/JSNodeCustom.cpp
r46710 = 8e29f864509f257cdb9711b14c33ff706cb3e96b (trunk)
No changes between current HEAD and refs/remotes/trunk
Resetting to the latest refs/remotes/trunk
http://trac.webkit.org/changeset/46710
Comment 8 Adam Barth 2009-08-02 20:50:10 PDT
All reviewed patches have been landed.  Closing bug.