mirror of
https://github.com/servo/servo.git
synced 2025-06-24 00:54:32 +01:00
Add check for non-Text children for document.title.(fixes #1742)
This commit is contained in:
parent
7ff35c0abe
commit
f9f82ff4e6
2 changed files with 13 additions and 2 deletions
|
@ -288,8 +288,10 @@ impl Document {
|
|||
.find(|node| node.type_id() == ElementNodeTypeId(HTMLTitleElementTypeId))
|
||||
.map(|title_elem| {
|
||||
for child in title_elem.children() {
|
||||
let text: JS<Text> = TextCast::to(&child);
|
||||
title.push_str(text.get().characterdata.data.as_slice());
|
||||
if child.is_text() {
|
||||
let text: JS<Text> = TextCast::to(&child);
|
||||
title.push_str(text.get().characterdata.data.as_slice());
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue