Skip to content

Commit

Permalink
servo: Merge #6516 - Add JSAutoRequest/JSAutoCompartment to HTMLIFram…
Browse files Browse the repository at this point in the history
…eElement (from michaelwu:fix-mozbrowser); r=glennw

Fixes servo/servo#6515

Source-Repo: https://github.com/servo/servo
Source-Revision: 836463b9e03f441aaf213ff48c99d50d8c1be5a5
  • Loading branch information
michaelwu committed Jun 29, 2015
1 parent 8d20462 commit 8b9a76f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion servo/components/script/dom/htmliframeelement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use dom::bindings::error::{ErrorResult, Fallible};
use dom::bindings::error::Error::NotSupported;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{Root};
use dom::bindings::utils::Reflectable;
use dom::customevent::CustomEvent;
use dom::document::Document;
use dom::element::{self, AttributeHandlers};
Expand All @@ -39,7 +40,7 @@ use std::borrow::ToOwned;
use std::cell::Cell;
use url::{Url, UrlParser};
use util::str::{self, LengthOrPercentageOrAuto};
use js::jsapi::RootedValue;
use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment};
use js::jsval::UndefinedValue;

enum SandboxAllowance {
Expand Down Expand Up @@ -155,6 +156,8 @@ impl<'a> HTMLIFrameElementHelpers for &'a HTMLIFrameElement {
if self.Mozbrowser() {
let window = window_from_node(self);
let cx = window.r().get_cx();
let _ar = JSAutoRequest::new(cx);
let _ac = JSAutoCompartment::new(cx, window.reflector().get_jsobject().get());
let mut detail = RootedValue::new(cx, UndefinedValue());
event.detail().to_jsval(cx, detail.handle_mut());
let custom_event = CustomEvent::new(GlobalRef::Window(window.r()),
Expand Down

0 comments on commit 8b9a76f

Please sign in to comment.