Bug 161393 - Object.getPrototypeOf() should return null cross-origin
Summary: Object.getPrototypeOf() should return null cross-origin
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2016-08-30 11:16 PDT by Chris Dumez
Modified: 2016-08-31 13:44 PDT (History)
10 users (show)

See Also:


Attachments
Patch (4.27 KB, patch)
2016-08-30 11:18 PDT, 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-08-30 11:16:23 PDT
Object.getPrototypeOf() should return null cross-origin:
- https://html.spec.whatwg.org/#windowproxy-getprototypeof
- https://html.spec.whatwg.org/#location-getprototypeof

Firefox and Chrome return null. However, WebKit returns undefined.
Comment 1 Chris Dumez 2016-08-30 11:18:36 PDT
Created attachment 287413 [details]
Patch
Comment 2 Chris Dumez 2016-08-31 11:20:22 PDT
Ping review?
Comment 3 Geoffrey Garen 2016-08-31 11:44:37 PDT
Comment on attachment 287413 [details]
Patch

r=me

Not directly related to this patch, but it seems weird that Object.getPrototypeOf() needs to walk the stack. Why can't it just compare the callee's global object to the passed-in object's global object?
Comment 4 WebKit Commit Bot 2016-08-31 12:05:46 PDT
Comment on attachment 287413 [details]
Patch

Clearing flags on attachment: 287413

Committed r205258: <http://trac.webkit.org/changeset/205258>
Comment 5 WebKit Commit Bot 2016-08-31 12:06:20 PDT
All reviewed patches have been landed.  Closing bug.