aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2018-04-05 17:39:53 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2018-04-06 11:22:27 +0200
commit183cc4c03505277a4dd2c95d2a1446cb56e14e7e (patch)
treec48242a84637935763380493fb094e76099dc28b /components/script/dom
parent044f19d91433c706857a9ddd958425225c3a683e (diff)
downloadservo-183cc4c03505277a4dd2c95d2a1446cb56e14e7e.tar.gz
servo-183cc4c03505277a4dd2c95d2a1446cb56e14e7e.zip
Properly check for invalid targets in gl.BindFramebuffer
It should always emit InvalidEnum, not InvalidOperation.
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/webglrenderingcontext.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index 1fbc49fcb03..a425be8c873 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -11,7 +11,6 @@ use canvas_traits::webgl::DOMToTextureCommand;
use canvas_traits::webgl::WebGLError::*;
use canvas_traits::webgl::webgl_channel;
use dom::bindings::cell::DomRefCell;
-use dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextConstants as WebGL2Constants;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes};
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods;
@@ -1576,12 +1575,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6
fn BindFramebuffer(&self, target: u32, framebuffer: Option<&WebGLFramebuffer>) {
- if target == WebGL2Constants::READ_FRAMEBUFFER {
- return self.webgl_error(InvalidEnum);
- }
-
if target != constants::FRAMEBUFFER {
- return self.webgl_error(InvalidOperation);
+ return self.webgl_error(InvalidEnum);
}
if let Some(framebuffer) = framebuffer {