Skip to content

The headless browser for AI agents and web scraping

upgrade: update deno_core and V8

Gilbertdf8b0580c84c
diff --git a/Cargo.lock b/Cargo.lock
index 829a13ab..797985c7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -177,7 +177,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -192,12 +192,6 @@ version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
-[[package]]
-name = "az"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be5eb007b7cacc6c660343e96f650fedf4b5a77512399eb952ca6642cf8d13f7"
-
[[package]]
name = "base64"
version = "0.22.1"
@@ -214,20 +208,11 @@ dependencies = [
"vsimd",
]
-[[package]]
-name = "bincode"
-version = "1.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
-dependencies = [
- "serde",
-]
-
[[package]]
name = "bindgen"
-version = "0.71.1"
+version = "0.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3"
+checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f"
dependencies = [
"bitflags",
"cexpr",
@@ -238,9 +223,9 @@ dependencies = [
"proc-macro2",
"quote",
"regex",
- "rustc-hash 2.1.2",
+ "rustc-hash 1.1.0",
"shlex 1.3.0",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -253,12 +238,14 @@ dependencies = [
"cexpr",
"clang-sys",
"itertools",
+ "log",
+ "prettyplease",
"proc-macro2",
"quote",
"regex",
"rustc-hash 2.1.2",
"shlex 1.3.0",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -312,6 +299,16 @@ dependencies = [
"generic-array",
]
+[[package]]
+name = "boxed_error"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "17d4f95e880cfd28c4ca5a006cf7f6af52b4bcb7b5866f573b2faa126fb7affb"
+dependencies = [
+ "quote",
+ "syn 2.0.117",
+]
+
[[package]]
name = "brotli"
version = "8.0.3"
@@ -381,7 +378,7 @@ checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -403,23 +400,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
[[package]]
-name = "capacity_builder"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f2d24a6dcf0cd402a21b65d35340f3a49ff3475dc5fdac91d22d2733e6641c6"
-dependencies = [
- "capacity_builder_macros",
- "itoa",
-]
-
-[[package]]
-name = "capacity_builder_macros"
-version = "0.3.0"
+name = "calendrical_calculations"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b4a6cae9efc04cc6cbb8faf338d2c497c165c83e74509cf4dbedea948bbf6e5"
+checksum = "5abbd6eeda6885048d357edc66748eea6e0268e3dd11f326fff5bd248d779c26"
dependencies = [
- "quote",
- "syn",
+ "core_maths",
+ "displaydoc",
]
[[package]]
@@ -516,7 +503,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -651,7 +638,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
dependencies = [
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -687,26 +674,27 @@ dependencies = [
[[package]]
name = "deno_core"
-version = "0.350.0"
+version = "0.412.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e273b731fce500130790e777cb2631dc451db412975304d23816c1e444a10c5b"
+checksum = "580cb2e0d797d75ff3dfc4a8f2b14aa7470f0fa31654a09a83d4cbb42b5eb9b4"
dependencies = [
"anyhow",
- "az",
- "bincode",
+ "base64",
"bit-set",
"bit-vec",
+ "boxed_error",
"bytes",
- "capacity_builder",
"cooked-waker",
- "deno_core_icudata",
"deno_error",
"deno_ops",
"deno_path_util",
"deno_unsync",
+ "deno_v8",
"futures",
"indexmap",
+ "inventory",
"libc",
+ "num-bigint",
"parking_lot",
"percent-encoding",
"pin-project",
@@ -716,24 +704,20 @@ dependencies = [
"smallvec",
"sourcemap",
"static_assertions",
+ "sys_traits",
"thiserror 2.0.18",
"tokio",
"url",
- "v8",
+ "uuid",
"wasm_dep_analyzer",
+ "windows-sys 0.59.0",
]
-[[package]]
-name = "deno_core_icudata"
-version = "0.74.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe4dccb6147bb3f3ba0c7a48e993bfeb999d2c2e47a81badee80e2b370c8d695"
-
[[package]]
name = "deno_error"
-version = "0.6.1"
+version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "612ec3fc481fea759141b0c57810889b0a4fb6fee8f10748677bfe492fd30486"
+checksum = "bfafd2219b29886a71aecbb3449e462deed1b2c474dc5b12f855f0e58c478931"
dependencies = [
"deno_error_macro",
"libc",
@@ -745,37 +729,37 @@ dependencies = [
[[package]]
name = "deno_error_macro"
-version = "0.6.1"
+version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8380a4224d5d2c3f84da4d764c4326cac62e9a1e3d4960442d29136fc07be863"
+checksum = "1c28ede88783f14cd8aae46ca89f230c226b40e4a81ab06fa52ed72af84beb2f"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
name = "deno_ops"
-version = "0.226.0"
+version = "0.288.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c28b12489187c71fa123731cc783d48beb17ae5df04da991909cc2ae5a3d0ef9"
+checksum = "977748624aad80164dbe385c8c907bc0041c2e6849f92528e362e03132c64c52"
dependencies = [
"indexmap",
- "proc-macro-rules",
"proc-macro2",
"quote",
"stringcase",
"strum",
"strum_macros",
- "syn",
+ "syn 2.0.117",
+ "syn-match",
"thiserror 2.0.18",
]
[[package]]
name = "deno_path_util"
-version = "0.4.0"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "516f813389095889776b81cc9108ff6f336fd9409b4b12fc0138aea23d2708e1"
+checksum = "78c7e98943f0d068928906db0c7bde89de684fa32c6a8018caacc4cee2cdd72b"
dependencies = [
"deno_error",
"percent-encoding",
@@ -795,6 +779,16 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "deno_v8"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85cdff08dedf79da6a40f97554f47d59d419ba3df8061b8b31789cd2cbe00433"
+dependencies = [
+ "v8",
+ "v8x",
+]
+
[[package]]
name = "deranged"
version = "0.5.8"
@@ -809,7 +803,7 @@ checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -823,6 +817,38 @@ dependencies = [
"subtle",
]
+[[package]]
+name = "diplomat"
+version = "0.16.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8b37a6cea72eb6df5143d3e091d4c34cb0cf4046dd1ddcc082988886fe1f809"
+dependencies = [
+ "diplomat_core",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+]
+
+[[package]]
+name = "diplomat-runtime"
+version = "0.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae517853d9f82b2d144393b1c32c34c46c2e361de2b6c44a8fdfce23beb211cd"
+
+[[package]]
+name = "diplomat_core"
+version = "0.16.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73b18e806f9ecb92df828d080efe47984ae1193958295d4a84fb8b32c9a1aa1b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "serde",
+ "smallvec",
+ "strck",
+ "syn 3.0.6",
+]
+
[[package]]
name = "displaydoc"
version = "0.2.6"
@@ -831,7 +857,7 @@ checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -996,7 +1022,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -1092,7 +1118,7 @@ checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -1404,6 +1430,28 @@ dependencies = [
"tracing",
]
+[[package]]
+name = "icu_calendar"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "58655df2f728e46e4eee80bddebefacf52ec3e77cdb925014b47c5a5905eb55c"
+dependencies = [
+ "calendrical_calculations",
+ "displaydoc",
+ "icu_calendar_data",
+ "icu_locale_core",
+ "icu_locale_fallback",
+ "icu_provider",
+ "tinystr",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_calendar_data"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc00caaa3fb3201ff7a18aa458e8c3ab042b9da154cfdf948bdde3936c31c36e"
+
[[package]]
name = "icu_collections"
version = "2.2.0"
@@ -1420,17 +1468,38 @@ dependencies = [
[[package]]
name = "icu_locale_core"
-version = "2.2.0"
+version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29"
+checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb"
dependencies = [
"displaydoc",
"litemap",
+ "serde",
"tinystr",
"writeable",
"zerovec",
]
+[[package]]
+name = "icu_locale_fallback"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "251af8e57c9400e3eb58242fe5b8b1152b2a64fdf4cf632f923c38ccee6f2fa9"
+dependencies = [
+ "icu_locale_core",
+ "icu_locale_fallback_data",
+ "icu_provider",
+ "potential_utf",
+ "tinystr",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_locale_fallback_data"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "decf2a22ec8fa68f1a0c1129a3f8583f8f8bc24e8b9ccbe98ead99f62a4dc3a8"
+
[[package]]
name = "icu_normalizer"
version = "2.2.0"
@@ -1473,12 +1542,14 @@ checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14"
[[package]]
name = "icu_provider"
-version = "2.2.0"
+version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421"
+checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73"
dependencies = [
"displaydoc",
"icu_locale_core",
+ "serde",
+ "stable_deref_trait",
"writeable",
"yoke",
"zerofrom",
@@ -1575,6 +1646,15 @@ dependencies = [
"generic-array",
]
+[[package]]
+name = "inventory"
+version = "0.3.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b"
+dependencies = [
+ "rustversion",
+]
+
[[package]]
name = "ipnet"
version = "2.12.0"
@@ -1602,6 +1682,12 @@ version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
+[[package]]
+name = "ixdtf"
+version = "0.6.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4d3667095d64c3ecffc96463a21157b04bf3e252f6e8d5750b20c02e33c194e3"
+
[[package]]
name = "jobserver"
version = "0.1.34"
@@ -1822,7 +1908,6 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
dependencies = [
"num-integer",
"num-traits",
- "rand 0.8.6",
]
[[package]]
@@ -2058,7 +2143,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -2201,7 +2286,7 @@ dependencies = [
"phf_shared 0.11.3",
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -2245,7 +2330,7 @@ checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -2300,6 +2385,8 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"
dependencies = [
+ "serde_core",
+ "writeable",
"zerovec",
]
@@ -2331,30 +2418,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
dependencies = [
"proc-macro2",
- "syn",
-]
-
-[[package]]
-name = "proc-macro-rules"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "07c277e4e643ef00c1233393c673f655e3672cf7eb3ba08a00bdd0ea59139b5f"
-dependencies = [
- "proc-macro-rules-macros",
- "proc-macro2",
- "syn",
-]
-
-[[package]]
-name = "proc-macro-rules-macros"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "207fffb0fe655d1d47f6af98cc2793405e85929bdbc420d685554ff07be27ac7"
-dependencies = [
- "once_cell",
- "proc-macro2",
- "quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -2627,6 +2691,16 @@ dependencies = [
"webpki-roots 1.0.7",
]
+[[package]]
+name = "resb"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22d392791f3c6802a1905a509e9d1a6039cbbcb5e9e00e5a6d3661f7c874f390"
+dependencies = [
+ "potential_utf",
+ "serde_core",
+]
+
[[package]]
name = "resvg"
version = "0.47.0"
@@ -2844,7 +2918,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -2875,16 +2949,16 @@ dependencies = [
[[package]]
name = "serde_v8"
-version = "0.259.0"
+version = "0.321.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7e4c5f439cffc03021c8bfd380cd1ef6acb4788a72b7e54bf4a83c73f91f8a0"
+checksum = "fd3b6f6140192f569b88997e2ea7afeef6aa38b64374e84784ea1d1ea35679d3"
dependencies = [
"deno_error",
+ "deno_v8",
"num-bigint",
"serde",
"smallvec",
"thiserror 2.0.18",
- "v8",
]
[[package]]
@@ -3047,6 +3121,15 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
+[[package]]
+name = "strck"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42316e70da376f3d113a68d138a60d8a9883c604fe97942721ec2068dab13a9f"
+dependencies = [
+ "unicode-ident",
+]
+
[[package]]
name = "strict-num"
version = "0.1.1"
@@ -3110,7 +3193,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -3151,6 +3234,28 @@ dependencies = [
"unicode-ident",
]
+[[package]]
+name = "syn"
+version = "3.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "syn-match"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54b8f0a9004d6aafa6a588602a1119e6cdaacec9921aa1605383e6e7d6258fd6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.117",
+]
+
[[package]]
name = "sync_wrapper"
version = "1.0.2"
@@ -3168,7 +3273,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -3197,7 +3302,7 @@ checksum = "181f22127402abcf8ee5c83ccd5b408933fec36a6095cf82cda545634692657e"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -3229,6 +3334,40 @@ dependencies = [
"windows-sys 0.61.2",
]
+[[package]]
+name = "temporal_capi"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f48eb9ca4ca22caaa48d1e7a534ad3fd598a23d1a71945e8ad5ac0be501fa5f2"
+dependencies = [
+ "diplomat",
+ "diplomat-runtime",
+ "icu_calendar",
+ "icu_locale_core",
+ "num-traits",
+ "temporal_rs",
+ "timezone_provider",
+ "writeable",
+ "zoneinfo64",
+]
+
+[[package]]
+name = "temporal_rs"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a978fef907a27736827d336c0bfaab14fb8a7509dd6dc2b43c44e51d59aca5b"
+dependencies = [
+ "calendrical_calculations",
+ "core_maths",
+ "icu_calendar",
+ "icu_locale_core",
+ "ixdtf",
+ "num-traits",
+ "timezone_provider",
+ "tinystr",
+ "writeable",
+]
+
[[package]]
name = "tendril"
version = "0.5.1"
@@ -3264,7 +3403,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -3275,7 +3414,7 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -3306,6 +3445,18 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"
+[[package]]
+name = "timezone_provider"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "89ec4f4eebb4817fde02a411aedc7ac5f66c89c68c49e5d4b17a8139f077af52"
+dependencies = [
+ "tinystr",
+ "zerotrie",
+ "zerovec",
+ "zoneinfo64",
+]
+
[[package]]
name = "tiny-skia"
version = "0.12.0"
@@ -3334,11 +3485,12 @@ dependencies = [
[[package]]
name = "tinystr"
-version = "0.8.3"
+version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"
+checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643"
dependencies = [
"displaydoc",
+ "serde_core",
"zerovec",
]
@@ -3392,7 +3544,7 @@ checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -3511,7 +3663,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -3608,7 +3760,7 @@ checksum = "076a02dc54dd46795c2e9c8282ed40bcfb1e22747e955de9389a1de28190fb26"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -3786,20 +3938,36 @@ dependencies = [
[[package]]
name = "v8"
-version = "137.3.0"
+version = "150.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33995a1fee055ff743281cde33a41f0d618ee0bdbe8bdf6859e11864499c2595"
+checksum = "42a978ff11f15b24e5c05a7123cf2b68f41e763546699781a924ef4e2cf43a49"
dependencies = [
- "bindgen 0.71.1",
+ "bindgen 0.72.1",
"bitflags",
"fslock",
"gzip-header",
"home",
"miniz_oxide",
"paste",
+ "temporal_capi",
"which",
]
+[[package]]
+name = "v8x"
+version = "149.4.0-rc.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3701ffb3692a24808503d17f758b0a3f688d2c451779247982566b5941033e63"
+dependencies = [
+ "bindgen 0.70.1",
+ "bitflags",
+ "cc",
+ "paste",
+ "temporal_capi",
+ "temporal_rs",
+ "timezone_provider",
+]
+
[[package]]
name = "valuable"
version = "0.1.1"
@@ -3893,7 +4061,7 @@ dependencies = [
"bumpalo",
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
"wasm-bindgen-shared",
]
@@ -3930,9 +4098,9 @@ dependencies = [
[[package]]
name = "wasm_dep_analyzer"
-version = "0.3.0"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e51cf5f08b357e64cd7642ab4bbeb11aecab9e15520692129624fb9908b8df2c"
+checksum = "a10e6b67c951a84de7029487e0e0a496860dae49f6699edd279d5ff35b8fbf54"
dependencies = [
"deno_error",
"thiserror 2.0.18",
@@ -4262,7 +4430,7 @@ dependencies = [
"heck",
"indexmap",
"prettyplease",
- "syn",
+ "syn 2.0.117",
"wasm-metadata",
"wit-bindgen-core",
"wit-component",
@@ -4278,7 +4446,7 @@ dependencies = [
"prettyplease",
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
"wit-bindgen-core",
"wit-bindgen-rust",
]
@@ -4400,9 +4568,9 @@ dependencies = [
[[package]]
name = "writeable"
-version = "0.6.3"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
+checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
[[package]]
name = "wuff"
@@ -4464,7 +4632,7 @@ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
"synstructure",
]
@@ -4491,7 +4659,7 @@ checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
]
[[package]]
@@ -4511,7 +4679,7 @@ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.117",
"synstructure",
]
@@ -4523,21 +4691,23 @@ checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e"
[[package]]
name = "zerotrie"
-version = "0.2.4"
+version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"
+checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"
dependencies = [
"displaydoc",
"yoke",
"zerofrom",
+ "zerovec",
]
[[package]]
name = "zerovec"
-version = "0.11.6"
+version = "0.11.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"
+checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8"
dependencies = [
+ "serde",
"yoke",
"zerofrom",
"zerovec-derive",
@@ -4545,13 +4715,13 @@ dependencies = [
[[package]]
name = "zerovec-derive"
-version = "0.11.3"
+version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
+checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 3.0.6",
]
[[package]]
@@ -4560,6 +4730,19 @@ version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
+[[package]]
+name = "zoneinfo64"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed6eb2607e906160c457fd573e9297e65029669906b9ac8fb1b5cd5e055f0705"
+dependencies = [
+ "calendrical_calculations",
+ "icu_locale_core",
+ "potential_utf",
+ "resb",
+ "serde",
+]
+
[[package]]
name = "zstd"
version = "0.13.3"
diff --git a/crates/obscura-js/Cargo.toml b/crates/obscura-js/Cargo.toml
index ac4e3f8c..c9350fb2 100644
--- a/crates/obscura-js/Cargo.toml
+++ b/crates/obscura-js/Cargo.toml
@@ -17,12 +17,12 @@ stealth = ["obscura-net/stealth"]
render = ["dep:obscura-render", "obscura-render/paint"]
[build-dependencies]
-deno_core = "0.350"
+deno_core = "0.412"
[dependencies]
obscura-dom = { workspace = true }
obscura-net = { workspace = true }
-deno_core = "0.350"
+deno_core = "0.412"
tokio = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
@@ -36,7 +36,7 @@ thiserror = { workspace = true }
anyhow = { workspace = true }
reqwest = { workspace = true }
html5ever = { workspace = true }
-deno_error = "0.6"
+deno_error = "0.7"
base64 = { workspace = true }
sha1 = "0.10"
sha2 = "0.10"
diff --git a/crates/obscura-js/js/bootstrap.js b/crates/obscura-js/js/bootstrap.js
index b2dea1b0..b82685cd 100644
--- a/crates/obscura-js/js/bootstrap.js
+++ b/crates/obscura-js/js/bootstrap.js
@@ -920,14 +920,17 @@ const _scheduleAfter = (delay, fn) => {
return frameTimerId;
}
// The callback runs only when the embedder pumps the event loop, after the
- // current microtask checkpoint.
- return __obscuraCore.queueUserTimer(0, false, d, () => {
+ // current microtask checkpoint. deno_core's timer queue drives the callback
+ // from the native event loop; the returned timer object doubles as the
+ // cancel handle. A refed timer keeps the event loop alive until it fires,
+ // which is how a page with only pending timers stays observable.
+ return __obscuraCore.createTimer(() => {
// HTML timer/observer/rAF delivery starts a new task. Freeze animation
// time lazily on that task's first style/layout read so a callback that
// waited in the host queue samples its actual delivery instant.
__obscuraCore.ops.op_begin_render_task?.();
return fn();
- });
+ }, d, undefined, false, true, false);
};
const _cancelScheduled = (nativeId) => {
@@ -936,7 +939,9 @@ const _cancelScheduled = (nativeId) => {
if (state) state.cancelled = true;
_frameTimerStates.delete(nativeId);
}
- else __obscuraCore.cancelTimer(nativeId);
+ else if (nativeId !== undefined && nativeId !== null) {
+ __obscuraCore.cancelTimer(nativeId);
+ }
};
// Timers accept a string first arg per the HTML spec (e.g. the Aliyun WAF
diff --git a/crates/obscura-js/src/frame.rs b/crates/obscura-js/src/frame.rs
index 0b67cdb6..335e57e3 100644
--- a/crates/obscura-js/src/frame.rs
+++ b/crates/obscura-js/src/frame.rs
@@ -446,8 +446,8 @@ mod tests {
assert!(frame.is_same_origin_as("https://child.example"));
}
- #[test]
- fn frame_uses_its_embedding_viewport() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn frame_uses_its_embedding_viewport() {
let mut parent = page(
"https://parent.example/page",
"<html><body><iframe style='width:300px;height:65px'></iframe></body></html>",
@@ -475,8 +475,8 @@ mod tests {
/// A frame must not look like a different browser than its parent. Anti-bot
/// code fingerprints inside the frame and compares it with the top document.
- #[test]
- fn frame_inherits_the_parent_browser_identity() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn frame_inherits_the_parent_browser_identity() {
let user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) TestAgent/150.0.0.0";
let mut parent = ObscuraJsRuntime::new();
parent.set_user_agent(user_agent);
@@ -752,8 +752,8 @@ mod tests {
assert!(problems.iter().any(|p| p.contains("module")), "{problems:?}");
}
- #[test]
- fn many_frames_can_be_alive_at_once() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn many_frames_can_be_alive_at_once() {
let mut parent = page("https://parent.example/", "<html><body></body></html>");
let frames: Vec<FrameRealm> = (0..4)
.map(|index| {
diff --git a/crates/obscura-js/src/module_loader.rs b/crates/obscura-js/src/module_loader.rs
index 7110eb64..6a82e486 100644
--- a/crates/obscura-js/src/module_loader.rs
+++ b/crates/obscura-js/src/module_loader.rs
@@ -4,12 +4,15 @@ use std::rc::{Rc, Weak};
use std::sync::Arc;
use deno_core::error::ModuleLoaderError;
+use deno_core::ModuleLoadOptions;
+use deno_core::ModuleLoadReferrer;
use deno_core::ModuleLoadResponse;
use deno_core::ModuleLoader;
use deno_core::ModuleSource;
use deno_core::ModuleSourceCode;
use deno_core::ModuleSpecifier;
-use deno_core::RequestedModuleType;
+
+use deno_error::JsErrorBox;
use crate::import_map::ImportMap;
use crate::ops::ObscuraState;
@@ -146,7 +149,7 @@ impl ObscuraModuleLoader {
}
fn io_err(msg: String) -> ModuleLoaderError {
- std::io::Error::new(std::io::ErrorKind::Other, msg).into()
+ JsErrorBox::from_err(std::io::Error::new(std::io::ErrorKind::Other, msg))
}
impl ModuleLoader for ObscuraModuleLoader {
@@ -162,7 +165,7 @@ impl ModuleLoader for ObscuraModuleLoader {
// must not remap that root URL.
if referrer == "." {
return deno_core::resolve_import(specifier, &self.base_url)
- .map_err(|error| error.into());
+ .map_err(|error| io_err(error.to_string()));
}
let base = if referrer.is_empty()
@@ -186,9 +189,8 @@ impl ModuleLoader for ObscuraModuleLoader {
fn load(
&self,
module_specifier: &ModuleSpecifier,
- maybe_referrer: Option<&ModuleSpecifier>,
- is_dyn_import: bool,
- _requested_module_type: RequestedModuleType,
+ maybe_referrer: Option<&ModuleLoadReferrer>,
+ options: ModuleLoadOptions,
) -> ModuleLoadResponse {
let url = module_specifier.to_string();
// Module-graph CORS and same-origin credentials are relative to the
@@ -199,7 +201,7 @@ impl ModuleLoader for ObscuraModuleLoader {
let document_url = ModuleSpecifier::parse(&self.base_url)
.unwrap_or_else(|_| module_specifier.clone());
let referrer = maybe_referrer
- .cloned()
+ .map(|referrer| referrer.specifier.clone())
.unwrap_or_else(|| document_url.clone());
// Capture the loader's proxy here so the async closure below owns a
// plain Option<String> rather than borrowing &self across an `await`.
@@ -211,6 +213,7 @@ impl ModuleLoader for ObscuraModuleLoader {
// runtime between deno_core accepting the load and first polling it.
// Keeping the guard inside the future makes cancellation/navigation
// decrement the count through Drop as well as success and failure.
+ let is_dyn_import = options.is_dynamic_import;
let activity_guard = is_dyn_import.then(|| activity.begin());
let page_network = match self.page_state.as_ref() {
Some(weak) => (|| {
@@ -250,7 +253,7 @@ impl ModuleLoader for ObscuraModuleLoader {
};
ModuleLoadResponse::Async(Pin::from(Box::new(async move {
- // deno_core propagates `is_dyn_import` to every dependency edge in
+ // deno_core propagates `is_dynamic_import` to every dependency edge in
// the recursive graph, so this excludes parser-discovered/static
// graphs without losing descendant fetches of a lazy graph.
let _activity_guard = activity_guard;
diff --git a/crates/obscura-js/src/ops.rs b/crates/obscura-js/src/ops.rs
index ba7fe5b7..14d5226e 100644
--- a/crates/obscura-js/src/ops.rs
+++ b/crates/obscura-js/src/ops.rs
@@ -688,7 +688,7 @@ pub fn frame_state(op_state: &OpState, frame_id: u32) -> SharedState {
///
/// A page with no frames pays only an `is_empty` check: looking up the current
/// context is not free, and `op_dom` is the hottest op in the system.
-pub fn realm_state(scope: &mut v8::HandleScope, op_state: &OpState) -> SharedState {
+pub fn realm_state(scope: &mut v8::PinScope, op_state: &OpState) -> SharedState {
let page = || op_state.borrow::<SharedState>().clone();
let registry = match op_state.try_borrow::<Rc<RefCell<RealmStates>>>() {
Some(registry) => registry.clone(),
@@ -2882,7 +2882,7 @@ fn intercept_fulfill_response(
})
}
-#[op2(async)]
+#[op2]
#[string]
async fn op_fetch_url(
state: Rc<RefCell<OpState>>,
@@ -4951,7 +4951,7 @@ fn validate_fetch_url(url: &url::Url, allow_private_network: bool) -> Result<(),
#[op2]
#[string]
-fn op_get_cookies(scope: &mut v8::HandleScope, state: &OpState) -> String {
+fn op_get_cookies(scope: &mut v8::PinScope, state: &OpState) -> String {
let gs = realm_state(scope, state);
let gs = gs.borrow();
let jar = match &gs.cookie_jar {
@@ -4966,7 +4966,7 @@ fn op_get_cookies(scope: &mut v8::HandleScope, state: &OpState) -> String {
}
#[op2(fast)]
-fn op_set_cookie(scope: &mut v8::HandleScope, state: &OpState, #[string] cookie_str: &str) {
+fn op_set_cookie(scope: &mut v8::PinScope, state: &OpState, #[string] cookie_str: &str) {
let gs = realm_state(scope, state);
let gs = gs.borrow();
let jar = match &gs.cookie_jar {
@@ -4984,7 +4984,7 @@ fn op_set_cookie(scope: &mut v8::HandleScope, state: &OpState, #[string] cookie_
// navigation against the calling realm keeps it inside that frame.
#[op2(fast)]
fn op_navigate(
- scope: &mut v8::HandleScope,
+ scope: &mut v8::PinScope,
state: &OpState,
#[string] url: &str,
#[string] method: &str,
@@ -5066,7 +5066,7 @@ fn op_post_frame_message(
/// and a snapshot-restored realm has none. This resolves an ordinary promise
/// instead, and V8 reports the frame as the microtask context, so the ops a
/// timer callback makes still find the frame's own document.
-#[op2(async)]
+#[op2]
async fn op_sleep(#[number] millis: u64) {
tokio::time::sleep(std::time::Duration::from_millis(millis)).await;
}
@@ -5079,7 +5079,7 @@ const MAX_PENDING_FRAME_BYTES: usize = 32 * 1024 * 1024;
// id means the bounded native queue refused the document.
#[op2(fast)]
fn op_frame_document_ready(
- scope: &mut v8::HandleScope,
+ scope: &mut v8::PinScope,
state: &OpState,
#[string] url: &str,
#[string] html: &str,
@@ -5139,7 +5139,7 @@ fn op_async_runtime_available() -> bool {
fn op_posted_task(
state: &OpState,
frame_id: u32,
- #[global] callback: v8::Global<v8::Function>,
+ #[scoped] callback: v8::Global<v8::Function>,
) -> f64 {
let Some(owner) = posted_task_owner(state, frame_id) else {
return INVALID_POSTED_TASK_GENERATION;
@@ -5158,7 +5158,7 @@ fn op_posted_task(
}
PostedTaskOwnerStatus::Generation(generation) => generation as f64,
};
- let scope = &mut v8::TryCatch::new(scope);
+ v8::tc_scope!(let scope, scope);
let callback = v8::Local::new(scope, callback);
let receiver = v8::undefined(scope).into();
let current_generation = v8::Number::new(scope, current_generation);
@@ -6694,7 +6694,7 @@ fn finish_async_image_metadata(
/// navigation/URL/profile share one fetch, and completion revalidates both the
/// document identity and responsive candidate before exposing lifecycle state.
#[cfg(feature = "render")]
-#[op2(async)]
+#[op2]
#[string]
async fn op_load_image_metadata(state: Rc<RefCell<OpState>>, nid: u32) -> String {
let shared = {
diff --git a/crates/obscura-js/src/runtime.rs b/crates/obscura-js/src/runtime.rs
index df79199c..6e5fd0c8 100644
--- a/crates/obscura-js/src/runtime.rs
+++ b/crates/obscura-js/src/runtime.rs
@@ -6,7 +6,7 @@ use std::pin::Pin;
use std::rc::Rc;
use std::task::{Context, Poll};
-use deno_core::{JsRuntime, RuntimeOptions};
+use deno_core::{v8, JsRuntime, RuntimeOptions};
use obscura_dom::{DomTree, NodeId};
#[cfg(feature = "render")]
use obscura_net::{RequestCredentials, RequestMode, ResourceRequest};
@@ -59,6 +59,31 @@ static SNAPSHOT: &[u8] = include_bytes!(env!("OBSCURA_SNAPSHOT_PATH"));
/// parallel, each isolate on its own thread with no shared lock.
static ISOLATE_CREATE_LOCK: std::sync::Mutex<()> = std::sync::Mutex::new(());
+/// Enter a tokio runtime context when the caller is not already in one.
+///
+/// deno_core registers each isolate with the tokio handle current at
+/// `JsRuntime::new` time and aborts the process if V8 posts a delayed
+/// foreground task (GC memory reducer, idle tasks) while no handle is
+/// registered. Normal callers (CLI, CDP, MCP) run inside tokio, but plain
+/// `#[test]`s and non-tokio embedders do not, so fall back to a
+/// process-wide single-worker runtime kept alive for the whole process.
+/// The guard must stay in scope across `JsRuntime::new`; the registered
+/// handle outlives it.
+fn enter_tokio_context() -> Option<tokio::runtime::EnterGuard<'static>> {
+ if tokio::runtime::Handle::try_current().is_ok() {
+ return None;
+ }
+ static FALLBACK: std::sync::LazyLock<tokio::runtime::Runtime> =
+ std::sync::LazyLock::new(|| {
+ tokio::runtime::Builder::new_multi_thread()
+ .worker_threads(1)
+ .enable_time()
+ .build()
+ .expect("fallback tokio runtime")
+ });
+ Some(FALLBACK.enter())
+}
+
const DEFAULT_CDP_AWAIT_TIMEOUT_MS: u64 = 30_000;
const HEAP_LIMIT_RECOVERY_HEADROOM_BYTES: usize = 64 * 1024 * 1024;
#[cfg(feature = "render")]
@@ -219,7 +244,7 @@ pub struct ObscuraJsRuntime {
/// Renders a caught V8 exception as a message for realm evaluation errors.
fn exception_text(
- scope: &mut deno_core::v8::TryCatch<'_, deno_core::v8::HandleScope<'_>>,
+ scope: &mut v8::PinnedRef<'_, v8::TryCatch<'_, '_, v8::HandleScope<'_>>>,
) -> String {
match scope.exception() {
Some(exception) => exception.to_rust_string_lossy(scope),
@@ -546,6 +571,10 @@ impl ObscuraJsRuntime {
// Build the isolate under the process-wide creation lock so two
// connection threads never construct isolates concurrently (#430).
let (runtime, isolate_handle, heap_limit_state) = {
+ // Keep the guard alive for the whole construction: deno_core
+ // captures the current tokio handle at `JsRuntime::new` time and
+ // aborts if a V8 delayed task is posted without one.
+ let _tokio_guard = enter_tokio_context();
let _create_guard = ISOLATE_CREATE_LOCK
.lock()
.unwrap_or_else(|poisoned| poisoned.into_inner());
@@ -586,7 +615,7 @@ impl ObscuraJsRuntime {
runtime
.execute_script(
"<obscura:init>",
- "globalThis.__obscura_objects = {}; globalThis.__obscura_oid = 0;".to_string(),
+ "globalThis.__obscura_objects = {}; globalThis.__obscura_oid = 0; if (typeof _installWasmStreamingFallback === 'function') _installWasmStreamingFallback();".to_string(),
)
.expect("init should not fail");
@@ -644,7 +673,7 @@ impl ObscuraJsRuntime {
let context = {
let mut entered = self.runtime();
let isolate = entered.v8_isolate();
- let scope = &mut deno_core::v8::HandleScope::new(isolate);
+ deno_core::v8::scope!(let scope, isolate);
let context = deno_core::v8::Context::from_snapshot(
scope,
1,
@@ -674,7 +703,7 @@ impl ObscuraJsRuntime {
let main = self.runtime().main_context();
let mut entered = self.runtime();
let isolate = entered.v8_isolate();
- let scope = &mut v8::HandleScope::new(isolate);
+ v8::scope!(let scope, isolate);
let context = v8::Local::new(scope, main);
let scope = &mut v8::ContextScope::new(scope, context);
@@ -707,7 +736,7 @@ impl ObscuraJsRuntime {
let main = self.runtime().main_context();
let mut entered = self.runtime();
let isolate = entered.v8_isolate();
- let scope = &mut v8::HandleScope::new(isolate);
+ v8::scope!(let scope, isolate);
let context = v8::Local::new(scope, main);
let scope = &mut v8::ContextScope::new(scope, context);
let Some(key) = v8::String::new(scope, "__obscura_test_ops") else {
@@ -746,7 +775,7 @@ impl ObscuraJsRuntime {
let main = self.runtime().main_context();
let mut entered = self.runtime();
let isolate = entered.v8_isolate();
- let scope = &mut v8::HandleScope::new(isolate);
+ v8::scope!(let scope, isolate);
let main_ctx = v8::Local::new(scope, main);
let realm_ctx = v8::Local::new(scope, realm);
// SAFETY: these slots on the main context are `Rc::into_raw` pointers
@@ -772,7 +801,7 @@ impl ObscuraJsRuntime {
};
let mut entered = self.runtime();
let isolate = entered.v8_isolate();
- let scope = &mut v8::HandleScope::new(isolate);
+ v8::scope!(let scope, isolate);
let context = v8::Local::new(scope, realm);
let scope = &mut v8::ContextScope::new(scope, context);
@@ -837,19 +866,19 @@ impl ObscuraJsRuntime {
let mut entered = self.runtime();
let isolate = entered.v8_isolate();
- let scope = &mut v8::HandleScope::new(isolate);
+ v8::scope!(let scope, isolate);
let context = v8::Local::new(scope, realm);
let scope = &mut v8::ContextScope::new(scope, context);
- let scope = &mut v8::TryCatch::new(scope);
+ v8::tc_scope!(let tc_scope, scope);
- let code = v8::String::new(scope, source).ok_or("source too large")?;
- let script = match v8::Script::compile(scope, code, None) {
+ let code = v8::String::new(tc_scope, source).ok_or("source too large")?;
+ let script = match v8::Script::compile(tc_scope, code, None) {
Some(script) => script,
- None => return Err(exception_text(scope)),
+ None => return Err(exception_text(tc_scope)),
};
- match script.run(scope) {
- Some(value) => Ok(value.to_rust_string_lossy(scope)),
- None => Err(exception_text(scope)),
+ match script.run(tc_scope) {
+ Some(value) => Ok(value.to_rust_string_lossy(tc_scope)),
+ None => Err(exception_text(tc_scope)),
}
}
@@ -879,7 +908,7 @@ impl ObscuraJsRuntime {
let main = self.runtime().main_context();
let mut entered = self.runtime();
let isolate = entered.v8_isolate();
- let scope = &mut v8::HandleScope::new(isolate);
+ v8::scope!(let scope, isolate);
let main_context = v8::Local::new(scope, main);
let mut carried = Vec::new();
@@ -964,7 +993,7 @@ impl ObscuraJsRuntime {
let main = self.runtime().main_context();
let mut entered = self.runtime();
let isolate = entered.v8_isolate();
- let scope = &mut v8::HandleScope::new(isolate);
+ v8::scope!(let scope, isolate);
let main = v8::Local::new(scope, main);
let realm = v8::Local::new(scope, realm);
let token = main.get_security_token(scope);
@@ -990,7 +1019,7 @@ impl ObscuraJsRuntime {
let main = self.runtime().main_context();
let mut entered = self.runtime();
let isolate = entered.v8_isolate();
- let scope = &mut v8::HandleScope::new(isolate);
+ v8::scope!(let scope, isolate);
// Read the frame's globals first, then install them in the page realm.
// Both contexts belong to this isolate, so the handles stay valid
@@ -3115,9 +3144,13 @@ impl ObscuraJsRuntime {
// &'static str. Browser script URLs are runtime data, and V8 uses this
// origin as import()'s referrer, so compile in the runtime's main
// context directly instead of substituting the fixed "<script>" name.
- let result: Result<(), (String, Option<deno_core::error::JsError>)> = (|| {
+ let result: Result<(), (String, Option<Box<deno_core::error::JsError>>)> = (|| {
let mut entered = self.runtime();
- let scope = &mut entered.handle_scope();
+ let context = entered.main_context();
+ let isolate = entered.v8_isolate();
+ v8::scope!(let scope, isolate);
+ let context = v8::Local::new(scope, context);
+ let scope = &mut v8::ContextScope::new(scope, context);
let source = deno_core::v8::String::new(scope, source)
.ok_or_else(|| ("JS error: source allocation failed".to_string(), None))?;
let name = deno_core::v8::String::new(scope, name)
@@ -3135,16 +3168,16 @@ impl ObscuraJsRuntime {
false,
None,
);
- let scope = &mut deno_core::v8::TryCatch::new(scope);
- let script = deno_core::v8::Script::compile(scope, source, Some(&origin));
+ v8::tc_scope!(let tc_scope, scope);
+ let script = deno_core::v8::Script::compile(tc_scope, source, Some(&origin));
let Some(script) = script else {
- if scope.is_execution_terminating() {
- scope.cancel_terminate_execution();
+ if tc_scope.is_execution_terminating() {
+ tc_scope.cancel_terminate_execution();
return Err(("JS error: Uncaught Error: execution terminated".to_string(), None));
}
- return match scope.exception() {
+ return match tc_scope.exception() {
Some(exception) => {
- let error = deno_core::error::JsError::from_v8_exception(scope, exception);
+ let error = deno_core::error::JsError::from_v8_exception(tc_scope, exception);
Err((format!("JS error: {error}"), Some(error)))
}
None => Err((
@@ -3153,14 +3186,14 @@ impl ObscuraJsRuntime {
)),
};
};
- if script.run(scope).is_none() {
- if scope.is_execution_terminating() {
- scope.cancel_terminate_execution();
+ if script.run(tc_scope).is_none() {
+ if tc_scope.is_execution_terminating() {
+ tc_scope.cancel_terminate_execution();
return Err(("JS error: Uncaught Error: execution terminated".to_string(), None));
}
- return match scope.exception() {
+ return match tc_scope.exception() {
Some(exception) => {
- let error = deno_core::error::JsError::from_v8_exception(scope, exception);
+ let error = deno_core::error::JsError::from_v8_exception(tc_scope, exception);
Err((format!("JS error: {error}"), Some(error)))
}
None => Err((
@@ -3169,6 +3202,10 @@ impl ObscuraJsRuntime {
)),
};
}
+ // A browser runs the microtask checkpoint at the end of each task.
+ // queueMicrotask/observer delivery from this script is observable
+ // to the caller (canvas damage, resize/intersection bookkeeping).
+ tc_scope.perform_microtask_checkpoint();
Ok(())
})();
let result = match result {
@@ -4062,7 +4099,8 @@ impl ObscuraJsRuntime {
result: deno_core::v8::Global<deno_core::v8::Value>,
) -> Result<serde_json::Value, String> {
let mut entered = self.runtime();
- let scope = &mut entered.handle_scope();
+ let context = entered.main_context();
+ v8::scope_with_context!(scope, entered.v8_isolate(), context);
let local = deno_core::v8::Local::new(scope, result);
if local.is_undefined() || local.is_null() {
@@ -4112,7 +4150,8 @@ impl ObscuraJsRuntime {
// JSON collapses undefined into null. Classify it before serialization.
let is_undefined = {
let mut entered = self.runtime();
- let scope = &mut entered.handle_scope();
+ let isolate = entered.v8_isolate();
+ deno_core::v8::scope!(let scope, isolate);
deno_core::v8::Local::new(scope, &result).is_undefined()
};
if is_undefined {
@@ -4659,8 +4698,8 @@ mod tests {
);
}
- #[test]
- fn document_domain_getter_and_valid_relaxation_match_effective_host() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn document_domain_getter_and_valid_relaxation_match_effective_host() {
let dom = parse_html("<html><body></body></html>");
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(dom);
@@ -4691,8 +4730,8 @@ mod tests {
);
}
- #[test]
- fn document_domain_rejects_unrelated_child_and_public_suffix_hosts() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn document_domain_rejects_unrelated_child_and_public_suffix_hosts() {
let dom = parse_html("<html><body></body></html>");
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(dom);
@@ -4725,8 +4764,8 @@ mod tests {
);
}
- #[test]
- fn document_domain_detached_and_hostless_setters_throw_security_error() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn document_domain_detached_and_hostless_setters_throw_security_error() {
let mut rt = setup_runtime("<html><body></body></html>");
assert_eq!(
rt.evaluate(
@@ -5649,8 +5688,8 @@ mod tests {
);
}
- #[test]
- fn performance_now_does_not_outrun_elapsed_time() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn performance_now_does_not_outrun_elapsed_time() {
let mut rt = setup_runtime("<html><body></body></html>");
let lead = rt
.evaluate(
@@ -6936,8 +6975,8 @@ mod tests {
);
}
- #[test]
- fn explicit_viewport_is_distinct_from_fingerprinted_screen() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn explicit_viewport_is_distinct_from_fingerprinted_screen() {
let dom = parse_html("<html><body></body></html>");
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(dom);
@@ -6955,8 +6994,8 @@ mod tests {
);
}
- #[test]
- fn screen_override_is_independent_live_and_preserves_screen_identity() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn screen_override_is_independent_live_and_preserves_screen_identity() {
let dom = parse_html("<html><body></body></html>");
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(dom);
@@ -6992,8 +7031,8 @@ mod tests {
);
}
- #[test]
- fn match_media_evaluates_query_lists_conjunctions_ranges_and_orientation() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn match_media_evaluates_query_lists_conjunctions_ranges_and_orientation() {
let dom = parse_html("<html><body></body></html>");
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(dom);
@@ -7024,8 +7063,8 @@ mod tests {
);
}
- #[test]
- fn match_media_matches_are_live_across_viewport_resizes() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn match_media_matches_are_live_across_viewport_resizes() {
let dom = parse_html("<html><body></body></html>");
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(dom);
@@ -7140,8 +7179,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn ordinary_inline_keeps_computed_sizes_but_uses_content_geometry() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn ordinary_inline_keeps_computed_sizes_but_uses_content_geometry() {
let dom = parse_html(
r#"<html><head><style>
html,body,p { margin:0 }
@@ -7251,8 +7290,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn computed_style_uses_renderer_stylesheet_cascade_and_invalidates() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn computed_style_uses_renderer_stylesheet_cascade_and_invalidates() {
let dom = parse_html(
r#"<html><head><style>
.base {
@@ -7342,8 +7381,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn webkit_truncation_computed_names_use_native_support_and_vendor_prefixes() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn webkit_truncation_computed_names_use_native_support_and_vendor_prefixes() {
let dom = parse_html(
r#"<html><head><style>
#clamp { display:-webkit-box; -webkit-box-orient:vertical;
@@ -7391,8 +7430,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn computed_typography_uses_resolved_renderer_values() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn computed_typography_uses_resolved_renderer_values() {
let dom = parse_html(
r#"<html><head><style>
#parent {
@@ -7434,8 +7473,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn computed_style_exposes_cascaded_custom_properties_and_invalidates() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn computed_style_exposes_cascaded_custom_properties_and_invalidates() {
let dom = parse_html(
r#"<html><head><style>
:root { --inherited-space: 17px; --derived-space: var(--inherited-space); }
@@ -7600,14 +7639,26 @@ mod tests {
rt.evaluate("globalThis.__outerTimerRan").unwrap(),
serde_json::json!(true),
);
- rt.run_autonomous_event_loop_turn().await.unwrap();
- for _ in 0..5 {
+ let mut ticks = 0.0;
+ for _ in 0..12 {
rt.run_autonomous_event_loop_turn().await.unwrap();
+ let next = rt
+ .evaluate("globalThis.__zeroIntervalTicks")
+ .unwrap()
+ .as_f64()
+ .unwrap();
+ assert!(
+ next <= ticks + 1.0,
+ "a repeating timer must yield between ticks: {ticks} -> {next}",
+ );
+ ticks = next;
+ if ticks == 6.0 {
+ break;
+ }
}
assert_eq!(
- rt.evaluate("globalThis.__zeroIntervalTicks").unwrap(),
- serde_json::json!(6.0),
- "the repeating timer must make one tick of progress per event-loop turn",
+ ticks, 6.0,
+ "V8 maintenance wakes must not starve the repeating timer",
);
rt.execute_script("clear-zero-interval", "clearInterval(globalThis.__zeroInterval)")
.unwrap();
@@ -9269,8 +9320,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn rendered_window_scroll_clamps_and_geometry_is_viewport_relative() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn rendered_window_scroll_clamps_and_geometry_is_viewport_relative() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<div id="wide" style="width:600px;height:700px"></div>
@@ -9343,8 +9394,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn nested_scroll_metrics_geometry_pixels_and_relayout_share_one_state() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn nested_scroll_metrics_geometry_pixels_and_relayout_share_one_state() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<div id="outer" style="box-sizing:border-box;width:120px;height:100px;
@@ -9466,8 +9517,8 @@ mod tests {
/// box includes trailing padding. A clip boundary suppresses propagation
/// only on its clipped axis, and ordinary inline boxes expose zero metrics.
#[cfg(feature = "render")]
- #[test]
- fn element_scroll_metrics_match_chromium_overflow_oracles() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn element_scroll_metrics_match_chromium_overflow_oracles() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<style>
@@ -9528,8 +9579,8 @@ mod tests {
/// 100.4px area cannot move a 100px scrollport, while 100.6px rounds to a
/// one-pixel range and assigning `.5` moves geometry and paint by 1px.
#[cfg(feature = "render")]
- #[test]
- fn fractional_scroll_ranges_quantize_geometry_and_pixels_at_one_x() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn fractional_scroll_ranges_quantize_geometry_and_pixels_at_one_x() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<div id="low" style="width:100px;height:40px;overflow:auto;position:absolute;top:0">
@@ -9619,8 +9670,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn element_scroll_offsets_follow_chromium_box_and_dom_lifecycles() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn element_scroll_offsets_follow_chromium_box_and_dom_lifecycles() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<div id="first"><div id="scroller" style="width:100px;height:80px;overflow:auto">
@@ -9689,8 +9740,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn fixed_panels_scroll_locally_and_transformed_descendants_remain_supported() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn fixed_panels_scroll_locally_and_transformed_descendants_remain_supported() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0;height:1800px">
<div id="modal" style="position:fixed;left:20px;top:20px;width:140px;height:120px;background:red">
@@ -9757,8 +9808,8 @@ mod tests {
/// clientHeight; the old synthetic 100x20 fallback collapsed all of their
/// viewport-relative trigger ranges.
#[cfg(feature = "render")]
- #[test]
- fn rendered_client_metrics_use_the_live_padding_box() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn rendered_client_metrics_use_the_live_padding_box() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<div id="tracker"
@@ -9853,8 +9904,8 @@ mod tests {
/// bounding rect and no client rects for display:none/detached elements;
/// a laid-out zero-size box still contributes one client rect.
#[cfg(feature = "render")]
- #[test]
- fn rendered_cssom_rects_distinguish_no_box_from_zero_size_box() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn rendered_cssom_rects_distinguish_no_box_from_zero_size_box() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<div id="hidden" style="display:none;width:80px;height:40px"></div>
@@ -9942,8 +9993,8 @@ mod tests {
/// verifies subtree movement, bottom-only sticking, and the containing
/// block's lower boundary without depending on a live site.
#[cfg(feature = "render")]
- #[test]
- fn root_scroll_sticky_geometry_matches_chromium_constraints() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn root_scroll_sticky_geometry_matches_chromium_constraints() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<div style="height:40px"></div>
@@ -10016,8 +10067,8 @@ mod tests {
/// the sticky subtree pins at x=20, remains distinct from fixed, then
/// leaves with its 500px containing block at the right boundary.
#[cfg(feature = "render")]
- #[test]
- fn root_scroll_sticky_supports_the_inline_axis() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn root_scroll_sticky_supports_the_inline_axis() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<div style="box-sizing:border-box;margin-left:40px;width:500px;height:100px;padding:10px;border:4px solid">
@@ -10072,8 +10123,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn prepared_render_shares_resource_geometry_with_cssom_and_screenshots() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn prepared_render_shares_resource_geometry_with_cssom_and_screenshots() {
let dom = parse_html(
r#"<html style="margin:0"><head>
<base href="/assets/">
@@ -10268,8 +10319,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn image_resource_arrival_retains_styles_and_rebuilds_intrinsic_geometry() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn image_resource_arrival_retains_styles_and_rebuilds_intrinsic_geometry() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<img id="hero" src="http://example.test/late.png" style="display:block">
@@ -10344,8 +10395,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn fixed_image_resource_arrival_repaints_without_rebuilding_geometry() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn fixed_image_resource_arrival_repaints_without_rebuilding_geometry() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<img id="hero" src="http://example.test/fixed.png"
@@ -10410,8 +10461,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn fixed_flex_image_resource_arrival_still_rebuilds_geometry() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn fixed_flex_image_resource_arrival_still_rebuilds_geometry() {
let dom = parse_html(
r#"<html><body><div style="display:flex">
<img id="hero" src="http://example.test/flex.png"
@@ -10442,8 +10493,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn fixed_css_content_image_arrival_still_rebuilds_intrinsic_geometry() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn fixed_css_content_image_arrival_still_rebuilds_intrinsic_geometry() {
let dom = parse_html(
r#"<html><body><img id="hero" src="fallback.png"
style="display:block;width:20px;height:10px;content:url('http://example.test/content.png')">
@@ -10473,8 +10524,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn document_region_capture_preserves_live_runtime_state_and_resource_cache() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn document_region_capture_preserves_live_runtime_state_and_resource_cache() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0;height:260px">
<div style="height:120px;background:red"></div>
@@ -10655,8 +10706,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn rendered_layout_cache_is_invalidated_by_style_mutations() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn rendered_layout_cache_is_invalidated_by_style_mutations() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<div id="box" style="height:300px;width:40px"></div>
@@ -10695,8 +10746,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn element_text_content_replacement_recomputes_empty_selector() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn element_text_content_replacement_recomputes_empty_selector() {
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(parse_html(
r#"<style>#x { width: 10px; height: 5px } #x:empty { width: 30px }</style>
@@ -10719,8 +10770,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn prepared_render_survives_detached_no_op_and_same_viewport_updates() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn prepared_render_survives_detached_no_op_and_same_viewport_updates() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<div id="box" class="box" style="height:30px;width:40px"></div>
@@ -10895,8 +10946,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn forward_animation_samples_retain_static_prepared_render() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn forward_animation_samples_retain_static_prepared_render() {
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(parse_html(
r#"<html style="margin:0"><body style="margin:0">
@@ -10934,8 +10985,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn forward_active_animation_sample_updates_geometry_and_paint_from_retained_frame() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn forward_active_animation_sample_updates_geometry_and_paint_from_retained_frame() {
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(parse_html(
r#"<html style="margin:0"><head><style>
@@ -11084,8 +11135,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn completed_animation_retains_forward_frame_but_backward_seek_rebuilds() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn completed_animation_retains_forward_frame_but_backward_seek_rebuilds() {
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(parse_html(
r#"<html style="margin:0"><head><style>
@@ -11142,8 +11193,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn unsupported_custom_property_animation_does_not_keep_render_damage_active() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn unsupported_custom_property_animation_does_not_keep_render_damage_active() {
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(parse_html(
r#"<html style="margin:0"><head><style>
@@ -11298,8 +11349,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn cssom_geometry_samples_live_document_time() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn cssom_geometry_samples_live_document_time() {
let mut rt = animation_epoch_runtime();
rt.evaluate("var box=document.createElement('div');box.id='box';box.className='anim';document.body.appendChild(box)")
.unwrap();
@@ -11318,8 +11369,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn fixed_animation_capture_is_invariant_after_geometry_flush() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn fixed_animation_capture_is_invariant_after_geometry_flush() {
let make_runtime = || {
let mut rt = ObscuraJsRuntime::new();
rt.set_dom(parse_html(
@@ -11417,8 +11468,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn autocomplete_attribute_retains_prepared_render_until_geometry_flush() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn autocomplete_attribute_retains_prepared_render_until_geometry_flush() {
let dom = parse_html(
r#"<html style="margin:0"><head><style>
input { display:block; width:40px; height:20px }
@@ -11469,8 +11520,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn namespaced_attribute_mutations_participate_in_id_and_render_invalidation() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn namespaced_attribute_mutations_participate_in_id_and_render_invalidation() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0"><div id="box" class="box" style="height:30px;width:40px"></div></body></html>"#,
);
@@ -11520,8 +11571,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn stylesheet_index_cache_reuses_sources_but_not_live_cascade_or_viewport() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn stylesheet_index_cache_reuses_sources_but_not_live_cascade_or_viewport() {
let dom = parse_html(
r#"<html style="margin:0"><head><style id="sheet">
.a { width:40px; height:20px }
@@ -11602,8 +11653,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn connected_tree_mutations_queue_retained_styles_until_geometry_flush() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn connected_tree_mutations_queue_retained_styles_until_geometry_flush() {
let dom = parse_html(
r#"<html style="margin:0"><head><style>
.item{display:block;width:40px;height:12px}
@@ -11694,8 +11745,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn root_overflow_clip_preserves_cssom_scroll_range() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn root_overflow_clip_preserves_cssom_scroll_range() {
let dom = parse_html(
r#"<html style="margin:0;height:100%;overflow:hidden">
<body style="margin:0;height:100%">
@@ -12872,8 +12923,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn scroll_into_view_aligns_the_root_viewport_and_clamps() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn scroll_into_view_aligns_the_root_viewport_and_clamps() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0">
<div style="height:300px"></div>
@@ -13219,8 +13270,8 @@ mod tests {
assert_eq!(result, serde_json::json!([true, true, 1, 1]));
}
- #[test]
- fn atob_decodes_large_payload_without_argument_stack_overflow() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn atob_decodes_large_payload_without_argument_stack_overflow() {
let mut rt = setup_runtime("<html><body></body></html>");
// 60k four-character groups decode to 180k bytes, comfortably above
// V8's maximum argument count for a single fromCharCode(...bytes).
@@ -13599,8 +13650,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn shadow_adopted_stylesheets_apply_and_sync_the_live_cascade() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn shadow_adopted_stylesheets_apply_and_sync_the_live_cascade() {
let mut rt = setup_runtime(
r#"<html style="margin:0"><head>
<style>.target { width:11px; height:10px }</style>
@@ -13695,8 +13746,8 @@ mod tests {
}
#[cfg(feature = "render")]
- #[test]
- fn canvas_2d_live_backing_paints_immediately_with_scaling_clips_and_effects() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn canvas_2d_live_backing_paints_immediately_with_scaling_clips_and_effects() {
let dom = parse_html(
r#"<html style="margin:0"><body style="margin:0;width:64px;height:40px;background:#0000ff">
<div style="position:absolute;left:4px;top:4px;width:18px;height:14px;overflow:hidden">
@@ -14188,8 +14239,8 @@ mod tests {
/// Regression for #105: `document.forms` / `images` / `links` must be
/// live, not hardcoded `[]`. jQuery 1.x's submit-event setup iterates
/// `document.forms` and crashes when it's empty for pages that have forms.
- #[test]
- fn document_forms_images_links_are_live() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn document_forms_images_links_are_live() {
let mut rt =
setup_runtime(r#"<form></form><form></form><img><a href="x">l</a><a>no-href</a>"#);
assert_eq!(
@@ -16221,8 +16272,8 @@ mod tests {
assert_eq!(bio, serde_json::json!("old text"));
}
- #[test]
- fn test_sequential_runtime_swap() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn test_sequential_runtime_swap() {
let mut rt1 = setup_runtime("<html><body><h1>Page1</h1></body></html>");
let title1 = rt1
.evaluate("document.querySelector('h1').textContent")
@@ -19016,8 +19067,8 @@ mod tests {
);
}
- #[test]
- fn heap_limit_terminates_script_and_runtime_recovers() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn heap_limit_terminates_script_and_runtime_recovers() {
crate::v8_flags::set_v8_flags("--max-old-space-size=32 --max-semi-space-size=1");
let mut rt = ObscuraJsRuntime::new();
@@ -19396,8 +19447,8 @@ mod tests {
assert_eq!(request_thread.join().unwrap(), "/scoped.js");
}
- #[test]
- fn timed_out_classic_script_leaves_runtime_reusable() {
+ #[tokio::test(flavor = "current_thread")]
+ async fn timed_out_classic_script_leaves_runtime_reusable() {
let mut rt = ObscuraJsRuntime::new();
rt.execute_script_with_timeout(
"https://example.test/hang.js",
diff --git a/deny.toml b/deny.toml
index dc28f6a8..6dca1896 100644
--- a/deny.toml
+++ b/deny.toml
@@ -6,13 +6,8 @@
# notices for transitive crates with no available fix; they are explicitly
# accepted until the upstream parents drop them.
ignore = [
- "RUSTSEC-2025-0141", # bincode 1.x unmaintained, transitive via deno_core
"RUSTSEC-2025-0057", # fxhash unmaintained, transitive via selectors
"RUSTSEC-2024-0436", # paste unmaintained, transitive via v8
- # These rendering dependencies have no safe upgrade yet. Keep their
- # unmaintained notices explicit so vulnerability advisories still fail.
- "RUSTSEC-2026-0206", # rustybuzz, transitive via cosmic-text and usvg
- "RUSTSEC-2026-0192", # ttf-parser, transitive via rendering dependencies
]
[bans]