diff --git a/components/script/dom/webglvertexarrayobjectoes.rs b/components/script/dom/webglvertexarrayobjectoes.rs index c717108b2aa..ca13b2833f5 100644 --- a/components/script/dom/webglvertexarrayobjectoes.rs +++ b/components/script/dom/webglvertexarrayobjectoes.rs @@ -124,8 +124,15 @@ impl WebGLVertexArrayObjectOES { } let context = self.upcast::().context(); - let buffer = context.array_buffer().ok_or(WebGLError::InvalidOperation)?; - buffer.increment_attached_counter(); + let buffer = context.array_buffer(); + match buffer { + Some(ref buffer) => buffer.increment_attached_counter(), + None if offset != 0 => { + // https://github.com/KhronosGroup/WebGL/pull/2228 + return Err(WebGLError::InvalidOperation) + }, + _ => {}, + } context.send_command(WebGLCommand::VertexAttribPointer( index, size, @@ -146,7 +153,7 @@ impl WebGLVertexArrayObjectOES { normalized, stride: stride as u8, offset: offset as u32, - buffer: Some(Dom::from_ref(&*buffer)), + buffer: buffer.map(|b| Dom::from_ref(&*b)), divisor: data.divisor, }; diff --git a/tests/wpt/webgl/meta/conformance/attribs/gl-vertexattribpointer.html.ini b/tests/wpt/webgl/meta/conformance/attribs/gl-vertexattribpointer.html.ini deleted file mode 100644 index 3a5cca32db1..00000000000 --- a/tests/wpt/webgl/meta/conformance/attribs/gl-vertexattribpointer.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[gl-vertexattribpointer.html] - [WebGL test #3: getError expected: NO_ERROR. Was INVALID_OPERATION : vertexAttribPointer should succeed if no buffer is bound and `offset` is zero.] - expected: FAIL - diff --git a/tests/wpt/webgl/meta/conformance/more/functions/vertexAttribPointerBadArgs.html.ini b/tests/wpt/webgl/meta/conformance/more/functions/vertexAttribPointerBadArgs.html.ini deleted file mode 100644 index bdc03ee11ea..00000000000 --- a/tests/wpt/webgl/meta/conformance/more/functions/vertexAttribPointerBadArgs.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[vertexAttribPointerBadArgs.html] - [WebGL test #0: testVertexAttribPointerVBO] - expected: FAIL -