aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-05-26 15:42:26 -0500
committerbors-servo <lbergstrom+bors@mozilla.com>2016-05-26 15:42:26 -0500
commit6d0c420d59b3e24ce6818bedaad5f6fdf9b74966 (patch)
treefe7c20c283f04b0f65ab122adb61f5813ab7463c /components/script/dom
parent64cca225e5b3943639a5d5d4bf46b06aef919650 (diff)
parentd72dbb619893df2ec8059558e47e32f0847cc3c8 (diff)
downloadservo-6d0c420d59b3e24ce6818bedaad5f6fdf9b74966.tar.gz
servo-6d0c420d59b3e24ce6818bedaad5f6fdf9b74966.zip
Auto merge of #11432 - ab22:11402-implement-window-alert, r=KiChjang
11402 implement window alert 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` does not report any errors - [X] These changes fix #11402 Either: - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. <!-- 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/11432) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/webidls/Window.webidl2
-rw-r--r--components/script/dom/window.rs5
2 files changed, 6 insertions, 1 deletions
diff --git a/components/script/dom/webidls/Window.webidl b/components/script/dom/webidls/Window.webidl
index 8f3cbedcc8e..608f066ff11 100644
--- a/components/script/dom/webidls/Window.webidl
+++ b/components/script/dom/webidls/Window.webidl
@@ -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();
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 63a0ca2a36e..540266b6491 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -431,6 +431,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
// Ensure that stderr doesn't trample through the alert() we use to