Skip to content

Commit e81220f

Browse files
chore: Move xml code from core to ruffle_common
1 parent 5cc9392 commit e81220f

File tree

10 files changed

+13
-6
lines changed

10 files changed

+13
-6
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ num-traits = "0.2.19"
7575
serde = "1.0.228"
7676
thiserror = "2.0.17"
7777
url = "2.5.7"
78+
quick-xml = "0.37.5"
79+
regress = { git = "https://github.com/ruffle-rs/regras3", rev = "5fcb02513c5ab4e00df4346459f5a8d0521d8fed" }
7880
# Make sure to match wasm-bindgen-cli version to this everywhere.
7981
wasm-bindgen = "=0.2.101"
8082
walkdir = "2.5.0"

core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ bitflags = { workspace = true }
3030
smallvec = { workspace = true }
3131
num-traits = { workspace = true }
3232
num-derive = { workspace = true }
33-
quick-xml = "0.37.5"
33+
quick-xml = { workspace = true }
3434
url = { workspace = true }
3535
weak-table = "0.3.2"
3636
percent-encoding = { workspace = true }
@@ -42,7 +42,7 @@ rand = { version = "0.9.1", features = ["std", "os_rng"], default-features = fal
4242
serde = { workspace = true }
4343
serde_json = { workspace = true, features = ["preserve_order"] }
4444
nellymoser-rs = { git = "https://github.com/ruffle-rs/nellymoser", rev = "073eb48d907201f46dea0c8feb4e8d9a1d92208c", optional = true }
45-
regress = { git = "https://github.com/ruffle-rs/regras3", rev = "5fcb02513c5ab4e00df4346459f5a8d0521d8fed" }
45+
regress = { workspace = true }
4646
flash-lso = { git = "https://github.com/ruffle-rs/rust-flash-lso", rev = "998f47c926b9986aabd518fbb7394ff56936d0b0" }
4747
lzma-rs = { workspace = true, optional = true }
4848
dasp = { version = "0.11.0", features = ["interpolate", "interpolate-linear", "signal"], optional = true }

core/common/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ workspace = true
1414
hashbrown = { workspace = true }
1515
fnv = { workspace = true }
1616
gc-arena = { workspace = true }
17+
quick-xml = { workspace = true }
18+
regress = { workspace = true }
1719
ruffle_macros = { path = "../macros" }
1820
ruffle_wstr = { path = "../../wstr" }
1921
swf = { path = "../../swf" }

core/common/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ pub mod avm_string;
44
pub mod buffer;
55
pub mod sandbox;
66
pub mod utils;
7+
pub mod xml;
File renamed without changes.

core/src/avm1/globals/xml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ use crate::avm1::{Activation, Attribute, Error, NativeObject, Object, Value};
99
use crate::avm_warn;
1010
use crate::backend::navigator::Request;
1111
use crate::string::{AvmString, StringContext, WStr, WString};
12-
use crate::xml::custom_unescape;
1312
use gc_arena::barrier::unlock;
1413
use gc_arena::lock::Lock;
1514
use gc_arena::{Collect, Gc};
1615
use quick_xml::errors::IllFormedError;
1716
use quick_xml::events::attributes::AttrError;
1817
use quick_xml::{events::Event, Reader};
18+
use ruffle_common::xml::custom_unescape;
1919
use ruffle_macros::istr;
2020

2121
#[derive(Clone, Copy, Collect)]

core/src/avm1/xml/tree.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use gc_arena::{
1010
};
1111
use quick_xml::escape::escape;
1212
use quick_xml::events::BytesStart;
13+
use ruffle_common::xml::custom_unescape;
1314
use ruffle_macros::istr;
1415
use std::cell::RefMut;
1516
use std::fmt;
@@ -92,7 +93,7 @@ impl<'gc> XmlNode<'gc> {
9293
let attributes = attributes?;
9394
for attribute in attributes.iter().rev() {
9495
let key = AvmString::new_utf8_bytes(activation.gc(), attribute.key.into_inner());
95-
let value_str = crate::xml::custom_unescape(&attribute.value, decoder)?;
96+
let value_str = custom_unescape(&attribute.value, decoder)?;
9697
let value = AvmString::new_utf8_bytes(activation.gc(), value_str.as_bytes());
9798

9899
// Insert an attribute.

core/src/avm2/e4x.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use crate::avm2::function::FunctionArgs;
33
use crate::avm2::object::{E4XOrXml, FunctionObject, NamespaceObject};
44
use crate::avm2::{Activation, Error, Multiname, Value};
55
use crate::string::{AvmString, StringContext, WStr, WString};
6-
use crate::xml::custom_unescape;
76

87
use gc_arena::barrier::unlock;
98
use gc_arena::{
@@ -17,6 +16,7 @@ use quick_xml::{
1716
name::ResolveResult,
1817
Error as XmlError, NsReader,
1918
};
19+
use ruffle_common::xml::custom_unescape;
2020
use ruffle_macros::istr;
2121

2222
use std::cell::{Ref, RefMut};

core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ pub mod tag_utils;
4747
pub mod timer;
4848
mod types;
4949
mod vminterface;
50-
mod xml;
5150

5251
pub mod backend;
5352
pub mod compatibility_rules;

0 commit comments

Comments
 (0)