aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/window.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-09-10 07:33:25 -0500
committerGitHub <noreply@github.com>2016-09-10 07:33:25 -0500
commit84f3cf22bfa3a8897a687e9282b1a9df1cbcb8cc (patch)
tree256a1d5e82056965040213b43c4ed7deeacf9bbf /components/script/dom/window.rs
parent5e7d91829782828e1020652e7bc9d16aa7456499 (diff)
parent2bc0862f47a937eaf96aec929e884bddd23c6447 (diff)
downloadservo-84f3cf22bfa3a8897a687e9282b1a9df1cbcb8cc.tar.gz
servo-84f3cf22bfa3a8897a687e9282b1a9df1cbcb8cc.zip
Auto merge of #13185 - nox:namespaces, r=jdm,Ms2ger
Make console a namespace (fixes #13010) <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13185) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r--components/script/dom/window.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 4954f7cccd0..e8006123360 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -25,7 +25,7 @@ use dom::bindings::str::DOMString;
use dom::bindings::structuredclone::StructuredCloneData;
use dom::bindings::utils::{GlobalStaticData, WindowProxyHandler};
use dom::browsingcontext::BrowsingContext;
-use dom::console::Console;
+use dom::console::TimerSet;
use dom::crypto::Crypto;
use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration};
use dom::document::Document;
@@ -157,7 +157,6 @@ pub struct Window {
history_traversal_task_source: HistoryTraversalTaskSource,
#[ignore_heap_size_of = "task sources are hard"]
file_reading_task_source: FileReadingTaskSource,
- console: MutNullableHeap<JS<Console>>,
crypto: MutNullableHeap<JS<Crypto>>,
navigator: MutNullableHeap<JS<Navigator>>,
#[ignore_heap_size_of = "channels are hard"]
@@ -276,7 +275,10 @@ pub struct Window {
scroll_offsets: DOMRefCell<HashMap<UntrustedNodeAddress, Point2D<f32>>>,
/// https://html.spec.whatwg.org/multipage/#in-error-reporting-mode
- in_error_reporting_mode: Cell<bool>
+ in_error_reporting_mode: Cell<bool>,
+
+ /// Timers used by the Console API.
+ console_timers: TimerSet,
}
impl Window {
@@ -508,11 +510,6 @@ impl WindowMethods for Window {
self.local_storage.or_init(|| Storage::new(&GlobalRef::Window(self), StorageType::Local))
}
- // https://developer.mozilla.org/en-US/docs/Web/API/Console
- fn Console(&self) -> Root<Console> {
- self.console.or_init(|| Console::new(GlobalRef::Window(self)))
- }
-
// https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#dfn-GlobalCrypto
fn Crypto(&self) -> Root<Crypto> {
self.crypto.or_init(|| Crypto::new(GlobalRef::Window(self)))
@@ -1701,7 +1698,6 @@ impl Window {
history_traversal_task_source: history_task_source,
file_reading_task_source: file_task_source,
image_cache_chan: image_cache_chan,
- console: Default::default(),
crypto: Default::default(),
navigator: Default::default(),
image_cache_thread: image_cache_thread,
@@ -1747,10 +1743,16 @@ impl Window {
error_reporter: error_reporter,
scroll_offsets: DOMRefCell::new(HashMap::new()),
in_error_reporting_mode: Cell::new(false),
+ console_timers: TimerSet::new(),
};
WindowBinding::Wrap(runtime.cx(), win)
}
+
+ pub fn console_timers(&self) -> &TimerSet {
+ &self.console_timers
+ }
+
pub fn live_devtools_updates(&self) -> bool {
return self.devtools_wants_updates.get();
}