aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmloptionelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmloptionelement.rs')
-rw-r--r--components/script/dom/htmloptionelement.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs
index d50c832eda4..2ae9ad7c2a1 100644
--- a/components/script/dom/htmloptionelement.rs
+++ b/components/script/dom/htmloptionelement.rs
@@ -57,11 +57,12 @@ fn collect_text(node: &JSRef<Node>, value: &mut DOMString) {
return;
} else {
for child in node.children() {
- if child.is_text() {
- let characterdata: JSRef<CharacterData> = CharacterDataCast::to_ref(child).unwrap();
+ let child = child.root();
+ if child.r().is_text() {
+ let characterdata: JSRef<CharacterData> = CharacterDataCast::to_ref(child.r()).unwrap();
value.push_str(characterdata.Data().as_slice());
} else {
- collect_text(&child, value);
+ collect_text(&child.r(), value);
}
}
}