rusteerio 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/native/src/snapshot.rs +27 -9
- package/package.json +1 -1
- package/rusteerio.darwin-arm64.node +0 -0
- package/rusteerio.darwin-x64.node +0 -0
- package/rusteerio.linux-arm64-gnu.node +0 -0
- package/rusteerio.linux-arm64-musl.node +0 -0
- package/rusteerio.linux-x64-gnu.node +0 -0
- package/rusteerio.linux-x64-musl.node +0 -0
- package/rusteerio.win32-arm64-msvc.node +0 -0
- package/rusteerio.win32-x64-msvc.node +0 -0
package/Cargo.lock
CHANGED
package/Cargo.toml
CHANGED
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -4,7 +4,7 @@ This file preserves third-party license and attribution notices for the Rust nat
|
|
|
4
4
|
|
|
5
5
|
Generated by `node scripts/generate-notices.mjs` from `cargo metadata --locked`, crate license files, and the pinned supplemental sources recorded in `scripts/notices/sources.json`. It includes build dependencies and dependencies for all target platforms; a particular binary may use a subset. Identical notice texts are reproduced once and referenced below. The html5ever, markup5ever and html5gum crates contain local observer-hook and opt-in UTF-16 transport patches; their complete patched source and original notices are included in `native/vendor`. Other dependency source files are unmodified.
|
|
6
6
|
|
|
7
|
-
Cargo.lock SHA-256: `
|
|
7
|
+
Cargo.lock SHA-256: `db632d8fb3f5612f4e34f742fdde2b58d27cd17b7132583c28f183f00005ae19`.
|
|
8
8
|
|
|
9
9
|
## Source availability
|
|
10
10
|
|
package/native/src/snapshot.rs
CHANGED
|
@@ -24,8 +24,9 @@ use crate::id_hash::IdMap;
|
|
|
24
24
|
use crate::NativeDocument;
|
|
25
25
|
|
|
26
26
|
pub(crate) const STRIDE: usize = 15;
|
|
27
|
-
/// Text longer than this
|
|
28
|
-
/// scripts
|
|
27
|
+
/// Text or attribute values longer than this stay out of snapshots: such
|
|
28
|
+
/// nodes, mostly inline scripts, styles, SVG paths and embedded data, are read
|
|
29
|
+
/// individually if JavaScript asks for them.
|
|
29
30
|
const LARGE_TEXT_BYTES: usize = 4096;
|
|
30
31
|
const ABSENT: u32 = u32::MAX;
|
|
31
32
|
const HAS_START_INDEX: u32 = 1;
|
|
@@ -297,8 +298,17 @@ impl Builder {
|
|
|
297
298
|
None => {}
|
|
298
299
|
}
|
|
299
300
|
fields[8] = (self.attributes.len() / 2) as u32;
|
|
300
|
-
|
|
301
|
-
|
|
301
|
+
let has_large_attribute = node.attribs.values().any(|value| {
|
|
302
|
+
value
|
|
303
|
+
.as_str()
|
|
304
|
+
.is_some_and(|value| value.len() > LARGE_TEXT_BYTES)
|
|
305
|
+
});
|
|
306
|
+
if has_large_attribute {
|
|
307
|
+
flags |= OPAQUE;
|
|
308
|
+
} else {
|
|
309
|
+
fields[9] = node.attribs.len() as u32;
|
|
310
|
+
}
|
|
311
|
+
for (name, value) in node.attribs.iter().filter(|_| !has_large_attribute) {
|
|
302
312
|
let Some(value) = value.as_str() else {
|
|
303
313
|
flags |= OPAQUE;
|
|
304
314
|
break;
|
|
@@ -454,12 +464,20 @@ impl Builder {
|
|
|
454
464
|
_ => tag_type,
|
|
455
465
|
};
|
|
456
466
|
fields[6] = self.local_name(&element.name.local) + 1;
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
467
|
+
if element
|
|
468
|
+
.attrs
|
|
469
|
+
.iter()
|
|
470
|
+
.any(|(_, value)| value.len() > LARGE_TEXT_BYTES)
|
|
471
|
+
{
|
|
472
|
+
flags |= OPAQUE;
|
|
473
|
+
} else {
|
|
474
|
+
for (attribute, value) in &element.attrs {
|
|
475
|
+
let attribute = self.local_name(&attribute.local);
|
|
476
|
+
let value = self.string(value);
|
|
477
|
+
self.attributes.extend_from_slice(&[attribute, value]);
|
|
478
|
+
}
|
|
479
|
+
fields[9] = element.attrs.len() as u32;
|
|
461
480
|
}
|
|
462
|
-
fields[9] = element.attrs.len() as u32;
|
|
463
481
|
fields[13] = self.namespace(&element.name.ns);
|
|
464
482
|
flags |= HAS_NAMESPACE | EMPTY_ATTRIBUTE_MAPS;
|
|
465
483
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|