Auto merge of #10946 - bd339:iss10940, r=nox

Disable scripting for documents created without a browsing context

Goes towards closing #10940.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10946)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-02 08:48:02 -07:00
commit a54dedac1f
3 changed files with 23 additions and 1 deletions

View file

@ -1668,7 +1668,7 @@ impl Document {
deferred_scripts: DOMRefCell::new(vec![]),
asap_in_order_scripts_list: DOMRefCell::new(vec![]),
asap_scripts_set: DOMRefCell::new(vec![]),
scripting_enabled: Cell::new(true),
scripting_enabled: Cell::new(browsing_context.is_some()),
animation_frame_ident: Cell::new(0),
animation_frame_list: DOMRefCell::new(BTreeMap::new()),
loader: DOMRefCell::new(doc_loader),