aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-05-27 05:33:14 -0500
committerbors-servo <lbergstrom+bors@mozilla.com>2016-05-27 05:33:14 -0500
commitd890453f786e2f6aa37095d9ed298cd11be0854d (patch)
tree3e3fcb4f0533a52326bdb4aaada5abf1f9e0a654 /components/script
parent073c5e3b6b8950c01c9e5691925d24787fd06d53 (diff)
parenta4d9a1d6a15cf55609ac4c37b7ac7d9b927a0a73 (diff)
downloadservo-d890453f786e2f6aa37095d9ed298cd11be0854d.tar.gz
servo-d890453f786e2f6aa37095d9ed298cd11be0854d.zip
Auto merge of #11434 - catchmrbharath:status, r=nox
WIP: Fixes #11407: Implement Window.status 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 - [ ] These changes fix #11407 (github issue number if applicable). 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/11434) <!-- Reviewable:end -->
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/webidls/Window.webidl2
-rw-r--r--components/script/dom/window.rs12
2 files changed, 13 insertions, 1 deletions
diff --git a/components/script/dom/webidls/Window.webidl b/components/script/dom/webidls/Window.webidl
index 65a7acbd1a2..c75def477da 100644
--- a/components/script/dom/webidls/Window.webidl
+++ b/components/script/dom/webidls/Window.webidl
@@ -20,7 +20,7 @@
//[Replaceable] readonly attribute BarProp scrollbars;
//[Replaceable] readonly attribute BarProp statusbar;
//[Replaceable] readonly attribute BarProp toolbar;
- // attribute DOMString status;
+ attribute DOMString status;
void close();
//readonly attribute boolean closed;
//void stop();
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 0b3b4f3cec7..38c2588749c 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -160,6 +160,7 @@ pub struct Window {
screen: MutNullableHeap<JS<Screen>>,
session_storage: MutNullableHeap<JS<Storage>>,
local_storage: MutNullableHeap<JS<Storage>>,
+ status: DOMRefCell<DOMString>,
#[ignore_heap_size_of = "channels are hard"]
scheduler_chan: IpcSender<TimerEventRequest>,
timers: OneshotTimers,
@@ -828,6 +829,16 @@ impl WindowMethods for Window {
let dpr = self.window_size.get().map_or(1.0f32, |data| data.device_pixel_ratio.get());
Finite::wrap(dpr as f64)
}
+
+ // https://html.spec.whatwg.org/multipage/#dom-window-status
+ fn Status(&self) -> DOMString {
+ self.status.borrow().clone()
+ }
+
+ // https://html.spec.whatwg.org/multipage/#dom-window-status
+ fn SetStatus(&self, status: DOMString) {
+ *self.status.borrow_mut() = status
+ }
}
pub trait ScriptHelpers {
@@ -1513,6 +1524,7 @@ impl Window {
screen: Default::default(),
session_storage: Default::default(),
local_storage: Default::default(),
+ status: DOMRefCell::new(DOMString::new()),
scheduler_chan: scheduler_chan.clone(),
timers: OneshotTimers::new(timer_event_chan, scheduler_chan),
next_worker_id: Cell::new(WorkerId(0)),