aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2018-07-08 01:59:58 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2018-07-08 10:44:42 +0200
commitf0ca100e87d5a7db7fa19b42e62e857a32a04638 (patch)
treeb119d66fc94013218b363b01fd271b3e6e2f044c
parent31774e9203961ee31b7a358224570ca9bc5fdd2e (diff)
downloadservo-f0ca100e87d5a7db7fa19b42e62e857a32a04638.tar.gz
servo-f0ca100e87d5a7db7fa19b42e62e857a32a04638.zip
Return an empty typed array from gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS)
-rw-r--r--components/script/dom/webglrenderingcontext.rs12
-rw-r--r--tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-atc.html.ini5
-rw-r--r--tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-pvrtc.html.ini5
-rw-r--r--tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-s3tc.html.ini5
-rw-r--r--tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/state/gl-get-calls.html.ini8
5 files changed, 11 insertions, 24 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index 24085bf4610..e5b66a46f55 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -55,7 +55,7 @@ use js::jsapi::{JSContext, JSObject, Type};
use js::jsval::{BooleanValue, DoubleValue, Int32Value, UInt32Value, JSVal};
use js::jsval::{ObjectValue, NullValue, UndefinedValue};
use js::rust::CustomAutoRooterGuard;
-use js::typedarray::{ArrayBufferView, CreateWith, Float32Array, Int32Array};
+use js::typedarray::{ArrayBufferView, CreateWith, Float32Array, Int32Array, Uint32Array};
use net_traits::image::base::PixelFormat;
use net_traits::image_cache::ImageResponse;
use offscreen_gl_context::{GLContextAttributes, GLLimits};
@@ -1332,6 +1332,16 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
return Int32Value(constants::UNSIGNED_BYTE as i32);
}
}
+ constants::COMPRESSED_TEXTURE_FORMATS => {
+ // FIXME(nox): https://github.com/servo/servo/issues/20594
+ rooted!(in(cx) let mut rval = ptr::null_mut::<JSObject>());
+ let _ = Uint32Array::create(
+ cx,
+ CreateWith::Slice(&[]),
+ rval.handle_mut(),
+ ).unwrap();
+ return ObjectValue(rval.get());
+ }
constants::VERSION => {
rooted!(in(cx) let mut rval = UndefinedValue());
"WebGL 1.0".to_jsval(cx, rval.handle_mut());
diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-atc.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-atc.html.ini
deleted file mode 100644
index 629c3a9e959..00000000000
--- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-atc.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[webgl-compressed-texture-atc.html]
- type: testharness
- [WebGL test #1: gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS) should be . Was null.]
- expected: FAIL
-
diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-pvrtc.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-pvrtc.html.ini
deleted file mode 100644
index 20e8d70fc9d..00000000000
--- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-pvrtc.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[webgl-compressed-texture-pvrtc.html]
- type: testharness
- [WebGL test #1: gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS) should be . Was null.]
- expected: FAIL
-
diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-s3tc.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-s3tc.html.ini
deleted file mode 100644
index 7a8ac511d9b..00000000000
--- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/extensions/webgl-compressed-texture-s3tc.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[webgl-compressed-texture-s3tc.html]
- type: testharness
- [WebGL test #1: gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS) should be . Was null.]
- 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
deleted file mode 100644
index 7c659f812ad..00000000000
--- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/state/gl-get-calls.html.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[gl-get-calls.html]
- type: testharness
- [WebGL test #20: context.getParameter(context.COMPRESSED_TEXTURE_FORMATS) is not an instance of Uint32Array]
- expected: FAIL
-
- [WebGL test #310: context.getError() should be 0. Was 1280.]
- expected: FAIL
-