Allow image prefetching to occur during parsing when no window or document is present. Fixes #939.

This commit is contained in:
Josh Matthews 2013-09-13 23:10:31 -07:00
parent 34f740396e
commit 21b0fc35b6
4 changed files with 47 additions and 35 deletions

View file

@ -166,10 +166,18 @@ impl<'self> Element {
//XXXjdm We really need something like a vtable so we can call AfterSetAttr.
// This hardcoding is awful.
if abstract_self.is_iframe_element() {
do abstract_self.with_mut_iframe_element |iframe| {
iframe.AfterSetAttr(raw_name, raw_value);
match abstract_self.type_id() {
ElementNodeTypeId(HTMLImageElementTypeId) => {
do abstract_self.with_mut_image_element |image| {
image.AfterSetAttr(raw_name, raw_value);
}
}
ElementNodeTypeId(HTMLIframeElementTypeId) => {
do abstract_self.with_mut_iframe_element |iframe| {
iframe.AfterSetAttr(raw_name, raw_value);
}
}
_ => ()
}
match self.parent.owner_doc {