diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-25 22:42:31 -0500 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-25 22:42:31 -0500 |
commit | edf121324e475270f56f539900ff24f9005f3fdb (patch) | |
tree | 56fe4701bd387935fb426dc34f52a7c4d877b3ce /components/script | |
parent | 345b8b9c00b146259b2b665775c3a5aa7ded6056 (diff) | |
parent | e7eee3b0675eadf61e504f44aa1ae6fc474b7ee3 (diff) | |
download | servo-edf121324e475270f56f539900ff24f9005f3fdb.tar.gz servo-edf121324e475270f56f539900ff24f9005f3fdb.zip |
Auto merge of #11370 - Ms2ger:IterableContext, r=jdm
Remove the IterableContext trait.
Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data:
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy --faster` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
Either:
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because refactoring
Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.
It serves no purpose.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11370)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/devtools.rs | 2 | ||||
-rw-r--r-- | components/script/dom/browsingcontext.rs | 19 | ||||
-rw-r--r-- | components/script/dom/storage.rs | 1 | ||||
-rw-r--r-- | components/script/script_thread.rs | 2 |
4 files changed, 8 insertions, 16 deletions
diff --git a/components/script/devtools.rs b/components/script/devtools.rs index 73f7604aecc..e818b0c0ca0 100644 --- a/components/script/devtools.rs +++ b/components/script/devtools.rs @@ -16,7 +16,7 @@ use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; use dom::bindings::js::Root; use dom::bindings::str::DOMString; -use dom::browsingcontext::{BrowsingContext, IterableContext}; +use dom::browsingcontext::BrowsingContext; use dom::element::Element; use dom::node::Node; use dom::window::Window; 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; diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index a0066e219f9..24172ab900f 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -33,7 +33,7 @@ use dom::bindings::refcounted::{LiveDOMReferences, Trusted}; use dom::bindings::str::DOMString; use dom::bindings::trace::JSTraceable; 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::element::Element; use dom::event::{Event, EventBubbles, EventCancelable}; |