diff options
Diffstat (limited to 'components/script/dom/htmlcanvaselement.rs')
-rw-r--r-- | components/script/dom/htmlcanvaselement.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index 6376e9d9a64..addef4dc666 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -28,6 +28,7 @@ use crate::dom::webgl2renderingcontext::WebGL2RenderingContext; use crate::dom::webglrenderingcontext::{ LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext, }; +use crate::script_runtime::JSContext as SafeJSContext; use base64; use canvas_traits::canvas::{CanvasId, CanvasMsg, FromScriptMsg}; use canvas_traits::webgl::{GLContextAttributes, WebGLVersion}; @@ -263,7 +264,7 @@ impl HTMLCanvasElement { cx: *mut JSContext, options: HandleValue, ) -> Option<GLContextAttributes> { - match WebGLContextAttributes::new(cx, options) { + match WebGLContextAttributes::new(SafeJSContext::from_ptr(cx), options) { Ok(ConversionResult::Success(ref attrs)) => Some(From::from(attrs)), Ok(ConversionResult::Failure(ref error)) => { throw_type_error(cx, &error); |