mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +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))
|
.find(|node| node.type_id() == ElementNodeTypeId(HTMLTitleElementTypeId))
|
||||||
.map(|title_elem| {
|
.map(|title_elem| {
|
||||||
for child in title_elem.children() {
|
for child in title_elem.children() {
|
||||||
let text: JS<Text> = TextCast::to(&child);
|
if child.is_text() {
|
||||||
title.push_str(text.get().characterdata.data.as_slice());
|
let text: JS<Text> = TextCast::to(&child);
|
||||||
|
title.push_str(text.get().characterdata.data.as_slice());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<html>
|
||||||
|
<title>x</title>
|
||||||
|
<script src="harness.js"></script>
|
||||||
|
<script>
|
||||||
|
document.head.firstChild.appendChild(document.createElement("foo"));
|
||||||
|
is(document.title, "x");
|
||||||
|
finish();
|
||||||
|
</script>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue