mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Add JSAutoRequest/JSAutoCompartment to HTMLIFrameElement
This commit is contained in:
parent
420cf4c8dc
commit
728ecc72b6
1 changed files with 4 additions and 1 deletions
|
@ -14,6 +14,7 @@ use dom::bindings::error::{ErrorResult, Fallible};
|
||||||
use dom::bindings::error::Error::NotSupported;
|
use dom::bindings::error::Error::NotSupported;
|
||||||
use dom::bindings::global::GlobalRef;
|
use dom::bindings::global::GlobalRef;
|
||||||
use dom::bindings::js::{Root};
|
use dom::bindings::js::{Root};
|
||||||
|
use dom::bindings::utils::Reflectable;
|
||||||
use dom::customevent::CustomEvent;
|
use dom::customevent::CustomEvent;
|
||||||
use dom::document::Document;
|
use dom::document::Document;
|
||||||
use dom::element::{self, AttributeHandlers};
|
use dom::element::{self, AttributeHandlers};
|
||||||
|
@ -39,7 +40,7 @@ use std::borrow::ToOwned;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use url::{Url, UrlParser};
|
use url::{Url, UrlParser};
|
||||||
use util::str::{self, LengthOrPercentageOrAuto};
|
use util::str::{self, LengthOrPercentageOrAuto};
|
||||||
use js::jsapi::RootedValue;
|
use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment};
|
||||||
use js::jsval::UndefinedValue;
|
use js::jsval::UndefinedValue;
|
||||||
|
|
||||||
enum SandboxAllowance {
|
enum SandboxAllowance {
|
||||||
|
@ -155,6 +156,8 @@ impl<'a> HTMLIFrameElementHelpers for &'a HTMLIFrameElement {
|
||||||
if self.Mozbrowser() {
|
if self.Mozbrowser() {
|
||||||
let window = window_from_node(self);
|
let window = window_from_node(self);
|
||||||
let cx = window.r().get_cx();
|
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());
|
let mut detail = RootedValue::new(cx, UndefinedValue());
|
||||||
event.detail().to_jsval(cx, detail.handle_mut());
|
event.detail().to_jsval(cx, detail.handle_mut());
|
||||||
let custom_event = CustomEvent::new(GlobalRef::Window(window.r()),
|
let custom_event = CustomEvent::new(GlobalRef::Window(window.r()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue