aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/document.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2016-02-08 19:21:47 +0100
committerMs2ger <ms2ger@gmail.com>2016-02-08 19:21:56 +0100
commit5317af1e19833e29db735ecd2df507b72851d7f7 (patch)
treea532dedada9a15f446ecbfb759b0864896aef9c7 /components/script/dom/document.rs
parent4c4df37a128d2848f13fc2e5ebd4d69a4db8c483 (diff)
downloadservo-5317af1e19833e29db735ecd2df507b72851d7f7.tar.gz
servo-5317af1e19833e29db735ecd2df507b72851d7f7.zip
Remove the global argument to EventTarget::{fire_event, fire_simple_event}.
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r--components/script/dom/document.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 38306619fc4..487b93a01f3 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -550,8 +550,7 @@ impl Document {
self.ready_state.set(state);
- self.upcast::<EventTarget>().fire_simple_event("readystatechange",
- GlobalRef::Window(&self.window));
+ self.upcast::<EventTarget>().fire_simple_event("readystatechange");
}
/// Return whether scripting is enabled or not
@@ -1357,8 +1356,7 @@ impl Document {
let doctarget = self.upcast::<EventTarget>();
let _ = doctarget.fire_event("DOMContentLoaded",
EventBubbles::Bubbles,
- EventCancelable::NotCancelable,
- GlobalRef::Window(self.window()));
+ EventCancelable::NotCancelable);
self.window().reflow(ReflowGoal::ForDisplay,
ReflowQueryType::NoQuery,
@@ -1693,14 +1691,17 @@ impl DocumentMethods for Document {
// https://html.spec.whatwg.org/multipage/#dom-document-hasfocus
fn HasFocus(&self) -> bool {
- let target = self; // Step 1.
+ // Step 1.
+ let target = self;
let browsing_context = self.window.browsing_context();
let browsing_context = browsing_context.as_ref();
match browsing_context {
Some(browsing_context) => {
- let condidate = browsing_context.active_document(); // Step 2.
- if condidate.node.get_unique_id() == target.node.get_unique_id() { // Step 3.
+ // Step 2.
+ let candidate = browsing_context.active_document();
+ // Step 3.
+ if candidate == target {
true
} else {
false //TODO Step 4.