Closed Bug 1580241 Opened 5 months ago Closed 2 months ago

Fix usage of nsIDocShellTreeItem in nsDocShell::CanSavePresentation

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla73
Fission Milestone M4.1
Tracking Status
firefox73 --- fixed

People

(Reporter: djvj, Assigned: djvj)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [rm-docshell-tree-item:simple])

Attachments

(1 file)

https://searchfox.org/mozilla-central/source/docshell/base/nsDocShell.cpp#7155

This should be a simple fix, but there is an existing confusion in the code here (it seems to be correct, but for the wrong reasons).

  nsCOMPtr<nsIDocShellTreeItem> root;
  GetInProcessSameTypeParent(getter_AddRefs(root));
  if (root && root != this) {
    return false;  // this is a subframe load
  }

The variable is called root, and the code checks the variable using logic that would work if it was actually the root, but the variable is set to the parent docshell, which incidentally happens to also work under the logic (if the parent exists and returns non-null, then the root != this condition will always be true anyway).

Getting back to the Fission fix - this should be changed to use the BrowsingContext to query for the same-type parent, and also change the code to call the variable parent, and the conditional to simply if (parent) { ... }.

Fission Milestone: --- → M5
Priority: -- → P2
Whiteboard: [rm-docshell-tree-item:simple]
Blocks: 1592920
Fission Milestone: M5 → Future

This blocks toolkit/components/passwordmgr/test/mochitest/test_autofill_from_bfcache.html for fission.

Fission Milestone: Future → M4.1
Assignee: nobody → kvijayan
Pushed by kvijayan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dcd04d1caf93
Fix usage of nsIDocShellTreeItem in nsDocShell::CanSavePresentation r=kmag
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73

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

This blocks toolkit/components/passwordmgr/test/mochitest/test_autofill_from_bfcache.html for fission.

Note that this bug didn't enable that test and it still fails with the fix.

You need to log in before you can comment on or make changes to this bug.