Bug 95486

Summary: PAGE_POPUP: Using window.pagePopupController will crash in non-V8 build
Product: WebKit Reporter: Yong Li <yong.li.webkit>
Component: WebCore JavaScriptAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: abarth, andersca, ojan, rwlbuis, tkent, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
the patch abarth: review-

Yong Li
Reported 2012-08-30 12:27:32 PDT
Non-V8 build doesn't support V8EnabledPerContext. And it will access a null pointer in DOMWindowPagePopup::pagePopupController rather than returning "undefined"
Attachments
the patch (1.30 KB, patch)
2012-08-30 12:45 PDT, Yong Li
abarth: review-
Yong Li
Comment 1 2012-08-30 12:45:12 PDT
Created attachment 161536 [details] the patch
Yong Li
Comment 2 2012-08-30 13:38:43 PDT
Ping Chromium team: any objections?
Adam Barth
Comment 3 2012-08-30 16:21:16 PDT
Comment on attachment 161536 [details] the patch I believe this is needed to implement some <input> elements, like the date picker. We should just fix the underlying crash.
Kent Tamura
Comment 4 2012-08-30 19:00:19 PDT
I guess the crash happens with normal web pages because DOMWindow objects for normal web pages don't have DOMWindowPagePopup supplement objects. Anyway, the right fix is to add support of EnabledPerContext to JSC binding.
Yong Li
Comment 5 2012-08-31 07:43:17 PDT
(In reply to comment #4) > I guess the crash happens with normal web pages because DOMWindow objects for normal web pages don't have DOMWindowPagePopup supplement objects. > > Anyway, the right fix is to add support of EnabledPerContext to JSC binding. Exactly. But before EnabledPerContext being supported, can we make it a V8 binding only property?
Kent Tamura
Comment 6 2012-09-02 19:15:48 PDT
(In reply to comment #5) > (In reply to comment #4) > > I guess the crash happens with normal web pages because DOMWindow objects for normal web pages don't have DOMWindowPagePopup supplement objects. > > > > Anyway, the right fix is to add support of EnabledPerContext to JSC binding. > > Exactly. But before EnabledPerContext being supported, can we make it a V8 binding only property? Why do you need to make it V8-only? If you need no window.pagePopupController, you should exclude DOMWindowPagePopup.idl from build target.
Yong Li
Comment 7 2012-09-04 07:38:18 PDT
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > I guess the crash happens with normal web pages because DOMWindow objects for normal web pages don't have DOMWindowPagePopup supplement objects. > > > > > > Anyway, the right fix is to add support of EnabledPerContext to JSC binding. > > > > Exactly. But before EnabledPerContext being supported, can we make it a V8 binding only property? > > Why do you need to make it V8-only? Because it crashes on a non-V8 build. > If you need no window.pagePopupController, you should exclude DOMWindowPagePopup.idl from build target. DOMWindowPagePopup.idl is included in WebCore/CMakeLists.txt, which is a cross-platform file. I don't prefer to add platform-specific code to that cmake file. Any other solution?
Adam Barth
Comment 8 2012-09-04 11:41:56 PDT
Why not just disable PAGE_POPUP in your port?
Yong Li
Comment 9 2012-09-04 11:46:31 PDT
(In reply to comment #8) > Why not just disable PAGE_POPUP in your port? Because we are using ENABLE(PAGE_POPUP)
Adam Barth
Comment 10 2012-09-04 12:04:57 PDT
I don't think ENABLE(PAGE_POPUP) works correctly without DOMWindowPagePopup.idl and EnabledPerContext. It seems that the proper resolution is to finish your implementation of ENABLE(PAGE_POPUP) by implementing EnabledPerContext.
Yong Li
Comment 11 2012-09-04 12:12:41 PDT
(In reply to comment #10) > I don't think ENABLE(PAGE_POPUP) works correctly without DOMWindowPagePopup.idl and EnabledPerContext. It seems that the proper resolution is to finish your implementation of ENABLE(PAGE_POPUP) by implementing EnabledPerContext. What do you mean by "correctly"? We've got it work as we want, until it is broken by r118482. I think you guys should implement EnabledPerContext before including DOMWindowPagePopup.idl into the cross-platform cmake file.
Adam Barth
Comment 12 2012-09-04 12:15:39 PDT
> What do you mean by "correctly"? The pagePopupController object should be exposed to page popups, but not to arbitrary web sites. For that to work, it needs to be enabled per context. Simply ifdefing DOMWindowPagePopup out of the build will break ENABLE(PAGE_POPUP). It has the same effect as simply disabling PAGE_POPUP.
Anders Carlsson
Comment 13 2013-09-01 10:41:55 PDT
PAGE_POPUP was removed.
Note You need to log in before you can comment on or make changes to this bug.