mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
Add empty text check for first child of pre in innerHTML.(fixes #1743)
This commit is contained in:
parent
98170e67c0
commit
b73eb563b0
1 changed files with 1 additions and 1 deletions
|
@ -104,7 +104,7 @@ fn serialize_elem(elem: &JS<Element>, open_elements: &mut ~[~str]) -> ~str {
|
|||
match elem.get().node.first_child {
|
||||
Some(ref child) if child.is_text() => {
|
||||
let text: JS<CharacterData> = CharacterDataCast::to(child);
|
||||
if text.get().data[0] == 0x0A as u8 {
|
||||
if text.get().data.len() > 0 && text.get().data[0] == 0x0A as u8 {
|
||||
rv.push_str("\x0A");
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue