aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2018-03-24 22:14:45 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2018-03-25 00:04:43 +0100
commitc2f8b0468a65fa36c04ce7ea85fc137c63fca0aa (patch)
treebd4c9400b59f1324b8734f4d30d509be55256e4f
parent2f94e0d2a8c79f999e64231d2dbce5582ef1a689 (diff)
downloadservo-c2f8b0468a65fa36c04ce7ea85fc137c63fca0aa.tar.gz
servo-c2f8b0468a65fa36c04ce7ea85fc137c63fca0aa.zip
Update mozjs.
-rw-r--r--Cargo.lock8
-rw-r--r--components/script/dom/dommatrix.rs14
-rw-r--r--components/script/dom/dommatrixreadonly.rs9
-rw-r--r--components/script/dom/textdecoder.rs4
-rw-r--r--components/script/dom/webglrenderingcontext.rs171
5 files changed, 125 insertions, 81 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 63784e9763c..8d8548591a4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1631,7 +1631,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.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mozjs 0.4.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)",
@@ -1808,7 +1808,7 @@ dependencies = [
[[package]]
name = "mozjs"
-version = "0.4.0"
+version = "0.4.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)",
@@ -2496,7 +2496,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.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mozjs 0.4.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)",
@@ -3896,7 +3896,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.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4463834f4d4ffcf2a54706c8a202e25ddac3f142e3eccc4aebade58fa62bc1ff"
+"checksum mozjs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ab870a85b83df2a5def5a941e5a50493994da0989067b16ab254ce1c770add"
"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/script/dom/dommatrix.rs b/components/script/dom/dommatrix.rs
index f5658a9433f..5cbe4ad9b68 100644
--- a/components/script/dom/dommatrix.rs
+++ b/components/script/dom/dommatrix.rs
@@ -61,8 +61,8 @@ impl DOMMatrix {
// https://drafts.fxtf.org/geometry-1/#dom-dommatrix-fromfloat32array
pub fn FromFloat32Array(
global: &GlobalScope,
- mut array: CustomAutoRooterGuard<Float32Array>)
- -> Fallible<DomRoot<DOMMatrix>> {
+ array: CustomAutoRooterGuard<Float32Array>,
+ ) -> Fallible<DomRoot<DOMMatrix>> {
let vec: Vec<f64> = array.to_vec().iter().map(|&x| x as f64).collect();
DOMMatrix::Constructor_(global, vec)
}
@@ -70,11 +70,11 @@ impl DOMMatrix {
// https://drafts.fxtf.org/geometry-1/#dom-dommatrix-fromfloat64array
pub fn FromFloat64Array(
global: &GlobalScope,
- mut array: CustomAutoRooterGuard<Float64Array>)
- -> Fallible<DomRoot<DOMMatrix>> {
- let vec: Vec<f64> = array.to_vec();
- DOMMatrix::Constructor_(global, vec)
- }
+ array: CustomAutoRooterGuard<Float64Array>,
+ ) -> Fallible<DomRoot<DOMMatrix>> {
+ let vec: Vec<f64> = array.to_vec();
+ DOMMatrix::Constructor_(global, vec)
+ }
}
impl DOMMatrixMethods for DOMMatrix {
diff --git a/components/script/dom/dommatrixreadonly.rs b/components/script/dom/dommatrixreadonly.rs
index 232ebb5817e..4996cf428b2 100644
--- a/components/script/dom/dommatrixreadonly.rs
+++ b/components/script/dom/dommatrixreadonly.rs
@@ -345,8 +345,8 @@ impl DOMMatrixReadOnly {
#[allow(unsafe_code)]
pub fn FromFloat32Array(
global: &GlobalScope,
- mut array: CustomAutoRooterGuard<Float32Array>)
- -> Fallible<DomRoot<DOMMatrixReadOnly>> {
+ array: CustomAutoRooterGuard<Float32Array>,
+ ) -> Fallible<DomRoot<DOMMatrixReadOnly>> {
let vec: Vec<f64> = array.to_vec().iter().map(|&x| x as f64).collect();
DOMMatrixReadOnly::Constructor_(global, vec)
}
@@ -355,12 +355,11 @@ impl DOMMatrixReadOnly {
#[allow(unsafe_code)]
pub fn FromFloat64Array(
global: &GlobalScope,
- mut array: CustomAutoRooterGuard<Float64Array>)
- -> Fallible<DomRoot<DOMMatrixReadOnly>> {
+ array: CustomAutoRooterGuard<Float64Array>,
+ ) -> Fallible<DomRoot<DOMMatrixReadOnly>> {
let vec: Vec<f64> = array.to_vec();
DOMMatrixReadOnly::Constructor_(global, vec)
}
-
}
diff --git a/components/script/dom/textdecoder.rs b/components/script/dom/textdecoder.rs
index 38efa977e7f..3c061322f07 100644
--- a/components/script/dom/textdecoder.rs
+++ b/components/script/dom/textdecoder.rs
@@ -74,8 +74,8 @@ impl TextDecoderMethods for TextDecoder {
match input {
Some(arr) => {
let vec: Vec<u8> = match arr {
- ArrayBufferViewOrArrayBuffer::ArrayBufferView(mut a) => a.to_vec(),
- ArrayBufferViewOrArrayBuffer::ArrayBuffer(mut a) => a.to_vec()
+ ArrayBufferViewOrArrayBuffer::ArrayBufferView(ref a) => a.to_vec(),
+ ArrayBufferViewOrArrayBuffer::ArrayBuffer(ref a) => a.to_vec()
};
let s = if self.fatal {
match self.encoding.decode_without_bom_handling_and_without_replacement(&vec) {
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index 97b65e00019..436372d6c16 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -1193,12 +1193,14 @@ impl Drop for WebGLRenderingContext {
}
#[allow(unsafe_code)]
-unsafe fn fallible_array_buffer_view_to_vec(cx: *mut JSContext, abv: *mut JSObject) -> Result<Vec<u8>, Error>
-{
+unsafe fn fallible_array_buffer_view_to_vec(
+ cx: *mut JSContext,
+ abv: *mut JSObject,
+) -> Result<Vec<u8>, Error> {
assert!(!abv.is_null());
typedarray!(in(cx) let array_buffer_view: ArrayBufferView = abv);
match array_buffer_view {
- Ok(mut v) => Ok(v.to_vec()),
+ Ok(v) => Ok(v.to_vec()),
Err(_) => Err(Error::Type("Not an ArrayBufferView".to_owned())),
}
}
@@ -2849,9 +2851,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform1iv(&self,
- location: Option<&WebGLUniformLocation>,
- mut v: CustomAutoRooterGuard<Int32Array>) {
+ fn Uniform1iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Int32Array>,
+ ) {
self.Uniform1iv_(location, v.to_vec());
}
@@ -2863,9 +2867,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform1fv(&self,
- location: Option<&WebGLUniformLocation>,
- mut v: CustomAutoRooterGuard<Float32Array>) {
+ fn Uniform1fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Float32Array>,
+ ) {
self.Uniform1fv_(location, v.to_vec());
}
@@ -2886,9 +2892,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform2fv(&self,
- location: Option<&WebGLUniformLocation>,
- mut v: CustomAutoRooterGuard<Float32Array>) {
+ fn Uniform2fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Float32Array>,
+ ) {
self.Uniform2fv_(location, v.to_vec());
}
@@ -2902,9 +2910,12 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform2i(&self,
- location: Option<&WebGLUniformLocation>,
- x: i32, y: i32) {
+ fn Uniform2i(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ x: i32,
+ y: i32,
+ ) {
if self.validate_uniform_parameters(location,
UniformSetterType::IntVec2,
&[x, y]) {
@@ -2913,9 +2924,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform2iv(&self,
- location: Option<&WebGLUniformLocation>,
- mut v: CustomAutoRooterGuard<Int32Array>) {
+ fn Uniform2iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Int32Array>,
+ ) {
self.Uniform2iv_(location, v.to_vec());
}
@@ -2929,9 +2942,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform3f(&self,
- location: Option<&WebGLUniformLocation>,
- x: f32, y: f32, z: f32) {
+ fn Uniform3f(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ x: f32,
+ y: f32,
+ z: f32,
+ ) {
if self.validate_uniform_parameters(location,
UniformSetterType::FloatVec3,
&[x, y, z]) {
@@ -2940,9 +2957,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform3fv(&self,
- location: Option<&WebGLUniformLocation>,
- mut v: CustomAutoRooterGuard<Float32Array>) {
+ fn Uniform3fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Float32Array>,
+ ) {
self.Uniform3fv_(location, v.to_vec());
}
@@ -2967,9 +2986,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform3iv(&self,
- location: Option<&WebGLUniformLocation>,
- mut v: CustomAutoRooterGuard<Int32Array>) {
+ fn Uniform3iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Int32Array>,
+ ) {
self.Uniform3iv_(location, v.to_vec());
}
@@ -2983,9 +3004,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform4i(&self,
- location: Option<&WebGLUniformLocation>,
- x: i32, y: i32, z: i32, w: i32) {
+ fn Uniform4i(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ x: i32,
+ y: i32,
+ z: i32,
+ w: i32,
+ ) {
if self.validate_uniform_parameters(location,
UniformSetterType::IntVec4,
&[x, y, z, w]) {
@@ -2995,9 +3021,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform4iv(&self,
- location: Option<&WebGLUniformLocation>,
- mut v: CustomAutoRooterGuard<Int32Array>) {
+ fn Uniform4iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Int32Array>,
+ ) {
self.Uniform4iv_(location, v.to_vec());
}
@@ -3011,9 +3039,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform4f(&self,
- location: Option<&WebGLUniformLocation>,
- x: f32, y: f32, z: f32, w: f32) {
+ fn Uniform4f(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ x: f32,
+ y: f32,
+ z: f32,
+ w: f32,
+ ) {
if self.validate_uniform_parameters(location,
UniformSetterType::FloatVec4,
&[x, y, z, w]) {
@@ -3022,9 +3055,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform4fv(&self,
- location: Option<&WebGLUniformLocation>,
- mut v: CustomAutoRooterGuard<Float32Array>) {
+ fn Uniform4fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Float32Array>,
+ ) {
self.Uniform4fv_(location, v.to_vec());
}
@@ -3038,10 +3073,12 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn UniformMatrix2fv(&self,
- location: Option<&WebGLUniformLocation>,
- transpose: bool,
- mut v: CustomAutoRooterGuard<Float32Array>) {
+ fn UniformMatrix2fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ transpose: bool,
+ v: CustomAutoRooterGuard<Float32Array>,
+ ) {
self.UniformMatrix2fv_(location, transpose, v.to_vec());
}
@@ -3058,18 +3095,22 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn UniformMatrix3fv(&self,
- location: Option<&WebGLUniformLocation>,
- transpose: bool,
- mut v: CustomAutoRooterGuard<Float32Array>) {
+ fn UniformMatrix3fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ transpose: bool,
+ v: CustomAutoRooterGuard<Float32Array>,
+ ) {
self.UniformMatrix3fv_(location, transpose, v.to_vec());
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn UniformMatrix3fv_(&self,
- location: Option<&WebGLUniformLocation>,
- transpose: bool,
- value: Vec<f32>) {
+ fn UniformMatrix3fv_(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ transpose: bool,
+ value: Vec<f32>,
+ ) {
if self.validate_uniform_parameters(location,
UniformSetterType::FloatMat3,
&value) {
@@ -3078,18 +3119,22 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn UniformMatrix4fv(&self,
- location: Option<&WebGLUniformLocation>,
- transpose: bool,
- mut v: CustomAutoRooterGuard<Float32Array>) {
+ fn UniformMatrix4fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ transpose: bool,
+ v: CustomAutoRooterGuard<Float32Array>,
+ ) {
self.UniformMatrix4fv_(location, transpose, v.to_vec());
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn UniformMatrix4fv_(&self,
- location: Option<&WebGLUniformLocation>,
- transpose: bool,
- value: Vec<f32>) {
+ fn UniformMatrix4fv_(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ transpose: bool,
+ value: Vec<f32>,
+ ) {
if self.validate_uniform_parameters(location,
UniformSetterType::FloatMat4,
&value) {
@@ -3120,7 +3165,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn VertexAttrib1fv(&self, indx: u32, mut v: CustomAutoRooterGuard<Float32Array>) {
+ fn VertexAttrib1fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
self.VertexAttrib1fv_(indx, v.to_vec());
}
@@ -3139,7 +3184,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn VertexAttrib2fv(&self, indx: u32, mut v: CustomAutoRooterGuard<Float32Array>) {
+ fn VertexAttrib2fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
self.VertexAttrib2fv_(indx, v.to_vec());
}
@@ -3158,7 +3203,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn VertexAttrib3fv(&self, indx: u32, mut v: CustomAutoRooterGuard<Float32Array>) {
+ fn VertexAttrib3fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
self.VertexAttrib3fv_(indx, v.to_vec());
}
@@ -3177,7 +3222,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn VertexAttrib4fv(&self, indx: u32, mut v: CustomAutoRooterGuard<Float32Array>) {
+ fn VertexAttrib4fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
self.VertexAttrib4fv_(indx, v.to_vec());
}