aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/htmliframeelement.rs
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2014-06-11 13:59:01 -0400
committerbors-servo <release+servo@mozilla.com>2014-06-11 13:59:01 -0400
commitcc23f3c4360a37e4dc763d4eade779a411a6d97a (patch)
tree96ce5978f42f60edcf01d974f63074882832c7eb /src/components/script/dom/htmliframeelement.rs
parent6e2a9169580e6e0a77b5c7154230ded6116178ae (diff)
parentc41dd2477d19e68272afc11f198f2a71c320abd2 (diff)
downloadservo-cc23f3c4360a37e4dc763d4eade779a411a6d97a.tar.gz
servo-cc23f3c4360a37e4dc763d4eade779a411a6d97a.zip
auto merge of #2633 : Ms2ger/servo/derefmut, r=jdm
Part of #1854.
Diffstat (limited to 'src/components/script/dom/htmliframeelement.rs')
-rw-r--r--src/components/script/dom/htmliframeelement.rs11
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));