Skip to content

"Source browsing context" not well defined #632

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

Closed
jeisinger opened this issue Feb 5, 2016 · 8 comments
Closed

"Source browsing context" not well defined #632

jeisinger opened this issue Feb 5, 2016 · 8 comments
Assignees

Comments

@jeisinger
Copy link
Member

In https://html.spec.whatwg.org/#source-browsing-context it says that every navigation has a source browsing context, which is the browsing context responsible for starting the navigation.

Is it possible to define this further. Especially, if a navigation is triggered from a script, what is the source browsing context? The responsible browsing context of the entered settings object?

@foolip
Copy link
Member

foolip commented Feb 5, 2016

Have you tested what the answer is in various browsers? Retrospec is the best spec :)

@jeisinger
Copy link
Member Author

So far, I only tested blink, and the answer is that we don't have a consistent rule :)

@foolip
Copy link
Member

foolip commented Feb 5, 2016

Paging @bzbarsky, Savior of the Universe.

@bzbarsky
Copy link
Contributor

bzbarsky commented Feb 5, 2016

So... I can't recall offhand what the source browsing context is used for (anything other than referrer?). I expect that Gecko tries to get referrer from "the thing that started the navigation", but that's a slightly vague concept at times.

Past that, the spec typically does define what the source browsing context is. The question is whether it matches browsers or not.

For example, if you set location.href you end up in https://html.spec.whatwg.org/multipage/browsers.html#location-object-navigate which says you use the incumbent settings object to get the source browsing context.

Or if you navigate by setting .src on an iframe, you land in https://html.spec.whatwg.org/multipage/embedded-content.html#process-the-iframe-attributes which ... doesn't actually define the source browsing context. That's a spec bug; it should define it.

For comparison, https://html.spec.whatwg.org/multipage/embedded-content.html#the-embed-element-setup-steps does specify (step 2 of the image/svg+xml steps): "Navigate the nested browsing context to the fetched resource, with replacement enabled, and with the embed element's node document's browsing context as the source browsing context." There's similar language in the processing of <object data=whatever>. So seems like iframe should do the same thing. I believe that's what UAs do here anyway; certainly Gecko does.

Not sure whether this helps or not. Basically, every spot that invokes the navigation algorithm needs to decide what this value should be....

@foolip
Copy link
Member

foolip commented Feb 5, 2016

@jeisinger, eager to attempt making some sense of this in a PR? :)

@annevk
Copy link
Member

annevk commented Apr 30, 2016

This is #1130 which arguably is a duplicate of this, except that it is a lot more clear.

@annevk
Copy link
Member

annevk commented Apr 30, 2016

@jeisinger are you okay with closing this in favor of that issue?

@jeisinger
Copy link
Member Author

of course

@annevk annevk closed this as completed May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants