mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +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()
|
||||
.find(|node| node.type_id() == ElementNodeTypeId(HTMLTitleElementTypeId))
|
||||
.map(|title_elem| {
|
||||
for child in title_elem.children() {
|
||||
if child.is_text() {
|
||||
let text: JSRef<Text> = TextCast::to_ref(child).unwrap();
|
||||
title.push_str(text.characterdata().data().as_slice());
|
||||
}
|
||||
for text in title_elem.children().filter_map::<JSRef<Text>>(TextCast::to_ref) {
|
||||
title.push_str(text.characterdata().data().as_slice());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue