Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support/fix window.frames #1928

Closed
sigmundch opened this issue Feb 29, 2012 · 7 comments
Closed

support/fix window.frames #1928

sigmundch opened this issue Feb 29, 2012 · 7 comments
Labels
type-enhancement A request for a change that isn't a bug web-libraries Issues impacting dart:html, etc., libraries

Comments

@sigmundch
Copy link
Member

window.frames currently returns the same instance window. In JS this works because the window is also an array that contains all the child frames.

This doesn't work in Dart because [] and .length are not supported on the returned type. We should probably update the return type to be more sensible (e.g. List<Window> get frames())

We can work around this for now to get frames by doing
window.queryAll('iframe')
and retrieving the window from the iframe element.

Fixing widnow.frames will still be important long term if we want to support accessing an grandchild-iframe (e.g. window.frames[0].frames[1]). This is because the window returned by the iframe element is more restricted and doesn't allow accessing its document content (e.g. the following is illegal: window.queryAll('iframe')[0].queryAll('iframe')[1])

@vsmenon
Copy link
Member

vsmenon commented Apr 13, 2012

Removed Area-UI label.
Added Area-DOM label.

@vsmenon
Copy link
Member

vsmenon commented Jul 11, 2012

Set owner to @vsmenon.
Added this to the M1 milestone.

@iposva-google
Copy link
Contributor

Removed Area-DOM label.
Added Area-HTML label.

@vsmenon
Copy link
Member

vsmenon commented Oct 5, 2012

We've decided to remove window.frames as it no longer appear to be commonly used - it's currently broken.

The workaround should work for common cases:

window.queryAll('iframe').map((f) => f.contentWindow);

Please star if you'd like to see this added.


cc @blois.
cc @sigmundch.
Removed this from the M1 milestone.
Added this to the Later milestone.
Removed Type-Defect label.
Added Type-Enhancement label.

@vsmenon
Copy link
Member

vsmenon commented Aug 22, 2013

Removed the owner.

@efortuna
Copy link
Contributor

efortuna commented Oct 3, 2013

Added html-api label.

@blois
Copy link
Contributor

blois commented Oct 3, 2013

Fixed as this API has been removed.


Added Fixed label.

@sigmundch sigmundch added Type-Enhancement web-libraries Issues impacting dart:html, etc., libraries labels Oct 3, 2013
@sigmundch sigmundch added this to the Later milestone Oct 3, 2013
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug web-libraries Issues impacting dart:html, etc., libraries
Projects
None yet
Development

No branches or pull requests

6 participants