diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2018-08-25 14:07:59 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2018-08-30 16:15:38 +0200 |
commit | 0ba66f9f12df890341e4aa6b8284e961846dc348 (patch) | |
tree | 6acc4c294bb91599e53750d9dd86f3ef336a16ec /components/script/dom/webglrenderingcontext.rs | |
parent | 273aac87e4057d0eeadf6f4e5944b5127dba975c (diff) | |
download | servo-0ba66f9f12df890341e4aa6b8284e961846dc348.tar.gz servo-0ba66f9f12df890341e4aa6b8284e961846dc348.zip |
Fix the error for invalid arrays passed to gl.vertexAttrib*v()
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r-- | components/script/dom/webglrenderingcontext.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 4aa6c047a1b..bb1cace295e 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -3643,7 +3643,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v, }; if values.len() < 1 { - return self.webgl_error(InvalidOperation); + // https://github.com/KhronosGroup/WebGL/issues/2700 + return self.webgl_error(InvalidValue); } self.vertex_attrib(indx, values[0], 0f32, 0f32, 1f32); } @@ -3660,7 +3661,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v, }; if values.len() < 2 { - return self.webgl_error(InvalidOperation); + // https://github.com/KhronosGroup/WebGL/issues/2700 + return self.webgl_error(InvalidValue); } self.vertex_attrib(indx, values[0], values[1], 0f32, 1f32); } @@ -3677,7 +3679,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v, }; if values.len() < 3 { - return self.webgl_error(InvalidOperation); + // https://github.com/KhronosGroup/WebGL/issues/2700 + return self.webgl_error(InvalidValue); } self.vertex_attrib(indx, values[0], values[1], values[2], 1f32); } @@ -3694,7 +3697,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v, }; if values.len() < 4 { - return self.webgl_error(InvalidOperation); + // https://github.com/KhronosGroup/WebGL/issues/2700 + return self.webgl_error(InvalidValue); } self.vertex_attrib(indx, values[0], values[1], values[2], values[3]); } |