avm2: Correctly set XML attribute with namespace
This commit is contained in:
parent
795fa0df27
commit
2fd8f600bc
|
@ -212,6 +212,7 @@ impl<'gc> E4XNode<'gc> {
|
|||
|
||||
pub fn attribute(
|
||||
mc: &Mutation<'gc>,
|
||||
namespace: Option<E4XNamespace<'gc>>,
|
||||
name: AvmString<'gc>,
|
||||
value: AvmString<'gc>,
|
||||
parent: Option<E4XNode<'gc>>,
|
||||
|
@ -220,7 +221,7 @@ impl<'gc> E4XNode<'gc> {
|
|||
mc,
|
||||
E4XNodeData {
|
||||
parent,
|
||||
namespace: None,
|
||||
namespace: namespace.map(Box::new),
|
||||
local_name: Some(name),
|
||||
kind: E4XNodeKind::Attribute(value),
|
||||
notification: None,
|
||||
|
|
|
@ -722,6 +722,7 @@ impl<'gc> TObject<'gc> for XmlListObject<'gc> {
|
|||
// 2.c.iv.3. Let y.[[Class]] = "attribute"
|
||||
E4XNode::attribute(
|
||||
activation.gc(),
|
||||
x.explicit_namespace().map(E4XNamespace::new_uri),
|
||||
x.local_name().unwrap(),
|
||||
"".into(),
|
||||
r,
|
||||
|
|
|
@ -511,7 +511,8 @@ impl<'gc> TObject<'gc> for XmlObject<'gc> {
|
|||
let Some(local_name) = name.local_name() else {
|
||||
return Err(format!("Cannot set attribute {:?} without a local name", name).into());
|
||||
};
|
||||
let new_attr = E4XNode::attribute(mc, local_name, value, Some(self.node()));
|
||||
let ns = name.explicit_namespace().map(E4XNamespace::new_uri);
|
||||
let new_attr = E4XNode::attribute(mc, ns, local_name, value, Some(self.node()));
|
||||
|
||||
let node = self.0.node.get();
|
||||
let mut kind = node.kind_mut(mc);
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
num_ticks = 1
|
||||
known_failure = true # https://github.com/ruffle-rs/ruffle/issues/12351
|
||||
|
|
Loading…
Reference in New Issue