Bug 840488 - Refactor Gecko to provide a more direct API to ask whether script is allowed for a given global. r=bz
Bug 840488 - Get rid of aAllowIfNoScriptContext. r=bz

The old code seemed to feel that the lack of a script context was some sort of
showdown that required either unconditional allow or deny. Instead, let's just
make the scriptcontext-relevant checks conditional on there being a script
context, which lets us switch CheckFunctionAccess over to ScriptAllowed.
Bug 840488 - Remove CheckFunctionAccess. r=bz

\o/

Aside from checking whether script is enabled, all the other work this function
does is silly.
Bug 840488 - Update unsafe-JAR channel tests so that they actually fail if we allow script to run. r=bz

The current tests never actually check that script is disabled for unsafe JAR
channels, but only that they're unable to initiate loads. This fixes that.

This blob runs dos2unix on the files inside the zip, and applies the following patch to iframes.html:

 <html><head>
   <title>iframes</title>
+  <script>parent.poke('regular script');</script>
 </head>
-<body>
+<body onload="parent.poke('onload-handler')">
  subshells
  <p>
  <iframe id="data-iframe" src="data:text/html,dataurl iframe<script>window.parent.parent.poke('data-iframe')</script>">ifr</iframe>
  <p>
  <iframe id="js-iframe" src="javascript:window.parent.parent.poke('js-iframe')">jsifr</iframe>
 </body>
-</html>
\ No newline at end of file
+</html>
Bug 840488 - Introduce a mechanism to temporarily or permanently block script for a given scope, and use it for unsafe channels. r=bz
Bug 840488 - Directly mark compartments whose docshells disable script execution. r=bz
Bug 840488 - Move print system script disabling to the new API. r=bz
Bug 840488 - Move jsd over to the new API. r=bz

This setup is kind of hacky. JSD exposed a per-context script toggle, which,
while nonsensical, exhibits visibly different semantics than a per-global
toggle (since the former follows the WindowProxy across navigations, whereas
the latter does not). Honza says that Firebug ensures that any instances of
|jsdcx.scriptsEnabled = false| are guaranteed to be followed by
|jsdcx.scriptsEnabled = true| before a navigation occurs, so this should be
good enough.
Bug 840488 - Move nsXULDocument to new-style scripts checks. r=bz
Bug 840488 - Remove nsIScriptContext script check in nsScriptLoader. r=bz

There are now no longer any consumers that set this to false.
Bug 840488 - Remove per-JSContext script toggling. r=bz

Note that the checks in nsJSEnvironment::EvaluateString and EvalInWindow
can safely go away, because we call ssm->ScriptAllowed() in
nsJSUtils::EvaluateString.
Bug 840488 - Compute immunity from caps checks exactly once, and kill nsScriptSecurityManager::CanExecuteScripts. r=bz
Bug 840488 - New domain policy API. r=bz

Note that this patch changes the semantics of javascript.enabled so that changes
to the pref do not apply to compartments that have already been created. This is
a significant change, but is necessary to support the new domain policy API.
After one cycle or so, we'll rip out the old API.
Bug 840488 - Tests. r=bz