diff options
author | Mátyás Mustoha <matyas.mustoha@h-lab.eu> | 2020-01-17 11:52:01 +0100 |
---|---|---|
committer | Mátyás Mustoha <matyas.mustoha@h-lab.eu> | 2020-01-17 12:10:13 +0100 |
commit | 01ca317235eb2b6b1d55b67df9ea60a59f61bcf0 (patch) | |
tree | 124aa3d1c5a72a7bd5e864fbf8589be0aec4b145 | |
parent | 0650fc319905ecd018ee0f6e059f9f40589e10b6 (diff) | |
download | servo-01ca317235eb2b6b1d55b67df9ea60a59f61bcf0.tar.gz servo-01ca317235eb2b6b1d55b67df9ea60a59f61bcf0.zip |
Add WebGL2 specific version strings
Updated the `VERSION` and `SHADING_LANGUAGE_VERSION` WebGL parameters
to report the correct version strings when WebGL2 is in use.
See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
-rw-r--r-- | components/script/dom/webgl2renderingcontext.rs | 10 | ||||
-rw-r--r-- | tests/wpt/webgl/meta/conformance2/state/gl-getstring.html.ini | 7 |
2 files changed, 10 insertions, 7 deletions
diff --git a/components/script/dom/webgl2renderingcontext.rs b/components/script/dom/webgl2renderingcontext.rs index 3fadd2b8743..d3279955576 100644 --- a/components/script/dom/webgl2renderingcontext.rs +++ b/components/script/dom/webgl2renderingcontext.rs @@ -441,6 +441,16 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 fn GetParameter(&self, cx: JSContext, parameter: u32) -> JSVal { match parameter { + constants::VERSION => unsafe { + rooted!(in(*cx) let mut rval = UndefinedValue()); + "WebGL 2.0".to_jsval(*cx, rval.handle_mut()); + return rval.get(); + }, + constants::SHADING_LANGUAGE_VERSION => unsafe { + rooted!(in(*cx) let mut rval = UndefinedValue()); + "WebGL GLSL ES 3.00".to_jsval(*cx, rval.handle_mut()); + return rval.get(); + }, constants::MAX_CLIENT_WAIT_TIMEOUT_WEBGL => { return Int32Value( self.base.limits().max_client_wait_timeout_webgl.as_nanos() as i32 diff --git a/tests/wpt/webgl/meta/conformance2/state/gl-getstring.html.ini b/tests/wpt/webgl/meta/conformance2/state/gl-getstring.html.ini deleted file mode 100644 index db22ffdd831..00000000000 --- a/tests/wpt/webgl/meta/conformance2/state/gl-getstring.html.ini +++ /dev/null @@ -1,7 +0,0 @@ -[gl-getstring.html] - [WebGL test #1: getParameter(gl.VERSION) did not start with WebGL 2.0] - expected: FAIL - - [WebGL test #2: getParameter(gl.SHADING_LANGUAGE_VERSION) did not start with WebGL GLSL ES 3.00] - expected: FAIL - |