aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-03-24 23:54:48 -0600
committerbors-servo <metajack+bors@gmail.com>2015-03-24 23:54:48 -0600
commit8b5df113f0202e889195e3772e13c037c4d33cc7 (patch)
treecf850f6f2c313824b710f696f8b9beac767e32fc /components/script/dom
parent2926963045f505b5cf88fd433c696c9edfb829ae (diff)
parent605e21c40676cb863c878fefc26982c31d257bd8 (diff)
downloadservo-8b5df113f0202e889195e3772e13c037c4d33cc7.tar.gz
servo-8b5df113f0202e889195e3772e13c037c4d33cc7.zip
auto merge of #5351 : frewsxcv/servo/window-docs, r=jdm
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/window.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 16fd8358eb7..8a915cbc998 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -281,6 +281,7 @@ pub fn base64_atob(atob: DOMString) -> Fallible<DOMString> {
}
impl<'a> WindowMethods for JSRef<'a, Window> {
+ // https://html.spec.whatwg.org/#dom-alert
fn Alert(self, s: DOMString) {
// Right now, just print to the console
println!("ALERT: {}", s);
@@ -296,14 +297,17 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
context.as_ref().unwrap().active_document()
}
+ // https://html.spec.whatwg.org/#dom-location
fn Location(self) -> Temporary<Location> {
self.Document().root().r().Location()
}
+ // https://html.spec.whatwg.org/#dom-sessionstorage
fn SessionStorage(self) -> Temporary<Storage> {
self.session_storage.or_init(|| Storage::new(&GlobalRef::Window(self), StorageType::Session))
}
+ // https://html.spec.whatwg.org/#dom-localstorage
fn LocalStorage(self) -> Temporary<Storage> {
self.local_storage.or_init(|| Storage::new(&GlobalRef::Window(self), StorageType::Local))
}
@@ -312,16 +316,19 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
self.console.or_init(|| Console::new(GlobalRef::Window(self)))
}
+ // https://html.spec.whatwg.org/#dom-frameelement
fn GetFrameElement(self) -> Option<Temporary<Element>> {
// FIXME(https://github.com/rust-lang/rust/issues/23338)
let context = self.browser_context();
context.as_ref().unwrap().frame_element()
}
+ // https://html.spec.whatwg.org/#dom-navigator
fn Navigator(self) -> Temporary<Navigator> {
self.navigator.or_init(|| Navigator::new(self))
}
+ // https://html.spec.whatwg.org/#dom-windowtimers-settimeout
fn SetTimeout(self, _cx: *mut JSContext, callback: Function, timeout: i32, args: Vec<JSVal>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::FunctionTimerCallback(callback),
args,
@@ -331,6 +338,7 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
self.script_chan.clone())
}
+ // https://html.spec.whatwg.org/#dom-windowtimers-settimeout
fn SetTimeout_(self, _cx: *mut JSContext, callback: DOMString, timeout: i32, args: Vec<JSVal>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::StringTimerCallback(callback),
args,
@@ -340,10 +348,12 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
self.script_chan.clone())
}
+ // https://html.spec.whatwg.org/#dom-windowtimers-cleartimeout
fn ClearTimeout(self, handle: i32) {
self.timers.clear_timeout_or_interval(handle);
}
+ // https://html.spec.whatwg.org/#dom-windowtimers-setinterval
fn SetInterval(self, _cx: *mut JSContext, callback: Function, timeout: i32, args: Vec<JSVal>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::FunctionTimerCallback(callback),
args,
@@ -353,6 +363,7 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
self.script_chan.clone())
}
+ // https://html.spec.whatwg.org/#dom-windowtimers-setinterval
fn SetInterval_(self, _cx: *mut JSContext, callback: DOMString, timeout: i32, args: Vec<JSVal>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::StringTimerCallback(callback),
args,
@@ -362,6 +373,7 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
self.script_chan.clone())
}
+ // https://html.spec.whatwg.org/#dom-windowtimers-clearinterval
fn ClearInterval(self, handle: i32) {
self.ClearTimeout(handle);
}