mirror of
https://github.com/servo/servo.git
synced 2025-07-29 02:00:23 +01:00
Remove the IterableContext trait.
It serves no purpose.
This commit is contained in:
parent
2ce9eba3dc
commit
e7eee3b067
4 changed files with 8 additions and 16 deletions
|
@ -16,7 +16,7 @@ use dom::bindings::global::GlobalRef;
|
||||||
use dom::bindings::inheritance::Castable;
|
use dom::bindings::inheritance::Castable;
|
||||||
use dom::bindings::js::Root;
|
use dom::bindings::js::Root;
|
||||||
use dom::bindings::str::DOMString;
|
use dom::bindings::str::DOMString;
|
||||||
use dom::browsingcontext::{BrowsingContext, IterableContext};
|
use dom::browsingcontext::BrowsingContext;
|
||||||
use dom::element::Element;
|
use dom::element::Element;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::window::Window;
|
use dom::window::Window;
|
||||||
|
|
|
@ -164,25 +164,14 @@ impl BrowsingContext {
|
||||||
self.active_index.set(0);
|
self.active_index.set(0);
|
||||||
self.history.borrow_mut().clear();
|
self.history.borrow_mut().clear();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
pub struct ContextIterator {
|
pub fn iter(&self) -> 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 {
|
|
||||||
ContextIterator {
|
ContextIterator {
|
||||||
stack: vec!(Root::from_ref(self)),
|
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 {
|
if self.id == id {
|
||||||
return Some(Root::from_ref(self));
|
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 {
|
impl Iterator for ContextIterator {
|
||||||
type Item = Root<BrowsingContext>;
|
type Item = Root<BrowsingContext>;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ use dom::bindings::js::Root;
|
||||||
use dom::bindings::refcounted::Trusted;
|
use dom::bindings::refcounted::Trusted;
|
||||||
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
|
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
|
||||||
use dom::bindings::str::DOMString;
|
use dom::bindings::str::DOMString;
|
||||||
use dom::browsingcontext::IterableContext;
|
|
||||||
use dom::event::{Event, EventBubbles, EventCancelable};
|
use dom::event::{Event, EventBubbles, EventCancelable};
|
||||||
use dom::storageevent::StorageEvent;
|
use dom::storageevent::StorageEvent;
|
||||||
use dom::urlhelper::UrlHelper;
|
use dom::urlhelper::UrlHelper;
|
||||||
|
|
|
@ -33,7 +33,7 @@ use dom::bindings::refcounted::{LiveDOMReferences, Trusted};
|
||||||
use dom::bindings::str::DOMString;
|
use dom::bindings::str::DOMString;
|
||||||
use dom::bindings::trace::JSTraceable;
|
use dom::bindings::trace::JSTraceable;
|
||||||
use dom::bindings::utils::WRAP_CALLBACKS;
|
use dom::bindings::utils::WRAP_CALLBACKS;
|
||||||
use dom::browsingcontext::{BrowsingContext, IterableContext};
|
use dom::browsingcontext::BrowsingContext;
|
||||||
use dom::document::{Document, DocumentProgressHandler, DocumentSource, FocusType, IsHTMLDocument};
|
use dom::document::{Document, DocumentProgressHandler, DocumentSource, FocusType, IsHTMLDocument};
|
||||||
use dom::element::Element;
|
use dom::element::Element;
|
||||||
use dom::event::{Event, EventBubbles, EventCancelable};
|
use dom::event::{Event, EventBubbles, EventCancelable};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue