aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmliframeelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r--components/script/dom/htmliframeelement.rs29
1 files changed, 24 insertions, 5 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 94353173333..68ca275682f 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -41,10 +41,11 @@ enum SandboxAllowance {
#[jstraceable]
#[must_root]
+#[privatize]
pub struct HTMLIFrameElement {
- pub htmlelement: HTMLElement,
- pub size: Cell<Option<IFrameSize>>,
- pub sandbox: Cell<Option<u8>>,
+ htmlelement: HTMLElement,
+ size: Cell<Option<IFrameSize>>,
+ sandbox: Cell<Option<u8>>,
}
impl HTMLIFrameElementDerived for EventTarget {
@@ -54,9 +55,22 @@ impl HTMLIFrameElementDerived for EventTarget {
}
#[jstraceable]
+#[privatize]
pub struct IFrameSize {
- pub pipeline_id: PipelineId,
- pub subpage_id: SubpageId,
+ pipeline_id: PipelineId,
+ subpage_id: SubpageId,
+}
+
+impl IFrameSize {
+ #[inline]
+ pub fn pipeline_id<'a>(&'a self) -> &'a PipelineId {
+ &self.pipeline_id
+ }
+
+ #[inline]
+ pub fn subpage_id<'a>(&'a self) -> &'a SubpageId {
+ &self.subpage_id
+ }
}
pub trait HTMLIFrameElementHelpers {
@@ -126,6 +140,11 @@ impl HTMLIFrameElement {
let element = HTMLIFrameElement::new_inherited(localName, prefix, document);
Node::reflect_node(box element, document, HTMLIFrameElementBinding::Wrap)
}
+
+ #[inline]
+ pub fn size(&self) -> Option<IFrameSize> {
+ self.size.get()
+ }
}
impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> {