From 3ad28f6714c6cc71469e61a3a3625bf89e115f3b Mon Sep 17 00:00:00 2001 From: sagudev Date: Thu, 18 Mar 2021 17:27:51 +0100 Subject: [PATCH 1/7] Update mozjs --- Cargo.lock | 4 ++-- components/script/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e677359a8e3..d280dcad4ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3825,7 +3825,7 @@ dependencies = [ [[package]] name = "mozjs" version = "0.14.1" -source = "git+https://github.com/servo/rust-mozjs#fe104a26147a42f6267286cd856361a126ab733b" +source = "git+https://github.com/sagudev/rust-mozjs#f053e1cb35b18aca41fffe914372489e85f17a11" dependencies = [ "cc", "lazy_static", @@ -3838,7 +3838,7 @@ dependencies = [ [[package]] name = "mozjs_sys" version = "0.68.2" -source = "git+https://github.com/servo/mozjs?rev=82da136c53d7ca7b0b7fe1c5622627036ef31899#82da136c53d7ca7b0b7fe1c5622627036ef31899" +source = "git+https://github.com/sagudev/mozjs?branch=master#bdd9d86a7ccfba3128c3e6512bc8f29bffa92b6e" dependencies = [ "bindgen", "cc", diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index a09ccf8f257..aa2f1cab024 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -63,7 +63,7 @@ image = "0.23" indexmap = { version = "1.0.2", features = ["std"] } ipc-channel = "0.14" itertools = "0.8" -js = { package = "mozjs", git = "https://github.com/servo/rust-mozjs" } +js = { package = "mozjs", git = "https://github.com/sagudev/rust-mozjs" } jstraceable_derive = { path = "../jstraceable_derive" } keyboard-types = "0.5" lazy_static = "1" From b921cd14df03c74908f06c47861955cc04a89fa9 Mon Sep 17 00:00:00 2001 From: sagudev Date: Fri, 19 Mar 2021 07:01:46 +0100 Subject: [PATCH 2/7] Fix errors --- components/script/dom/imagedata.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/script/dom/imagedata.rs b/components/script/dom/imagedata.rs index 39e3b061711..cc7699bd5f3 100644 --- a/components/script/dom/imagedata.rs +++ b/components/script/dom/imagedata.rs @@ -15,6 +15,7 @@ use js::jsapi::{Heap, JSObject}; use js::rust::Runtime; use js::typedarray::{CreateWith, Uint8ClampedArray}; use std::borrow::Cow; +use std::convert::TryInto; use std::default::Default; use std::ptr; use std::ptr::NonNull; @@ -113,7 +114,12 @@ impl ImageData { let len = width * height * 4; let cx = global.get_cx(); rooted!(in (*cx) let mut array = ptr::null_mut::()); - Uint8ClampedArray::create(*cx, CreateWith::Length(len), array.handle_mut()).unwrap(); + Uint8ClampedArray::create( + *cx, + CreateWith::Length(len.try_into().unwrap()), + array.handle_mut(), + ) + .unwrap(); (*imagedata).data.set(array.get()); Ok(reflect_dom_object(imagedata, global)) From c80677756e7a8eed3f9b8c0a6e49bf896d06c758 Mon Sep 17 00:00:00 2001 From: sagudev Date: Fri, 19 Mar 2021 08:17:08 +0100 Subject: [PATCH 3/7] Update mozjs --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d280dcad4ab..e6e08eb4f36 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3825,7 +3825,7 @@ dependencies = [ [[package]] name = "mozjs" version = "0.14.1" -source = "git+https://github.com/sagudev/rust-mozjs#f053e1cb35b18aca41fffe914372489e85f17a11" +source = "git+https://github.com/sagudev/rust-mozjs#b09db658a056af52aed36ed0e8b23c93e139bd7c" dependencies = [ "cc", "lazy_static", @@ -3838,7 +3838,7 @@ dependencies = [ [[package]] name = "mozjs_sys" version = "0.68.2" -source = "git+https://github.com/sagudev/mozjs?branch=master#bdd9d86a7ccfba3128c3e6512bc8f29bffa92b6e" +source = "git+https://github.com/sagudev/mozjs?branch=master#d250f81c18ecfcf0d04e37ebd4545b65e5693069" dependencies = [ "bindgen", "cc", From b3126eaa3f9c7e1fc83a6518a95c2fe0daf222df Mon Sep 17 00:00:00 2001 From: sagudev Date: Mon, 29 Mar 2021 19:53:54 +0200 Subject: [PATCH 4/7] Update mozjs --- Cargo.lock | 4 ++-- components/script/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6e08eb4f36..bcd7af66f48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3825,7 +3825,7 @@ dependencies = [ [[package]] name = "mozjs" version = "0.14.1" -source = "git+https://github.com/sagudev/rust-mozjs#b09db658a056af52aed36ed0e8b23c93e139bd7c" +source = "git+https://github.com/servo/rust-mozjs#ef63e568c6aaa1c0f0d1c11f49a99acff1306709" dependencies = [ "cc", "lazy_static", @@ -3838,7 +3838,7 @@ dependencies = [ [[package]] name = "mozjs_sys" version = "0.68.2" -source = "git+https://github.com/sagudev/mozjs?branch=master#d250f81c18ecfcf0d04e37ebd4545b65e5693069" +source = "git+https://github.com/servo/mozjs?rev=95387f7235ae9ba950a8dbebb850f41709ff5b1d#95387f7235ae9ba950a8dbebb850f41709ff5b1d" dependencies = [ "bindgen", "cc", diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index aa2f1cab024..a09ccf8f257 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -63,7 +63,7 @@ image = "0.23" indexmap = { version = "1.0.2", features = ["std"] } ipc-channel = "0.14" itertools = "0.8" -js = { package = "mozjs", git = "https://github.com/sagudev/rust-mozjs" } +js = { package = "mozjs", git = "https://github.com/servo/rust-mozjs" } jstraceable_derive = { path = "../jstraceable_derive" } keyboard-types = "0.5" lazy_static = "1" From 61d77756736f83fdd8ac9517f6a824ecef683117 Mon Sep 17 00:00:00 2001 From: sagu <16504129+sagudev@users.noreply.github.com> Date: Tue, 30 Mar 2021 06:21:05 +0200 Subject: [PATCH 5/7] Update imagedata.rs --- components/script/dom/imagedata.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/script/dom/imagedata.rs b/components/script/dom/imagedata.rs index cc7699bd5f3..0909def3ca0 100644 --- a/components/script/dom/imagedata.rs +++ b/components/script/dom/imagedata.rs @@ -116,7 +116,7 @@ impl ImageData { rooted!(in (*cx) let mut array = ptr::null_mut::()); Uint8ClampedArray::create( *cx, - CreateWith::Length(len.try_into().unwrap()), + CreateWith::Length(len as usize), array.handle_mut(), ) .unwrap(); From 5f91ab07dab8d1ad80886cb785f1e1045b497efa Mon Sep 17 00:00:00 2001 From: sagudev Date: Tue, 30 Mar 2021 11:38:33 +0200 Subject: [PATCH 6/7] fmt --- canvas.png | Bin 0 -> 2081 bytes components/script/dom/imagedata.rs | 8 ++------ 2 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 canvas.png diff --git a/canvas.png b/canvas.png new file mode 100644 index 0000000000000000000000000000000000000000..d83232e20e12798a2699ac2523cbdc5e0c15cdd1 GIT binary patch literal 2081 zcmXX{d0Z3M7DmiQLP!E8(ima_J^?4PSS)Vgg%lL9A_NFiK^Z{W3X0MQYEYJmXi#|4 z-xKPN3ya{0gMEOY6vwi(`VcB1ltNWRs-!3`L_}UfZ}9z-%-nO&x!-cmo&2!Sbxb;+ zZe?Y~3=RrVSXs@Hfaek#1^jM}se52$MSUI|;2*j7%!>i<^;@F_htf{(p0c(nqt~1e z*%N^YN-ukF7xxFGi2jpzBQr8Sug8Dj2gQH=51Z|$n39;K3}vniX~-AH+#prZjx0+Q zy9O@vy`<`ER6QGfYwl{?_&E1!pDZj5W3GS$TV{(>z*xlE%>OxNp%`%>e_lOL?u1fy|H`!O{bnx z4T(XzS1%$y3~#;PS+{D6c(OYXw~b)ULlM)isgtKu(yzzS-oCuH|4a>yM^pZelKvVp z_N8XEWV*nYvh0*j5K2aq;);+1s^+ugdxmG{^N^|z8#HM%So+m;f9cp}rdj^;=n>?T zN}(HxQ18+^!z3sK$iT*qnOE`m`fT!n)APB+^hocwzuvcXBkrNmfDGi}kEV~0UK#X- z0pyY-LmJS#s^eNS^=J>5rZkak^b?mdcoL{oV+i6%rgg&y-QZ6TKkHwBITO`A;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G y<3jiD;ia%492{_f#Av1e`pRBn1h-ijYsRW6k&@il*BJ^v{Z_$&p#e2=1pOO81fF96 literal 0 HcmV?d00001 diff --git a/components/script/dom/imagedata.rs b/components/script/dom/imagedata.rs index 0909def3ca0..d11c7793484 100644 --- a/components/script/dom/imagedata.rs +++ b/components/script/dom/imagedata.rs @@ -114,12 +114,8 @@ impl ImageData { let len = width * height * 4; let cx = global.get_cx(); rooted!(in (*cx) let mut array = ptr::null_mut::()); - Uint8ClampedArray::create( - *cx, - CreateWith::Length(len as usize), - array.handle_mut(), - ) - .unwrap(); + Uint8ClampedArray::create(*cx, CreateWith::Length(len as usize), array.handle_mut()) + .unwrap(); (*imagedata).data.set(array.get()); Ok(reflect_dom_object(imagedata, global)) From 3ef3ee5a628216d7b6131826abaecd15f19a1f8a Mon Sep 17 00:00:00 2001 From: sagu <16504129+sagudev@users.noreply.github.com> Date: Tue, 30 Mar 2021 12:09:18 +0200 Subject: [PATCH 7/7] Fix warning --- components/script/dom/imagedata.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/components/script/dom/imagedata.rs b/components/script/dom/imagedata.rs index d11c7793484..d8574a9b666 100644 --- a/components/script/dom/imagedata.rs +++ b/components/script/dom/imagedata.rs @@ -15,7 +15,6 @@ use js::jsapi::{Heap, JSObject}; use js::rust::Runtime; use js::typedarray::{CreateWith, Uint8ClampedArray}; use std::borrow::Cow; -use std::convert::TryInto; use std::default::Default; use std::ptr; use std::ptr::NonNull;