Open Bug 960563 Opened 11 years ago Updated 2 years ago

Check that the callers of nsDocShell::LoadURI pass the correct source browsing context (docshell) in |aLoadInfo|

Categories

(Core :: DOM: Navigation, defect)

defect

Tracking

()

People

(Reporter: bobowen, Unassigned)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

Where possible the callers of LoadURI should pass a source browsing context (using |nsDocShellLoadInfo::SetSourceDocShell| on |aLoadInfo| argument) as set out in the HTML spec.
See: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#source-browsing-context and references in other pages.

Note from bholley from bug 785310 comment 107:

"I just realized that we won't be able to assert that the source browsing context is non-null. In the spec, scripts always have a browsing context. But in Gecko, there are lots of things like sandboxes and whatnot that don't. So we unfortunately need to handle that (generally, things that don't QI to nsIPIDOMWindow can't be sandboxed).

Maybe what we should do instead is to force callers to invoke SetSourceDocShell, even if they pass null. We could have a debug-only boolean on nsDocShellLoadInfo that checks whether the source docshell was ever set, and we could assert that boolean when someone calls GetSourceDocShell."
Blocks: 960639
Blocks: 631218
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.