diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2015-04-29 09:13:46 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2015-05-14 11:42:54 +1000 |
commit | 2b3737d34e0d49af1143fa09f2043cd9375cea8d (patch) | |
tree | 8f2aedd93bdf00f8179f6456e56d1bccd0353726 /components/script/dom/htmliframeelement.rs | |
parent | 5e61ebaa05e5babb7b2fdd1347b6cdd23df38e62 (diff) | |
download | servo-2b3737d34e0d49af1143fa09f2043cd9375cea8d.tar.gz servo-2b3737d34e0d49af1143fa09f2043cd9375cea8d.zip |
Various fixes for cleaning up iframes, compositor layers, pipelines and threads.
This allows most of the jquery test suite to run without exhausting thread resources.
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 58096b18bea..685f46db48e 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -385,5 +385,32 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLIFrameElement> { self.process_the_iframe_attributes(); } } + + fn unbind_from_tree(&self, tree_in_doc: bool) { + if let Some(ref s) = self.super_type() { + s.unbind_from_tree(tree_in_doc); + } + + // https://html.spec.whatwg.org/multipage/#a-browsing-context-is-discarded + match (self.containing_page_pipeline_id(), self.subpage_id()) { + (Some(containing_pipeline_id), Some(subpage_id)) => { + let window = window_from_node(*self).root(); + let window = window.r(); + + let ConstellationChan(ref chan) = window.constellation_chan(); + let msg = ConstellationMsg::RemoveIFrame(containing_pipeline_id, + subpage_id); + chan.send(msg).unwrap(); + + // Resetting the subpage id to None is required here so that + // if this iframe is subsequently re-added to the document + // the load doesn't think that it's a navigation, but instead + // a new iframe. Without this, the constellation gets very + // confused. + self.subpage_id.set(None); + } + _ => {} + } + } } |