Bug 154037 - Window should have its 'constructor' property on the prototype
Summary: Window should have its 'constructor' property on the prototype
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: http://heycam.github.io/webidl/#inter...
Keywords: InRadar, WebExposed
Depends on: 153920
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-09 09:49 PST by Chris Dumez
Modified: 2016-02-17 00:38 PST (History)
8 users (show)

See Also:


Attachments
Patch (23.07 KB, patch)
2016-02-16 20:56 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-02-09 09:49:24 PST
Window should have its 'constructor' property on the prototype as per:
http://heycam.github.io/webidl/#interface-prototype-object

Similarly to other interfaces. This matches the behavior of Firefox and Chrome also.

Our bindings generator currently puts this attribute on the instance because Window has the [CheckSecurity] IDL extended attribute. However, security-wise, moving 'constructor' to the prototype should be safe considering that it is not possible to access a Window's prototype cross-origin.
Comment 1 Chris Dumez 2016-02-09 09:51:31 PST
We just need to make sure that accessing crossOriginWindow.constructor still fails due to security checks.
Comment 2 Radar WebKit Bug Importer 2016-02-16 16:59:34 PST
<rdar://problem/24689078>
Comment 3 Chris Dumez 2016-02-16 20:56:19 PST
Created attachment 271527 [details]
Patch
Comment 4 WebKit Commit Bot 2016-02-17 00:38:27 PST
Comment on attachment 271527 [details]
Patch

Clearing flags on attachment: 271527

Committed r196690: <http://trac.webkit.org/changeset/196690>
Comment 5 WebKit Commit Bot 2016-02-17 00:38:32 PST
All reviewed patches have been landed.  Closing bug.