Bug 95486 - PAGE_POPUP: Using window.pagePopupController will crash in non-V8 build
Summary: PAGE_POPUP: Using window.pagePopupController will crash in non-V8 build
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-30 12:27 PDT by Yong Li
Modified: 2013-09-01 10:41 PDT (History)
6 users (show)

See Also:


Attachments
the patch (1.30 KB, patch)
2012-08-30 12:45 PDT, Yong Li
abarth: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yong Li 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"
Comment 1 Yong Li 2012-08-30 12:45:12 PDT
Created attachment 161536 [details]
the patch
Comment 2 Yong Li 2012-08-30 13:38:43 PDT
Ping Chromium team: any objections?
Comment 3 Adam Barth 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.
Comment 4 Kent Tamura 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.
Comment 5 Yong Li 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?
Comment 6 Kent Tamura 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.
Comment 7 Yong Li 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?
Comment 8 Adam Barth 2012-09-04 11:41:56 PDT
Why not just disable PAGE_POPUP in your port?
Comment 9 Yong Li 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)
Comment 10 Adam Barth 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.
Comment 11 Yong Li 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.
Comment 12 Adam Barth 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.
Comment 13 Anders Carlsson 2013-09-01 10:41:55 PDT
PAGE_POPUP was removed.