diff options
author | Anthony Ramine <nox@nox.paris> | 2020-03-02 11:16:46 +0100 |
---|---|---|
committer | Anthony Ramine <nox@nox.paris> | 2020-03-06 11:13:28 +0100 |
commit | 5a4f8cf93f9f674a164a0a3cfc586accef3d06f9 (patch) | |
tree | c50ce5a7663486939177dbd928acdd985aa0197c /components/script/webdriver_handlers.rs | |
parent | 813be919269f632ba23746e4700e8a18bdd4ae07 (diff) | |
download | servo-5a4f8cf93f9f674a164a0a3cfc586accef3d06f9.tar.gz servo-5a4f8cf93f9f674a164a0a3cfc586accef3d06f9.zip |
Update SpiderMonkey
Diffstat (limited to 'components/script/webdriver_handlers.rs')
-rw-r--r-- | components/script/webdriver_handlers.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs index f177f8e4c30..1e094ec086c 100644 --- a/components/script/webdriver_handlers.rs +++ b/components/script/webdriver_handlers.rs @@ -37,6 +37,7 @@ use crate::dom::node::{window_from_node, Node, ShadowIncluding}; use crate::dom::nodelist::NodeList; use crate::dom::window::Window; use crate::dom::xmlserializer::XMLSerializer; +use crate::realms::enter_realm; use crate::script_runtime::JSContext as SafeJSContext; use crate::script_thread::{Documents, ScriptThread}; use cookie::Cookie; @@ -160,6 +161,7 @@ pub unsafe fn jsval_to_webdriver( global_scope: &GlobalScope, val: HandleValue, ) -> WebDriverJSResult { + let _ac = enter_realm(global_scope); if val.get().is_undefined() { Ok(WebDriverJSValue::Undefined) } else if val.get().is_null() { @@ -996,7 +998,9 @@ pub fn handle_get_property( reply .send( find_node_by_unique_id(documents, pipeline, node_id).and_then(|node| { - let cx = documents.find_document(pipeline).unwrap().window().get_cx(); + let document = documents.find_document(pipeline).unwrap(); + let _ac = enter_realm(&*document); + let cx = document.window().get_cx(); rooted!(in(*cx) let mut property = UndefinedValue()); match unsafe { |