mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Rewrite NodeChildrenIterator to return Temporary.
This commit is contained in:
parent
bc8ed81dc1
commit
c8106da277
11 changed files with 208 additions and 129 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue