diff options
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/browsingcontext.rs | 19 | ||||
-rw-r--r-- | components/script/dom/storage.rs | 1 |
2 files changed, 6 insertions, 14 deletions
diff --git a/components/script/dom/browsingcontext.rs b/components/script/dom/browsingcontext.rs index c46afe71971..99c72e1e4be 100644 --- a/components/script/dom/browsingcontext.rs +++ b/components/script/dom/browsingcontext.rs @@ -164,25 +164,14 @@ impl BrowsingContext { self.active_index.set(0); self.history.borrow_mut().clear(); } -} - -pub struct ContextIterator { - stack: Vec<Root<BrowsingContext>>, -} -pub trait IterableContext { - fn iter(&self) -> ContextIterator; - fn find(&self, id: PipelineId) -> Option<Root<BrowsingContext>>; -} - -impl IterableContext for BrowsingContext { - fn iter(&self) -> ContextIterator { + pub fn iter(&self) -> ContextIterator { ContextIterator { stack: vec!(Root::from_ref(self)), } } - fn find(&self, id: PipelineId) -> Option<Root<BrowsingContext>> { + pub fn find(&self, id: PipelineId) -> Option<Root<BrowsingContext>> { if self.id == id { return Some(Root::from_ref(self)); } @@ -194,6 +183,10 @@ impl IterableContext for BrowsingContext { } } +pub struct ContextIterator { + stack: Vec<Root<BrowsingContext>>, +} + impl Iterator for ContextIterator { type Item = Root<BrowsingContext>; diff --git a/components/script/dom/storage.rs b/components/script/dom/storage.rs index fa6b3f91a42..001fd19df3b 100644 --- a/components/script/dom/storage.rs +++ b/components/script/dom/storage.rs @@ -11,7 +11,6 @@ use dom::bindings::js::Root; use dom::bindings::refcounted::Trusted; use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::str::DOMString; -use dom::browsingcontext::IterableContext; use dom::event::{Event, EventBubbles, EventCancelable}; use dom::storageevent::StorageEvent; use dom::urlhelper::UrlHelper; |