This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27520 - Considering returning null rather than throwing for cross-origin frameElement
Summary: Considering returning null rather than throwing for cross-origin frameElement
Status: RESOLVED MOVED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: https://html.spec.whatwg.org/#navigat...
Whiteboard: [good first bug]
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-04 17:51 UTC by contributor
Modified: 2015-10-29 10:45 UTC (History)
6 users (show)

See Also:


Attachments

Description contributor 2014-12-04 17:51:03 UTC
Specification: https://html.spec.whatwg.org/
Multipage: https://html.spec.whatwg.org/multipage/#navigating-nested-browsing-contexts-in-the-dom
Complete: https://html.spec.whatwg.org/#navigating-nested-browsing-contexts-in-the-dom
Referrer: 

Comment:
Considering returning null rather than throwing for cross-origin frameElement

Posted from: 12.216.224.110
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:37.0) Gecko/20100101 Firefox/37.0
Comment 1 Bobby Holley (:bholley) 2014-12-04 17:52:30 UTC
This is what Gecko does now - it seems reasonable and symmetric, given that we also return null for cross-origin .contentDocument. Any reason not to return null instead of throwing?

I'm totally willing to change Gecko's behavior if we decide for some reason that it's undesirable.
Comment 2 Ian 'Hixie' Hickson 2014-12-19 19:59:26 UTC
I could go either way. What do other browsers do?
Comment 3 Bobby Holley (:bholley) 2014-12-19 22:50:35 UTC
(In reply to Ian 'Hixie' Hickson from comment #2)
> I could go either way. What do other browsers do?

Chrome throws. I can't figure out how to make Safari's web console change contexts to the iframe, and I don't have time to write an actual test.
Comment 4 Yuki Shiino 2015-10-20 07:12:33 UTC
I happened to know this issue, and I'm now thinking that returning null is preferable.  If this is going to be spec'ed, I'm happy to implement the new behavior in Chrome.

What's the situation?  What's preventing to update the spec?
Comment 5 Anne 2015-10-20 07:34:39 UTC
We just need someone to provide a patch to the specification or one of the editors to get around to it.

See https://github.com/whatwg/html for details.
Comment 6 Philip Jägenstedt 2015-10-20 08:31:22 UTC
I've attempted to fix this in https://github.com/whatwg/html/pull/266

Shiino-san, can you update http://w3c-test.org/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html and import that test into Blink when you implement the new behavior?
Comment 7 Yuki Shiino 2015-10-22 07:51:28 UTC
Thanks for updating the spec.  Will work on W3C tests and Blink implementation (in my spare time, maybe slow).
Comment 8 Yuki Shiino 2015-10-29 10:45:12 UTC
Just FYI, everything has got done.