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

"child browsing context name property set" has some potentially-strange behavior #1337

Closed
domenic opened this issue May 28, 2016 · 3 comments · Fixed by #1342
Closed

"child browsing context name property set" has some potentially-strange behavior #1337

domenic opened this issue May 28, 2016 · 3 comments · Fixed by #1342
Assignees
Labels
clarification Standard could be clearer

Comments

@domenic
Copy link
Member

domenic commented May 28, 2016

This is a follow-up of #1312 which I just merged; I should have asked this before merging.

The ordering of step 2's "later duplicates omitted" and step 3's removal of different-origin browsing contexts seems potentially suspect. Consider the following set of child browsing contexts of the active document, where the current origin is example1.com:

  • name = "a", origin = example2.com
  • name = "a", origin = example1.com

With this set, the result of running the algorithm after step 2, by my reading, is:

  • name = "a", origin = example2.com

(later duplicates being omitted. Assuming duplicates means duplicate names?)

Then, after step 3, we remove that list entry, because it is not same-origin. The result is that there are no child browsing context names. This seems unlikely to be intended.


Suggested solutions:

  • Clarify what "later duplicates being omitted" means. I don't think it's possible to have duplicate browsing contexts, so if this is based on "browsing context identity", then this sentence should be removed. If it's based on name, it should be clarified, e.g. "including only the first child browsing context with a given name if multiple child browsing contexts have the same one."
  • Is this behavior correct? If so, then clarification suffices. If not, then I'd suggest doing the duplicate name filtering at the last step. (Perhaps coupled with Clarify how "child browsing contexts" works #1336's suggestion of defining "a Window object's same-origin child browsing contexts"?)
@domenic
Copy link
Member Author

domenic commented May 28, 2016

If so, then clarification suffices

Actually, if this behavior is intentional, then adding an example like the one in my OP would probably be the best way to go.

@annevk
Copy link
Member

annevk commented May 29, 2016

Pretty sure that is intended. E.g., I tested with

<iframe name=https://dump.testsuite.org/temp/frame.html>
<iframe name=test></iframe>
<script>
  onload = function() {
    w(window.test)
  }
</script>

in Live DOM Viewer and that yields undefined (frame.html sets window.name to "test").

@domenic
Copy link
Member Author

domenic commented May 29, 2016

Wow, weird! OK, then yeah, clarifying that duplicates is based on name, and adding an example like that one, would be quite helpful.

@domenic domenic added the clarification Standard could be clearer label May 29, 2016
annevk added a commit that referenced this issue May 29, 2016
Follow up to #1312. Make “child browsing context name property set”
actually return browsing context names and clarify how the omitting
duplicates process works.

Fixes #1337 and fixes #1338.
domenic pushed a commit that referenced this issue Jun 1, 2016
Follow up to #1312. Make “child browsing context name property set”
actually return browsing context names and clarify how the omitting
duplicates process works.

Fixes #1337 and fixes #1338.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer
Development

Successfully merging a pull request may close this issue.

2 participants