implement window alert with no params

This commit is contained in:
Abelardo E. Mendoza 2016-05-26 11:38:53 -06:00
parent 116faa7617
commit d72dbb6198
4 changed files with 24 additions and 1 deletions

View file

@ -48,8 +48,8 @@
//readonly attribute ApplicationCache applicationCache;
// user prompts
//void alert();
void alert(DOMString message);
void alert();
//boolean confirm(optional DOMString message = "");
//DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
//void print();

View file

@ -430,6 +430,11 @@ pub fn base64_atob(input: DOMString) -> Fallible<DOMString> {
}
impl WindowMethods for Window {
// https://html.spec.whatwg.org/multipage/#dom-alert
fn Alert_(&self) {
self.Alert(DOMString::new());
}
// https://html.spec.whatwg.org/multipage/#dom-alert
fn Alert(&self, s: DOMString) {
// Right now, just print to the console