diff options
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r-- | components/script/dom/webglrenderingcontext.rs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 4855bcc36de..c0a00adf102 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -189,19 +189,22 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { receiver.recv().unwrap() } + #[allow(unsafe_code)] // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 fn GetParameter(&self, cx: *mut JSContext, parameter: u32) -> JSVal { // TODO(ecoal95): Implement the missing parameters from the spec - let mut rval = RootedValue::new(cx, UndefinedValue()); - match parameter { - constants::VERSION => - "WebGL 1.0".to_jsval(cx, rval.handle_mut()), - constants::RENDERER | - constants::VENDOR => - "Mozilla/Servo".to_jsval(cx, rval.handle_mut()), - _ => rval.ptr = NullValue(), - } - rval.ptr + unsafe { + let mut rval = RootedValue::new(cx, UndefinedValue()); + match parameter { + constants::VERSION => + "WebGL 1.0".to_jsval(cx, rval.handle_mut()), + constants::RENDERER | + constants::VENDOR => + "Mozilla/Servo".to_jsval(cx, rval.handle_mut()), + _ => rval.ptr = NullValue(), + } + rval.ptr + } } // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 |