For some reason, text nodes have an attributes object.

This commit is contained in:
David Wendt 2019-12-30 18:57:39 -07:00
parent 91155d6870
commit db38982ffb
1 changed files with 10 additions and 0 deletions

View File

@ -77,6 +77,9 @@ pub enum XMLNodeData<'gc> {
/// The script object associated with this XML node, if any. /// The script object associated with this XML node, if any.
script_object: Option<Object<'gc>>, script_object: Option<Object<'gc>>,
/// The script object associated with this XML node's attributes, if any.
attributes_script_object: Option<Object<'gc>>,
/// The document that this tree node currently belongs to. /// The document that this tree node currently belongs to.
document: XMLDocument<'gc>, document: XMLDocument<'gc>,
@ -147,6 +150,7 @@ impl<'gc> XMLNode<'gc> {
mc, mc,
XMLNodeData::Text { XMLNodeData::Text {
script_object: None, script_object: None,
attributes_script_object: None,
document, document,
parent: None, parent: None,
prev_sibling: None, prev_sibling: None,
@ -319,6 +323,7 @@ impl<'gc> XMLNode<'gc> {
mc, mc,
XMLNodeData::Text { XMLNodeData::Text {
script_object: None, script_object: None,
attributes_script_object: None,
document, document,
parent: None, parent: None,
prev_sibling: None, prev_sibling: None,
@ -923,6 +928,10 @@ impl<'gc> XMLNode<'gc> {
| XMLNodeData::DocumentRoot { | XMLNodeData::DocumentRoot {
attributes_script_object, attributes_script_object,
.. ..
}
| XMLNodeData::Text {
attributes_script_object,
..
} => { } => {
if attributes_script_object.is_none() { if attributes_script_object.is_none() {
*attributes_script_object = *attributes_script_object =
@ -1014,6 +1023,7 @@ impl<'gc> XMLNode<'gc> {
}, },
XMLNodeData::Text { contents, .. } => XMLNodeData::Text { XMLNodeData::Text { contents, .. } => XMLNodeData::Text {
script_object: None, script_object: None,
attributes_script_object: None,
document, document,
parent: None, parent: None,
prev_sibling: None, prev_sibling: None,