mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Cleanup Document::Title.
This commit is contained in:
parent
fff0491c01
commit
903f3fa729
1 changed files with 2 additions and 5 deletions
|
@ -688,11 +688,8 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
||||||
root.traverse_preorder()
|
root.traverse_preorder()
|
||||||
.find(|node| node.type_id() == ElementNodeTypeId(HTMLTitleElementTypeId))
|
.find(|node| node.type_id() == ElementNodeTypeId(HTMLTitleElementTypeId))
|
||||||
.map(|title_elem| {
|
.map(|title_elem| {
|
||||||
for child in title_elem.children() {
|
for text in title_elem.children().filter_map::<JSRef<Text>>(TextCast::to_ref) {
|
||||||
if child.is_text() {
|
title.push_str(text.characterdata().data().as_slice());
|
||||||
let text: JSRef<Text> = TextCast::to_ref(child).unwrap();
|
|
||||||
title.push_str(text.characterdata().data().as_slice());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue