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

Remove "responsible browsing context" #5422

Closed
domenic opened this issue Mar 31, 2020 · 1 comment · Fixed by #5441
Closed

Remove "responsible browsing context" #5422

domenic opened this issue Mar 31, 2020 · 1 comment · Fixed by #5441
Assignees
Labels
clarification Standard could be clearer

Comments

@domenic
Copy link
Member

domenic commented Mar 31, 2020

Similar to #4335, we can probably remove the "responsible browsing context" concept from environment settings objects. Notably, service workers don't have one, which breaks the script execution parts of the spec (which assume that one exists).

It is used in the following ways:

  • "Can execute script" checks. Apparently we decided that "scripting is disabled" is a browsing-context wide setting? I guess maybe because the UI for configuring things like NoScript is per-tab? I'm not sure; it seems like this would be better per-global.
  • Setting the "source browsing context" in "Location-object navigate" and the "window open steps". (Note that per Use of source browsing context in navigation seems totally broken to me #1130 "source browsing context" is a bad concept and should go away.)
  • A couple of checks on the incumbent settings object in window.close().

The latter two could be replaced by Window-specific incantations that don't need to go through the environment settings object infrastructure. For example instead of

the entry settings object's responsible browsing context

we could do

the entry global object's browsing context.

So the only hard part here is what to do with "can execute script" checks. I think it seems very reasonable to just move that concept to globals instead of browsing contexts, personally.

@domenic domenic added the clarification Standard could be clearer label Mar 31, 2020
@annevk
Copy link
Member

annevk commented Mar 31, 2020

See also #1580.

@domenic domenic self-assigned this Apr 6, 2020
domenic added a commit that referenced this issue Apr 6, 2020
Previously it was per-browsing context. This caused a number of
problems when used from workers; it went through the "responsible
document" indirection which did not exist for service workers and was
racy in other cases.

In theory this might be cleaner if it were per agent, i.e. if agents
maintained internal consistency about disabling or enabling scripting.
In practice user agents seem to have a single user-agent-wide switch,
and at least some of them wire that to a per-global boolean, so we just
use per-global as it fits most cleanly into existing architecture and
matches at least some implementation internals.

Closes #1580. Helps with #5422.
domenic added a commit that referenced this issue Apr 6, 2020
The algorithm for obtaining a responsible browsing context was present
on all environment settings objects. However, it was only used in Window
contexts. This replaces all usage sites with more direct references to
the browsing context in question.

Closes #5422.
domenic added a commit that referenced this issue Apr 7, 2020
Previously it was per-browsing context. This caused a number of
problems when used from workers; it went through the "responsible
document" indirection which did not exist for service workers and was
racy in other cases.

In theory this might be cleaner if it were per agent, i.e. if agents
maintained internal consistency about disabling or enabling scripting.
In practice user agents seem to have a single user-agent-wide switch,
and at least some of them wire that to a per-global boolean, so we just
use per-global as it fits most cleanly into existing architecture and
matches at least some implementation internals.

Closes #1580. Helps with #5422.
domenic added a commit that referenced this issue Apr 7, 2020
The algorithm for obtaining a responsible browsing context was present
on all environment settings objects. However, it was only used in Window
contexts. This replaces all usage sites with more direct references to
the browsing context in question.

Closes #5422.
domenic added a commit that referenced this issue Apr 7, 2020
The algorithm for obtaining a responsible browsing context was present
on all environment settings objects. However, it was only used in Window
contexts. This replaces all usage sites with more direct references to
the browsing context in question.

Closes #5422.
domenic added a commit that referenced this issue Apr 7, 2020
The algorithm for obtaining a responsible browsing context was present
on all environment settings objects. However, it was only used in Window
contexts. This replaces all usage sites with more direct references to
the browsing context in question.

Closes #5422.
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