aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/html/hubbub_html_parser.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-03-14 14:46:30 -0400
committerLars Bergstrom <lars@lars.com>2014-03-18 09:31:22 -0500
commit64c0de9fe7dc5555821ca5cb4c13aa2418e91b94 (patch)
treef8bee1d1d3b38572a3e2519542d5548e251e802d /src/components/script/html/hubbub_html_parser.rs
parentf279abbf9f894641f592fee7f70fa0e29d955dad (diff)
downloadservo-64c0de9fe7dc5555821ca5cb4c13aa2418e91b94.tar.gz
servo-64c0de9fe7dc5555821ca5cb4c13aa2418e91b94.zip
Warning police.
Diffstat (limited to 'src/components/script/html/hubbub_html_parser.rs')
-rw-r--r--src/components/script/html/hubbub_html_parser.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs
index 9f6ed010609..34cbd08a59b 100644
--- a/src/components/script/html/hubbub_html_parser.rs
+++ b/src/components/script/html/hubbub_html_parser.rs
@@ -338,9 +338,11 @@ pub fn parse_html(page: &Page,
debug!("-- attach attrs");
for attr in tag.attributes.iter() {
let elem = element.clone();
- element.get_mut().set_attr(&elem,
- attr.name.clone(),
- attr.value.clone());
+ //FIXME: this should have proper error handling or explicitly drop
+ // exceptions on the ground
+ assert!(element.get_mut().set_attr(&elem,
+ attr.name.clone(),
+ attr.value.clone()).is_ok());
}
// Spawn additional parsing, network loads, etc. from tag and attrs
@@ -409,7 +411,7 @@ pub fn parse_html(page: &Page,
debug!("append child {:x} {:x}", parent, child);
let mut parent: JS<Node> = NodeWrapping::from_hubbub_node(parent);
let mut child: JS<Node> = NodeWrapping::from_hubbub_node(child);
- parent.AppendChild(&mut child);
+ assert!(parent.AppendChild(&mut child).is_ok());
}
child
},
@@ -448,14 +450,14 @@ pub fn parse_html(page: &Page,
debug!("set quirks mode");
// NOTE: tmp vars are workaround for lifetime issues. Both required.
let mut tmp_borrow = doc_cell.borrow_mut();
- let mut tmp = tmp_borrow.get();
+ let tmp = tmp_borrow.get();
tmp.get_mut().set_quirks_mode(mode);
},
encoding_change: |encname| {
debug!("encoding change");
// NOTE: tmp vars are workaround for lifetime issues. Both required.
let mut tmp_borrow = doc_cell.borrow_mut();
- let mut tmp = tmp_borrow.get();
+ let tmp = tmp_borrow.get();
tmp.get_mut().set_encoding_name(encname);
},
complete_script: |script| {