Closed Bug 1646560 Opened 4 years ago Closed 3 years ago

Fix GetInProcessParentDocshell usage in nsDocShell::RecomputeCanExecuteScripts

Categories

(Core :: DOM: Navigation, defect, P2)

defect

Tracking

()

RESOLVED FIXED
91 Branch
Fission Milestone M7a
Tracking Status
firefox91 --- fixed

People

(Reporter: kmag, Assigned: kmag)

References

(Blocks 1 open bug)

Details

Attachments

(8 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

It ignores OOP ancestors, which it probably shouldn't. The flag probably needs to move to BrowsingContext instead.

Severity: -- → S3
Priority: -- → P3

Used for disabling JS for a page, probably used by devtools.

Fission Milestone: --- → M6c

kmag, I have a few spare cycles, so Neha suggested I could pick this bug, but I don't quite understand the objective. Are there any tests I can run to get a better idea of the problem?

Flags: needinfo?(kmaglione+bmo)

I'm not sure. Devtools definitely toggles the allowJavascript flag, and would therefore be affected by this:

https://searchfox.org/mozilla-central/source/devtools/server/actors/targets/browsing-context.js#1251

But I don't know what tests would use it, or whether there are any existing tests that use it with OOP subframes.

Either way, I think we probably just want to move the flag from nsDocShell to BrowsingContext, and ideally change Devtools to set it in the parent so we can forbid trying to set it from a child.

Flags: needinfo?(kmaglione+bmo)

So, to summarize:

  1. Move allowJavascript from nsDocShell to BrowsingContext.
  2. Fix something with RecomputeCanExecuteScript. I don't understand what yet. Remove the dependency on parent->mCanExecuteScripts, maybe?
  3. Fix DevTools so that it touches allowJavascript only in the parent.
  4. Remove/forbid allowJavascript in the child.

Do I understand correctly so far?

Flags: needinfo?(kmaglione+bmo)

RecomputeCanExecuteScript would just have to look at ancestor BrowsingContexts rather than ancestor DocShells.

Flags: needinfo?(kmaglione+bmo)
Assignee: nobody → dteller
Status: NEW → ASSIGNED
See Also: → 1655964
Attachment #9177860 - Attachment description: Bug 1646560 - Move allowJavascript from docShell to BrowsingContext (SpecialPowers);r?kmag → Bug 1646560 - Move allowJavascript from docShell to BrowsingContext (GeckoView);r?agi
Priority: P3 → P1

I won't have time to finish this.

Assignee: D.O.Teller+bugspam → nobody
Status: ASSIGNED → NEW
Assignee: nobody → kmaglione+bmo
Status: NEW → ASSIGNED
Priority: P1 → P2

Steven, there is one patch from yoric that needs to be re-written. Can you pick this up please?

Assignee: kmaglione+bmo → smacleod

This is only used by devtools and doesn't block 50% Fission Nightly experiment. Moving it to M7 to block Fission on Beta.
Steven, when you get to work on this, please discuss with Nika as she has thoughts on how this should be done correctly by moving to the parent process.

Fission Milestone: M6c → M7

We stopped saving this information long ago (see Bug 1328013) but the
restoration code was left in place. Since allowJavascript is being moved
to the BrowsingContext we might as well remove the old restoration code.

(In reply to Neha Kochar [:neha] from comment #13)

This is only used by devtools and doesn't block 50% Fission Nightly experiment. Moving it to M7 to block Fission on Beta.
Steven, when you get to work on this, please discuss with Nika as she has thoughts on how this should be done correctly by moving to the parent process.

Sounds good. I've dumped my WIP patches to phabricator and will come back to this once my other M6c work is complete.

Whiteboard: [3/10]: ETA: 3/12 or 3/15
Fission Milestone: M7 → M7a
Whiteboard: [3/10]: ETA: 3/12 or 3/15
Assignee: smacleod → nobody
Status: ASSIGNED → NEW
Assignee: nobody → kmaglione+bmo
Status: NEW → ASSIGNED

They were originally written for the extension framework, but have been used
more and more widely ever since.

This is slightly complicated by the fact that the editor code wants to be able
to set this from the content process, so we really need separate
BrowsingContext and WindowContext flags, the latter of which can be set by the
owning process.

Pushed by maglione.k@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/284dc9ca5f5c
Part 1 - Move some XPCShell content helpers to generic shared module. r=nika
https://hg.mozilla.org/integration/autoland/rev/0fa59c7f0f82
Part 2 - Move allowJavascript and friends from DocShell to BrowsingContext and WindowContext. r=jdescottes,nika,geckoview-reviewers,devtools-backward-compat-reviewers,agi
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
Pushed by maglione.k@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/3ddb25d50aa6
Follow-up: Review comment fixes that wound up in the wrong patch.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: