diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-06-10 14:11:49 +0200 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-06-11 19:51:07 +0200 |
commit | bb0cbb0a746aff66a6288df66caf55d995a017c2 (patch) | |
tree | 03d9570d9f067ab825bc14e540ad9731d7bd49cf /src/components/script/dom/htmliframeelement.rs | |
parent | 9acba1477cbfdbc280ed0d6423443f4a37f5168c (diff) | |
download | servo-bb0cbb0a746aff66a6288df66caf55d995a017c2.tar.gz servo-bb0cbb0a746aff66a6288df66caf55d995a017c2.zip |
Use internal mutability for HTMLIFrameElement.
Diffstat (limited to 'src/components/script/dom/htmliframeelement.rs')
-rw-r--r-- | src/components/script/dom/htmliframeelement.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/components/script/dom/htmliframeelement.rs b/src/components/script/dom/htmliframeelement.rs index 8adc17d25a0..d747d0c179a 100644 --- a/src/components/script/dom/htmliframeelement.rs +++ b/src/components/script/dom/htmliframeelement.rs @@ -39,7 +39,7 @@ enum SandboxAllowance { #[deriving(Encodable)] pub struct HTMLIFrameElement { pub htmlelement: HTMLElement, - pub size: Option<IFrameSize>, + pub size: Traceable<Cell<Option<IFrameSize>>>, pub sandbox: Traceable<Cell<Option<u8>>>, } @@ -79,7 +79,7 @@ impl HTMLIFrameElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLIFrameElement { HTMLIFrameElement { htmlelement: HTMLElement::new_inherited(HTMLIFrameElementTypeId, localName, document), - size: None, + size: Traceable::new(Cell::new(None)), sandbox: Traceable::new(Cell::new(None)), } } @@ -120,7 +120,7 @@ impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> { } fn GetContentWindow(&self) -> Option<Temporary<Window>> { - self.size.and_then(|size| { + self.size.deref().get().and_then(|size| { let window = window_from_node(self).root(); let children = &*window.deref().page.children.deref().borrow(); let child = children.iter().find(|child| { @@ -194,11 +194,10 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLIFrameElement> { let page = window.deref().page(); let subpage_id = page.get_next_subpage_id(); - let mut self_alias = self.clone(); - self_alias.deref_mut().size = Some(IFrameSize { + self.deref().size.deref().set(Some(IFrameSize { pipeline_id: page.id, subpage_id: subpage_id, - }); + })); let ConstellationChan(ref chan) = *page.constellation_chan.deref(); chan.send(LoadIframeUrlMsg(url, page.id, subpage_id, sandboxed)); |