aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-03-22 15:32:45 -0400
committerGitHub <noreply@github.com>2018-03-22 15:32:45 -0400
commitc20d0c00d711cda61ad1b35f15f2fb563c042c5e (patch)
treed29d71631dc1301c6310234d9f1d4254b68054e1
parent563f0ec8245d6ff4d7d200c30655f90f5bdfed64 (diff)
parentc033b48def0d8d961fe76596597d3e98a528010a (diff)
downloadservo-c20d0c00d711cda61ad1b35f15f2fb563c042c5e.tar.gz
servo-c20d0c00d711cda61ad1b35f15f2fb563c042c5e.zip
Auto merge of #20375 - servo:webgl, r=emilio
Fall down the WebGL rabbit hole and fix some bugs there <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20375) <!-- Reviewable:end -->
-rw-r--r--Cargo.lock32
-rw-r--r--components/canvas/webgl_thread.rs11
-rw-r--r--components/canvas_traits/webgl.rs6
-rw-r--r--components/script/dom/webgl2renderingcontext.rs67
-rw-r--r--components/script/dom/webglrenderingcontext.rs254
-rw-r--r--components/script/dom/webidls/WebGLRenderingContext.webidl30
-rw-r--r--tests/wpt/metadata/css/css-regions/elements/canvas3d-001.html.ini3
-rw-r--r--tests/wpt/metadata/css/css-regions/elements/canvas3d-002.html.ini3
-rw-r--r--tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/buffers/element-array-buffer-delete-recreate.html.ini8
-rw-r--r--tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-hd-dpi-test.html.ini42
-rw-r--r--tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/more/functions/drawArraysOutOfBounds.html.ini5
-rw-r--r--tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/rendering/draw-arrays-out-of-bounds.html.ini4
-rw-r--r--tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/state/gl-get-calls.html.ini88
-rw-r--r--tests/wpt/mozilla/meta/webgl/conformance-2.0.0/conformance2/transform_feedback/unwritten-output-defaults-to-zero.html.ini4
14 files changed, 281 insertions, 276 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 3bd64a6ef46..f91a8e8a14f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -269,7 +269,7 @@ dependencies = [
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "gleam 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -328,7 +328,7 @@ name = "cgl"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "gleam 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -416,7 +416,7 @@ version = "0.0.1"
dependencies = [
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1",
- "gleam 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1076,7 +1076,7 @@ dependencies = [
[[package]]
name = "gleam"
-version = "0.4.24"
+version = "0.4.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1289,7 +1289,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "gleam 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)",
"leaky-cow 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1553,7 +1553,7 @@ dependencies = [
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
"gfx 0.0.1",
- "gleam 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"layout_thread 0.0.1",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1630,7 +1630,7 @@ dependencies = [
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hashglobe 0.1.0",
- "mozjs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mozjs 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.19.0",
"servo_arc 0.1.1",
"smallbitvec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1807,7 +1807,7 @@ dependencies = [
[[package]]
name = "mozjs"
-version = "0.3.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2035,7 +2035,7 @@ dependencies = [
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "gleam 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2475,7 +2475,7 @@ dependencies = [
"encoding_rs 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "gleam 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)",
"half 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2493,7 +2493,7 @@ dependencies = [
"mime_guess 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mitochondria 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"mozangle 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "mozjs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mozjs 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2693,7 +2693,7 @@ dependencies = [
"compositing 0.0.1",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "gleam 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libservo 0.0.1",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2760,7 +2760,7 @@ dependencies = [
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "gleam 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glx 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3522,7 +3522,7 @@ dependencies = [
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"freetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "gleam 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3836,7 +3836,7 @@ dependencies = [
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
"checksum gif 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8a80d6fe9e52f637df9afd4779449a7be17c39cc9c35b01589bb833f956ba596"
"checksum gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a"
-"checksum gleam 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "8d9997e65a2cfec0f3290a8378652e3aacdb3f19d29a7ca20c11e11ca550eec9"
+"checksum gleam 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)" = "0afb2d0a8283b336c9569b1dead35415f550dcf1d4f3b970b507f7373d0be626"
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
"checksum glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90de8e0391e57098acfbfe693b23065e9186255d370ebae12c933b7d77df8424"
"checksum glx 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "63a6e7c2846e12626455f45ebaff9d92161436dd0fa703d9d198012e528ca7b9"
@@ -3893,7 +3893,7 @@ dependencies = [
"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
"checksum mitochondria 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9de3eca27871df31c33b807f834b94ef7d000956f57aa25c5aed9c5f0aae8f6f"
"checksum mozangle 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1f0583e6792917f498bb3a7440f777a59353102063445ab7f5e9d1dc4ed593aa"
-"checksum mozjs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "53720714c395cbc3b8f31411ca855a97c51618c76fa5584654a0e3e2ecfc16cc"
+"checksum mozjs 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "896b93aaf26a4cbdcd878b6a9e3b4b90ac018dccebaaac1fe67d2d0724f6a711"
"checksum mozjs_sys 0.50.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e61a792a125b1364c5ec50255ed8343ce02dc56098f8868dd209d472c8de006a"
"checksum mp3-metadata 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ab5f1d2693586420208d1200ce5a51cd44726f055b635176188137aff42c7de"
"checksum mp4parse 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f821e3799bc0fd16d9b861fb02fa7ee1b5fba29f45ad591dade105c48ca9a1a0"
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs
index 785df7fd6c2..529d697d17e 100644
--- a/components/canvas/webgl_thread.rs
+++ b/components/canvas/webgl_thread.rs
@@ -860,8 +860,12 @@ impl WebGLImpl {
ctx.gl().vertex_attrib_pointer_f32(attrib_id, size, normalized, stride, offset),
WebGLCommand::VertexAttribPointer(attrib_id, size, data_type, normalized, stride, offset) =>
ctx.gl().vertex_attrib_pointer(attrib_id, size, data_type, normalized, stride, offset),
- WebGLCommand::Viewport(x, y, width, height) =>
- ctx.gl().viewport(x, y, width, height),
+ WebGLCommand::GetViewport(sender) => {
+ sender.send(ctx.gl().get_viewport()).unwrap();
+ }
+ WebGLCommand::SetViewport(x, y, width, height) => {
+ ctx.gl().viewport(x, y, width, height);
+ }
WebGLCommand::TexImage2D(target, level, internal, width, height, format, data_type, data) =>
ctx.gl().tex_image_2d(target, level, internal, width, height,
/*border*/0, format, data_type, Some(&data)),
@@ -1055,8 +1059,7 @@ impl WebGLImpl {
// Int32Array
gl::MAX_VIEWPORT_DIMS |
- gl::SCISSOR_BOX |
- gl::VIEWPORT => Err(WebGLError::InvalidEnum),
+ gl::SCISSOR_BOX => Err(WebGLError::InvalidEnum),
// Invalid parameters
_ => Err(WebGLError::InvalidEnum)
diff --git a/components/canvas_traits/webgl.rs b/components/canvas_traits/webgl.rs
index 540e48fb652..208a728f293 100644
--- a/components/canvas_traits/webgl.rs
+++ b/components/canvas_traits/webgl.rs
@@ -260,7 +260,8 @@ pub enum WebGLCommand {
VertexAttrib(u32, f32, f32, f32, f32),
VertexAttribPointer(u32, i32, u32, bool, i32, u32),
VertexAttribPointer2f(u32, i32, bool, i32, u32),
- Viewport(i32, i32, i32, i32),
+ GetViewport(WebGLSender<(i32, i32, i32, i32)>),
+ SetViewport(i32, i32, i32, i32),
TexImage2D(u32, i32, i32, i32, i32, u32, u32, Vec<u8>),
TexParameteri(u32, u32, i32),
TexParameterf(u32, u32, f32),
@@ -532,7 +533,8 @@ impl fmt::Debug for WebGLCommand {
VertexAttrib(..) => "VertexAttrib",
VertexAttribPointer2f(..) => "VertexAttribPointer2f",
VertexAttribPointer(..) => "VertexAttribPointer",
- Viewport(..) => "Viewport",
+ GetViewport(..) => "GetViewport",
+ SetViewport(..) => "SetViewport",
TexImage2D(..) => "TexImage2D",
TexParameteri(..) => "TexParameteri",
TexParameterf(..) => "TexParameterf",
diff --git a/components/script/dom/webgl2renderingcontext.rs b/components/script/dom/webgl2renderingcontext.rs
index 2d1186c0dcc..21d917d4992 100644
--- a/components/script/dom/webgl2renderingcontext.rs
+++ b/components/script/dom/webgl2renderingcontext.rs
@@ -9,7 +9,7 @@ use dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2Rende
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLContextAttributes;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods;
use dom::bindings::codegen::UnionTypes::ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement;
-use dom::bindings::error::Fallible;
+use dom::bindings::error::{ErrorResult, Fallible};
use dom::bindings::reflector::{reflect_dom_object, Reflector};
use dom::bindings::root::{Dom, DomRoot, LayoutDom};
use dom::bindings::str::DOMString;
@@ -329,7 +329,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn CompileShader(&self, shader: Option<&WebGLShader>) {
+ fn CompileShader(&self, shader: &WebGLShader) {
self.base.CompileShader(shader)
}
@@ -414,39 +414,39 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn GetActiveUniform(&self, program: Option<&WebGLProgram>, index: u32) -> Option<DomRoot<WebGLActiveInfo>> {
+ fn GetActiveUniform(&self, program: &WebGLProgram, index: u32) -> Option<DomRoot<WebGLActiveInfo>> {
self.base.GetActiveUniform(program, index)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn GetActiveAttrib(&self, program: Option<&WebGLProgram>, index: u32) -> Option<DomRoot<WebGLActiveInfo>> {
+ fn GetActiveAttrib(&self, program: &WebGLProgram, index: u32) -> Option<DomRoot<WebGLActiveInfo>> {
self.base.GetActiveAttrib(program, index)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn GetAttribLocation(&self, program: Option<&WebGLProgram>, name: DOMString) -> i32 {
+ fn GetAttribLocation(&self, program: &WebGLProgram, name: DOMString) -> i32 {
self.base.GetAttribLocation(program, name)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn GetProgramInfoLog(&self, program: Option<&WebGLProgram>) -> Option<DOMString> {
+ fn GetProgramInfoLog(&self, program: &WebGLProgram) -> Option<DOMString> {
self.base.GetProgramInfoLog(program)
}
#[allow(unsafe_code)]
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- unsafe fn GetProgramParameter(&self, cx: *mut JSContext, program: Option<&WebGLProgram>, param_id: u32) -> JSVal {
+ unsafe fn GetProgramParameter(&self, cx: *mut JSContext, program: &WebGLProgram, param_id: u32) -> JSVal {
self.base.GetProgramParameter(cx, program, param_id)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn GetShaderInfoLog(&self, shader: Option<&WebGLShader>) -> Option<DOMString> {
+ fn GetShaderInfoLog(&self, shader: &WebGLShader) -> Option<DOMString> {
self.base.GetShaderInfoLog(shader)
}
#[allow(unsafe_code)]
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- unsafe fn GetShaderParameter(&self, cx: *mut JSContext, shader: Option<&WebGLShader>, param_id: u32) -> JSVal {
+ unsafe fn GetShaderParameter(&self, cx: *mut JSContext, shader: &WebGLShader, param_id: u32) -> JSVal {
self.base.GetShaderParameter(cx, shader, param_id)
}
@@ -459,9 +459,11 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn GetUniformLocation(&self,
- program: Option<&WebGLProgram>,
- name: DOMString) -> Option<DomRoot<WebGLUniformLocation>> {
+ fn GetUniformLocation(
+ &self,
+ program: &WebGLProgram,
+ name: DOMString,
+ ) -> Option<DomRoot<WebGLUniformLocation>> {
self.base.GetUniformLocation(program, name)
}
@@ -585,12 +587,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn ShaderSource(&self, shader: Option<&WebGLShader>, source: DOMString) {
+ fn ShaderSource(&self, shader: &WebGLShader, source: DOMString) {
self.base.ShaderSource(shader, source)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn GetShaderSource(&self, shader: Option<&WebGLShader>) -> Option<DOMString> {
+ fn GetShaderSource(&self, shader: &WebGLShader) -> Option<DOMString> {
self.base.GetShaderSource(shader)
}
@@ -759,7 +761,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn ValidateProgram(&self, program: Option<&WebGLProgram>) {
+ fn ValidateProgram(&self, program: &WebGLProgram) {
self.base.ValidateProgram(program)
}
@@ -835,13 +837,15 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
- fn TexImage2D_(&self,
- target: u32,
- level: i32,
- internal_format: u32,
- format: u32,
- data_type: u32,
- source: Option<ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement>) -> Fallible<()> {
+ fn TexImage2D_(
+ &self,
+ target: u32,
+ level: i32,
+ internal_format: u32,
+ format: u32,
+ data_type: u32,
+ source: ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement,
+ ) -> ErrorResult {
self.base.TexImage2D_(target, level, internal_format, format, data_type, source)
}
@@ -875,15 +879,16 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
- fn TexSubImage2D_(&self,
- target: u32,
- level: i32,
- xoffset: i32,
- yoffset: i32,
- format: u32,
- data_type: u32,
- source: Option<ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement>)
- -> Fallible<()> {
+ fn TexSubImage2D_(
+ &self,
+ target: u32,
+ level: i32,
+ xoffset: i32,
+ yoffset: i32,
+ format: u32,
+ data_type: u32,
+ source: ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement,
+ ) -> ErrorResult {
self.base.TexSubImage2D_(target, level, xoffset, yoffset, format, data_type, source)
}
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index ad572751607..30c60feea35 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -16,7 +16,7 @@ use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderi
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods;
use dom::bindings::codegen::UnionTypes::ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement;
use dom::bindings::conversions::{ConversionResult, FromJSValConvertible, ToJSValConvertible};
-use dom::bindings::error::{Error, Fallible};
+use dom::bindings::error::{Error, ErrorResult, Fallible};
use dom::bindings::inheritance::Castable;
use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
use dom::bindings::root::{Dom, DomRoot, LayoutDom, MutNullableDom};
@@ -471,7 +471,7 @@ impl WebGLRenderingContext {
}
fn vertex_attrib(&self, indx: u32, x: f32, y: f32, z: f32, w: f32) {
- if indx > self.limits.max_vertex_attribs {
+ if indx >= self.limits.max_vertex_attribs {
return self.webgl_error(InvalidValue);
}
@@ -763,14 +763,10 @@ impl WebGLRenderingContext {
}
}
- fn get_image_pixels(&self,
- source: Option<ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement>)
- -> ImagePixelResult {
- let source = match source {
- Some(s) => s,
- None => return Err(()),
- };
-
+ fn get_image_pixels(
+ &self,
+ source: ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement,
+ ) -> ImagePixelResult {
// NOTE: Getting the pixels probably can be short-circuited if some
// parameter is invalid.
//
@@ -1273,6 +1269,9 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
match parameter {
constants::ARRAY_BUFFER_BINDING =>
return object_binding_to_js_or_null!(cx, &self.bound_buffer_array),
+ constants::CURRENT_PROGRAM => {
+ return object_binding_to_js_or_null!(cx, &self.current_program);
+ }
constants::ELEMENT_ARRAY_BUFFER_BINDING =>
return object_binding_to_js_or_null!(cx, &self.bound_buffer_element_array),
constants::FRAMEBUFFER_BINDING =>
@@ -1306,6 +1305,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
return Int32Value(constants::UNSIGNED_BYTE as i32);
}
}
+ constants::VIEWPORT => {
+ let (sender, receiver) = webgl_channel().unwrap();
+ self.send_command(WebGLCommand::GetViewport(sender));
+ let (x, y, width, height) = receiver.recv().unwrap();
+ rooted!(in(cx) let mut rval = UndefinedValue());
+ [x, y, width, height].to_jsval(cx, rval.handle_mut());
+ return rval.get();
+ }
_ => {
if !self.extension_manager.is_get_parameter_name_enabled(parameter) {
self.webgl_error(WebGLError::InvalidEnum);
@@ -1965,10 +1972,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn CompileShader(&self, shader: Option<&WebGLShader>) {
- if let Some(shader) = shader {
- shader.compile(self.webgl_version, self.glsl_version, &self.extension_manager)
- }
+ fn CompileShader(&self, shader: &WebGLShader) {
+ shader.compile(self.webgl_version, self.glsl_version, &self.extension_manager)
}
// TODO(emilio): Probably in the future we should keep track of the
@@ -2137,24 +2142,28 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
constants::POINTS | constants::LINE_STRIP |
constants::LINE_LOOP | constants::LINES |
constants::TRIANGLE_STRIP | constants::TRIANGLE_FAN |
- constants::TRIANGLES => {
- if self.current_program.get().is_none() {
- return self.webgl_error(InvalidOperation);
- }
-
- if first < 0 || count < 0 {
- return self.webgl_error(InvalidValue);
- }
-
- if !self.validate_framebuffer_complete() {
- return;
- }
-
- self.send_command(WebGLCommand::DrawArrays(mode, first, count));
- self.mark_as_dirty();
- },
- _ => self.webgl_error(InvalidEnum),
+ constants::TRIANGLES => {},
+ _ => {
+ return self.webgl_error(InvalidEnum);
+ }
}
+ if first < 0 || count < 0 {
+ return self.webgl_error(InvalidValue);
+ }
+ if self.current_program.get().is_none() {
+ return self.webgl_error(InvalidOperation);
+ }
+ if let Some(array_buffer) = self.bound_buffer_array.get() {
+ if count > 0 && (first as u64 + count as u64 > array_buffer.capacity() as u64) {
+ return self.webgl_error(InvalidOperation);
+ }
+ }
+ if !self.validate_framebuffer_complete() {
+ return;
+ }
+
+ self.send_command(WebGLCommand::DrawArrays(mode, first, count));
+ self.mark_as_dirty();
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.11
@@ -2223,7 +2232,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn EnableVertexAttribArray(&self, attrib_id: u32) {
- if attrib_id > self.limits.max_vertex_attribs {
+ if attrib_id >= self.limits.max_vertex_attribs {
return self.webgl_error(InvalidValue);
}
@@ -2232,7 +2241,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn DisableVertexAttribArray(&self, attrib_id: u32) {
- if attrib_id > self.limits.max_vertex_attribs {
+ if attrib_id >= self.limits.max_vertex_attribs {
return self.webgl_error(InvalidValue);
}
@@ -2240,23 +2249,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn GetActiveUniform(&self, program: Option<&WebGLProgram>, index: u32) -> Option<DomRoot<WebGLActiveInfo>> {
- let program = match program {
- Some(program) => program,
- None => {
- // Reasons to generate InvalidValue error
- // From the GLES 2.0 spec
- //
- // "INVALID_VALUE is generated if index is greater than or equal
- // to the number of active uniform variables in program"
- //
- // A null program has no uniforms so any index is always greater than the active uniforms
- // WebGl conformance expects error with null programs. Check tests in get-active-test.html
- self.webgl_error(InvalidValue);
- return None;
- }
- };
-
+ fn GetActiveUniform(&self, program: &WebGLProgram, index: u32) -> Option<DomRoot<WebGLActiveInfo>> {
match program.get_active_uniform(index) {
Ok(ret) => Some(ret),
Err(e) => {
@@ -2267,23 +2260,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn GetActiveAttrib(&self, program: Option<&WebGLProgram>, index: u32) -> Option<DomRoot<WebGLActiveInfo>> {
- let program = match program {
- Some(program) => program,
- None => {
- // Reasons to generate InvalidValue error
- // From the GLES 2.0 spec
- //
- // "INVALID_VALUE is generated if index is greater than or equal
- // to the number of active attribute variables in program"
- //
- // A null program has no attributes so any index is always greater than the active uniforms
- // WebGl conformance expects error with null programs. Check tests in get-active-test.html
- self.webgl_error(InvalidValue);
- return None;
- }
- };
-
+ fn GetActiveAttrib(&self, program: &WebGLProgram, index: u32) -> Option<DomRoot<WebGLActiveInfo>> {
match program.get_active_attrib(index) {
Ok(ret) => Some(ret),
Err(e) => {
@@ -2294,12 +2271,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn GetAttribLocation(&self, program: Option<&WebGLProgram>, name: DOMString) -> i32 {
- if let Some(program) = program {
- handle_potential_webgl_error!(self, program.get_attrib_location(name), None).unwrap_or(-1)
- } else {
- -1
- }
+ fn GetAttribLocation(&self, program: &WebGLProgram, name: DOMString) -> i32 {
+ handle_potential_webgl_error!(self, program.get_attrib_location(name), None).unwrap_or(-1)
}
#[allow(unsafe_code)]
@@ -2390,61 +2363,48 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn GetProgramInfoLog(&self, program: Option<&WebGLProgram>) -> Option<DOMString> {
- if let Some(program) = program {
- match program.get_info_log() {
- Ok(value) => Some(DOMString::from(value)),
- Err(e) => {
- self.webgl_error(e);
- None
- }
+ fn GetProgramInfoLog(&self, program: &WebGLProgram) -> Option<DOMString> {
+ match program.get_info_log() {
+ Ok(value) => Some(DOMString::from(value)),
+ Err(e) => {
+ self.webgl_error(e);
+ None
}
- } else {
- self.webgl_error(WebGLError::InvalidValue);
- None
}
}
#[allow(unsafe_code)]
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- unsafe fn GetProgramParameter(&self, _: *mut JSContext, program: Option<&WebGLProgram>, param_id: u32) -> JSVal {
- if let Some(program) = program {
- match handle_potential_webgl_error!(self, program.parameter(param_id), WebGLParameter::Invalid) {
- WebGLParameter::Int(val) => Int32Value(val),
- WebGLParameter::Bool(val) => BooleanValue(val),
- WebGLParameter::String(_) => panic!("Program parameter should not be string"),
- WebGLParameter::Float(_) => panic!("Program parameter should not be float"),
- WebGLParameter::FloatArray(_) => {
- panic!("Program paramenter should not be float array")
- }
- WebGLParameter::Invalid => NullValue(),
+ unsafe fn GetProgramParameter(&self, _: *mut JSContext, program: &WebGLProgram, param_id: u32) -> JSVal {
+ match handle_potential_webgl_error!(self, program.parameter(param_id), WebGLParameter::Invalid) {
+ WebGLParameter::Int(val) => Int32Value(val),
+ WebGLParameter::Bool(val) => BooleanValue(val),
+ WebGLParameter::String(_) => panic!("Program parameter should not be string"),
+ WebGLParameter::Float(_) => panic!("Program parameter should not be float"),
+ WebGLParameter::FloatArray(_) => {
+ panic!("Program paramenter should not be float array")
}
- } else {
- NullValue()
+ WebGLParameter::Invalid => NullValue(),
}
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn GetShaderInfoLog(&self, shader: Option<&WebGLShader>) -> Option<DOMString> {
- shader.and_then(|s| s.info_log()).map(DOMString::from)
+ fn GetShaderInfoLog(&self, shader: &WebGLShader) -> Option<DOMString> {
+ shader.info_log().map(DOMString::from)
}
#[allow(unsafe_code)]
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- unsafe fn GetShaderParameter(&self, _: *mut JSContext, shader: Option<&WebGLShader>, param_id: u32) -> JSVal {
- if let Some(shader) = shader {
- match handle_potential_webgl_error!(self, shader.parameter(param_id), WebGLParameter::Invalid) {
- WebGLParameter::Int(val) => Int32Value(val),
- WebGLParameter::Bool(val) => BooleanValue(val),
- WebGLParameter::String(_) => panic!("Shader parameter should not be string"),
- WebGLParameter::Float(_) => panic!("Shader parameter should not be float"),
- WebGLParameter::FloatArray(_) => {
- panic!("Shader paramenter should not be float array")
- }
- WebGLParameter::Invalid => NullValue(),
+ unsafe fn GetShaderParameter(&self, _: *mut JSContext, shader: &WebGLShader, param_id: u32) -> JSVal {
+ match handle_potential_webgl_error!(self, shader.parameter(param_id), WebGLParameter::Invalid) {
+ WebGLParameter::Int(val) => Int32Value(val),
+ WebGLParameter::Bool(val) => BooleanValue(val),
+ WebGLParameter::String(_) => panic!("Shader parameter should not be string"),
+ WebGLParameter::Float(_) => panic!("Shader parameter should not be float"),
+ WebGLParameter::FloatArray(_) => {
+ panic!("Shader paramenter should not be float array")
}
- } else {
- NullValue()
+ WebGLParameter::Invalid => NullValue(),
}
}
@@ -2477,12 +2437,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn GetUniformLocation(&self,
- program: Option<&WebGLProgram>,
- name: DOMString) -> Option<DomRoot<WebGLUniformLocation>> {
- program.and_then(|p| {
- handle_potential_webgl_error!(self, p.get_uniform_location(name), None)
- .map(|location| WebGLUniformLocation::new(self.global().as_window(), location, p.id()))
+ fn GetUniformLocation(
+ &self,
+ program: &WebGLProgram,
+ name: DOMString,
+ ) -> Option<DomRoot<WebGLUniformLocation>> {
+ handle_potential_webgl_error!(self, program.get_uniform_location(name), None).map(|location| {
+ WebGLUniformLocation::new(self.global().as_window(), location, program.id())
})
}
@@ -2859,15 +2820,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn ShaderSource(&self, shader: Option<&WebGLShader>, source: DOMString) {
- if let Some(shader) = shader {
- shader.set_source(source)
- }
+ fn ShaderSource(&self, shader: &WebGLShader, source: DOMString) {
+ shader.set_source(source)
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn GetShaderSource(&self, shader: Option<&WebGLShader>) -> Option<DOMString> {
- shader.and_then(|s| s.source())
+ fn GetShaderSource(&self, shader: &WebGLShader) -> Option<DOMString> {
+ shader.source()
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@@ -3158,11 +3117,9 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
- fn ValidateProgram(&self, program: Option<&WebGLProgram>) {
- if let Some(program) = program {
- if let Err(e) = program.validate() {
- self.webgl_error(e);
- }
+ fn ValidateProgram(&self, program: &WebGLProgram) {
+ if let Err(e) = program.validate() {
+ self.webgl_error(e);
}
}
@@ -3238,7 +3195,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn VertexAttribPointer(&self, attrib_id: u32, size: i32, data_type: u32,
normalized: bool, stride: i32, offset: i64) {
- if attrib_id > self.limits.max_vertex_attribs {
+ if attrib_id >= self.limits.max_vertex_attribs {
return self.webgl_error(InvalidValue);
}
@@ -3287,7 +3244,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
return self.webgl_error(InvalidValue)
}
- self.send_command(WebGLCommand::Viewport(x, y, width, height))
+ self.send_command(WebGLCommand::SetViewport(x, y, width, height))
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
@@ -3372,13 +3329,15 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
- fn TexImage2D_(&self,
- target: u32,
- level: i32,
- internal_format: u32,
- format: u32,
- data_type: u32,
- source: Option<ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement>) -> Fallible<()> {
+ fn TexImage2D_(
+ &self,
+ target: u32,
+ level: i32,
+ internal_format: u32,
+ format: u32,
+ data_type: u32,
+ source: ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement,
+ ) -> ErrorResult {
if !self.extension_manager.is_tex_type_enabled(data_type) {
return Ok(self.webgl_error(InvalidEnum));
}
@@ -3533,15 +3492,16 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
- fn TexSubImage2D_(&self,
- target: u32,
- level: i32,
- xoffset: i32,
- yoffset: i32,
- format: u32,
- data_type: u32,
- source: Option<ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement>)
- -> Fallible<()> {
+ fn TexSubImage2D_(
+ &self,
+ target: u32,
+ level: i32,
+ xoffset: i32,
+ yoffset: i32,
+ format: u32,
+ data_type: u32,
+ source: ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement,
+ ) -> ErrorResult {
let (pixels, size, premultiplied) = match self.get_image_pixels(source) {
Ok((pixels, size, premultiplied)) => (pixels, size, premultiplied),
Err(_) => return Ok(()),
diff --git a/components/script/dom/webidls/WebGLRenderingContext.webidl b/components/script/dom/webidls/WebGLRenderingContext.webidl
index 05e9212d974..6725b9f6933 100644
--- a/components/script/dom/webidls/WebGLRenderingContext.webidl
+++ b/components/script/dom/webidls/WebGLRenderingContext.webidl
@@ -510,7 +510,7 @@ interface WebGLRenderingContextBase
void clearDepth(GLclampf depth);
void clearStencil(GLint s);
void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
- void compileShader(WebGLShader? shader);
+ void compileShader(WebGLShader shader);
// FIXME(simartin) The Code generator doesn't handle ArrayBufferView so we're
// using 'object' in the meantime, and marking the function as Throws to
@@ -578,11 +578,11 @@ interface WebGLRenderingContextBase
void generateMipmap(GLenum target);
- WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, GLuint index);
- WebGLActiveInfo? getActiveUniform(WebGLProgram? program, GLuint index);
+ WebGLActiveInfo? getActiveAttrib(WebGLProgram program, GLuint index);
+ WebGLActiveInfo? getActiveUniform(WebGLProgram program, GLuint index);
//sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program);
- [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram? program, DOMString name);
+ [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram program, DOMString name);
any getBufferParameter(GLenum target, GLenum pname);
any getParameter(GLenum pname);
@@ -591,20 +591,20 @@ interface WebGLRenderingContextBase
any getFramebufferAttachmentParameter(GLenum target, GLenum attachment,
GLenum pname);
- any getProgramParameter(WebGLProgram? program, GLenum pname);
- DOMString? getProgramInfoLog(WebGLProgram? program);
+ any getProgramParameter(WebGLProgram program, GLenum pname);
+ DOMString? getProgramInfoLog(WebGLProgram program);
//any getRenderbufferParameter(GLenum target, GLenum pname);
- any getShaderParameter(WebGLShader? shader, GLenum pname);
+ any getShaderParameter(WebGLShader shader, GLenum pname);
WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
- DOMString? getShaderInfoLog(WebGLShader? shader);
+ DOMString? getShaderInfoLog(WebGLShader shader);
- DOMString? getShaderSource(WebGLShader? shader);
+ DOMString? getShaderSource(WebGLShader shader);
any getTexParameter(GLenum target, GLenum pname);
- //any getUniform(WebGLProgram? program, WebGLUniformLocation? location);
+ //any getUniform(WebGLProgram program, WebGLUniformLocation location);
- WebGLUniformLocation? getUniformLocation(WebGLProgram? program, DOMString name);
+ WebGLUniformLocation? getUniformLocation(WebGLProgram program, DOMString name);
any getVertexAttrib(GLuint index, GLenum pname);
@@ -634,7 +634,7 @@ interface WebGLRenderingContextBase
void sampleCoverage(GLclampf value, GLboolean invert);
void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
- void shaderSource(WebGLShader? shader, DOMString source);
+ void shaderSource(WebGLShader shader, DOMString source);
void stencilFunc(GLenum func, GLint ref, GLuint mask);
void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
@@ -653,7 +653,7 @@ interface WebGLRenderingContextBase
GLenum type, object? data);
[Throws]
void texImage2D(GLenum target, GLint level, GLenum internalformat,
- GLenum format, GLenum type, TexImageSource? source); // May throw DOMException
+ GLenum format, GLenum type, TexImageSource source); // May throw DOMException
[Throws, Pref="dom.webgl.dom_to_texture.enabled"]
void texImageDOM(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height,
GLenum format, GLenum type, HTMLIFrameElement source); // May throw DOMException
@@ -667,7 +667,7 @@ interface WebGLRenderingContextBase
GLenum format, GLenum type, object? data);
[Throws]
void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLenum format, GLenum type, TexImageSource? source); // May throw DOMException
+ GLenum format, GLenum type, TexImageSource source); // May throw DOMException
void uniform1f(WebGLUniformLocation? location, GLfloat x);
//void uniform1fv(WebGLUniformLocation? location, Float32Array v);
@@ -738,7 +738,7 @@ interface WebGLRenderingContextBase
object v);
void useProgram(WebGLProgram? program);
- void validateProgram(WebGLProgram? program);
+ void validateProgram(WebGLProgram program);
// FIXME(dmarcos)
// The code generator doesn't handle Float32Array so we're using 'object'
diff --git a/tests/wpt/metadata/css/css-regions/elements/canvas3d-001.html.ini b/tests/wpt/metadata/css/css-regions/elements/canvas3d-001.html.ini
index e1b754989a4..cc4dc5a7b8d 100644
--- a/tests/wpt/metadata/css/css-regions/elements/canvas3d-001.html.ini
+++ b/tests/wpt/metadata/css/css-regions/elements/canvas3d-001.html.ini
@@ -1,3 +1,2 @@
[canvas3d-001.html]
- type: reftest
- disabled: https://github.com/servo/servo/issues/8766
+ expected: FAIL
diff --git a/tests/wpt/metadata/css/css-regions/elements/canvas3d-002.html.ini b/tests/wpt/metadata/css/css-regions/elements/canvas3d-002.html.ini
index 0f98f306849..bcfb3650944 100644
--- a/tests/wpt/metadata/css/css-regions/elements/canvas3d-002.html.ini
+++ b/tests/wpt/metadata/css/css-regions/elements/canvas3d-002.html.ini
@@ -1,3 +1,2 @@
[canvas3d-002.html]
- type: reftest
- disabled: https://github.com/servo/servo/issues/8766
+ expected: FAIL
diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/buffers/element-array-buffer-delete-recreate.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/buffers/element-array-buffer-delete-recreate.html.ini
deleted file mode 100644
index 611bba421bc..00000000000
--- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/buffers/element-array-buffer-delete-recreate.html.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[element-array-buffer-delete-recreate.html]
- type: testharness
- [WebGL test #0: getError expected: NO_ERROR. Was INVALID_ENUM : no errors from draw]
- expected: FAIL
-
- [WebGL test #1: at (0, 0) expected: 0,255,0,255 was 0,0,0,0]
- expected: FAIL
-
diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-hd-dpi-test.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-hd-dpi-test.html.ini
index d9821f05886..d1a71e871ac 100644
--- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-hd-dpi-test.html.ini
+++ b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-hd-dpi-test.html.ini
@@ -1,47 +1,11 @@
[drawingbuffer-hd-dpi-test.html]
type: testharness
- [WebGL test #5: at (28, 12) expected: 0,255,0,255 was 0,0,0,0]
+ [WebGL test #12: at 0, 0 expected 0,0,0,255(black) was 0,255,0,255]
expected: FAIL
- [WebGL test #8: gl.getError() should be 0. Was 1280.]
+ [WebGL test #29: at 0, 0 expected 0,0,0,255(black) was 0,255,0,255]
expected: FAIL
- [WebGL test #12: at 0, 0 expected 0,0,0,255(black) was 0,0,0,0]
- expected: FAIL
-
- [WebGL test #13: at (12, 28) expected: 0,255,0,255 was 0,0,0,0]
- expected: FAIL
-
- [WebGL test #16: gl.getError() should be 0. Was 1280.]
- expected: FAIL
-
- [WebGL test #22: at (124, 60) expected: 0,255,0,255 was 0,0,0,0]
- expected: FAIL
-
- [WebGL test #25: gl.getError() should be 0. Was 1280.]
- expected: FAIL
-
- [WebGL test #29: at 0, 0 expected 0,0,0,255(black) was 0,0,0,0]
- expected: FAIL
-
- [WebGL test #30: at (60, 124) expected: 0,255,0,255 was 0,0,0,0]
- expected: FAIL
-
- [WebGL test #33: gl.getError() should be 0. Was 1280.]
- expected: FAIL
-
- [WebGL test #39: at (252, 508) expected: 0,255,0,255 was 0,0,0,0]
- expected: FAIL
-
- [WebGL test #42: gl.getError() should be 0. Was 1280.]
- expected: FAIL
-
- [WebGL test #46: at 0, 0 expected 0,0,0,255(black) was 0,0,0,0]
- expected: FAIL
-
- [WebGL test #47: at (508, 252) expected: 0,255,0,255 was 0,0,0,0]
- expected: FAIL
-
- [WebGL test #50: gl.getError() should be 0. Was 1280.]
+ [WebGL test #46: at 0, 0 expected 0,0,0,255(black) was 0,255,0,255]
expected: FAIL
diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/more/functions/drawArraysOutOfBounds.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/more/functions/drawArraysOutOfBounds.html.ini
deleted file mode 100644
index 7eaba400214..00000000000
--- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/more/functions/drawArraysOutOfBounds.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[drawArraysOutOfBounds.html]
- type: testharness
- [WebGL test #0: testDrawArraysEmpty]
- expected: FAIL
-
diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/rendering/draw-arrays-out-of-bounds.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/rendering/draw-arrays-out-of-bounds.html.ini
index 64503c921e5..18a9a05ee2b 100644
--- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/rendering/draw-arrays-out-of-bounds.html.ini
+++ b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/rendering/draw-arrays-out-of-bounds.html.ini
@@ -1,3 +1,5 @@
[draw-arrays-out-of-bounds.html]
type: testharness
- expected: TIMEOUT
+ [WebGL test #12: getError expected: INVALID_OPERATION. Was NO_ERROR : after evaluating: gl.drawArrays(gl.TRIANGLES, 3, 2)]
+ expected: FAIL
+
diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/state/gl-get-calls.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/state/gl-get-calls.html.ini
index aa36f7ebddf..5fb34fccbb5 100644
--- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/state/gl-get-calls.html.ini
+++ b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/state/gl-get-calls.html.ini
@@ -1,6 +1,5 @@
[gl-get-calls.html]
type: testharness
- expected: ERROR
[WebGL test #3: (context.getParameter(context.ALIASED_LINE_WIDTH_RANGE)[0\] <= 1) && (context.getParameter(context.ALIASED_LINE_WIDTH_RANGE)[0\] > 0) && (context.getParameter(context.ALIASED_LINE_WIDTH_RANGE)[1\] >= 1) should be true. Threw exception TypeError: context.getParameter(...) is null]
expected: FAIL
@@ -46,12 +45,93 @@
[WebGL test #43: context.getParameter(context.SCISSOR_BOX)[1\] should be 0. Threw exception TypeError: context.getParameter(...) is null]
expected: FAIL
- [WebGL test #44: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).]
+ [WebGL test #44: context.getParameter(context.SCISSOR_BOX)[2\] should be 2. Threw exception TypeError: context.getParameter(...) is null]
expected: FAIL
- [WebGL test #0: Unable to fetch WebGL rendering context for Canvas]
+ [WebGL test #45: context.getParameter(context.SCISSOR_BOX)[3\] should be 2. Threw exception TypeError: context.getParameter(...) is null]
expected: FAIL
- [WebGL test #1: context does not exist]
+ [WebGL test #46: context.getParameter(context.SCISSOR_BOX) is not an instance of function Int32Array() {\n [native code\]\n}]
+ expected: FAIL
+
+ [WebGL test #47: context.getParameter(context.SCISSOR_TEST) should be false (of type boolean). Was null (of type object).]
+ expected: FAIL
+
+ [WebGL test #85: context.getParameter(context.UNPACK_FLIP_Y_WEBGL) should be false (of type boolean). Was null (of type object).]
+ expected: FAIL
+
+ [WebGL test #86: context.getParameter(context.UNPACK_PREMULTIPLY_ALPHA_WEBGL) should be false (of type boolean). Was null (of type object).]
+ expected: FAIL
+
+ [WebGL test #88: context.getParameter(context.VIEWPORT) is not an instance of Int32Array]
+ expected: FAIL
+
+ [WebGL test #91: context.getParameter(context.MAX_FRAGMENT_UNIFORM_VECTORS) should be >= 16. Was null (of type object).]
+ expected: FAIL
+
+ [WebGL test #95: context.getParameter(context.MAX_VARYING_VECTORS) should be >= 8. Was null (of type object).]
+ expected: FAIL
+
+ [WebGL test #98: context.getParameter(context.MAX_VERTEX_UNIFORM_VECTORS) should be >= 128. Was null (of type object).]
+ expected: FAIL
+
+ [WebGL test #99: context.getParameter(context.MAX_VIEWPORT_DIMS)[0\] >= window.screen.width should be true. Threw exception TypeError: context.getParameter(...) is null]
+ expected: FAIL
+
+ [WebGL test #100: context.getParameter(context.MAX_VIEWPORT_DIMS)[1\] >= window.screen.height should be true. Threw exception TypeError: context.getParameter(...) is null]
+ expected: FAIL
+
+ [WebGL test #101: context.getParameter(context.MAX_VIEWPORT_DIMS) is not an instance of Int32Array]
+ expected: FAIL
+
+ [WebGL test #173: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #182: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #191: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #200: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #209: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #218: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #227: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #236: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #245: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #254: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #263: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #272: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #281: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #290: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #299: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #308: context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB) is not an instance of Float32Array]
+ expected: FAIL
+
+ [WebGL test #310: context.getError() should be 0. Was 1280.]
expected: FAIL
diff --git a/tests/wpt/mozilla/meta/webgl/conformance-2.0.0/conformance2/transform_feedback/unwritten-output-defaults-to-zero.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-2.0.0/conformance2/transform_feedback/unwritten-output-defaults-to-zero.html.ini
index ae5d3c11e08..8b0e61b2cd4 100644
--- a/tests/wpt/mozilla/meta/webgl/conformance-2.0.0/conformance2/transform_feedback/unwritten-output-defaults-to-zero.html.ini
+++ b/tests/wpt/mozilla/meta/webgl/conformance-2.0.0/conformance2/transform_feedback/unwritten-output-defaults-to-zero.html.ini
@@ -1,7 +1,11 @@
[unwritten-output-defaults-to-zero.html]
+ expected: ERROR
[WebGL test #1: Fail to set up the program]
expected: FAIL
[WebGL test #2: Fail to set up the program]
expected: FAIL
+ [WebGL test #1: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).]
+ expected: FAIL
+