Skip to content

Commit

Permalink
Auto merge of #6516 - michaelwu:fix-mozbrowser, r=glennw
Browse files Browse the repository at this point in the history
Add JSAutoRequest/JSAutoCompartment to HTMLIFrameElement

Fixes #6515

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6516)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Jun 29, 2015
2 parents 420cf4c + 728ecc7 commit 836463b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/script/dom/htmliframeelement.rs
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 836463b

Please sign in to comment.