aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlelement.rs
diff options
context:
space:
mode:
authorDavide Giovannini <giovannini.davide90@gmail.com>2016-06-07 20:36:29 +0200
committerDavide Giovannini <giovannini.davide90@gmail.com>2016-06-07 20:36:29 +0200
commit35aa24eb4c4bbb9ee8b6e7bd2c083d4584321f07 (patch)
treeaa89bc00a0e6ec0d6eef0d9a58dab291cd95437c /components/script/dom/htmlelement.rs
parentf56848a0e8a9137f128088d1dd0f86e11fad841a (diff)
downloadservo-35aa24eb4c4bbb9ee8b6e7bd2c083d4584321f07.tar.gz
servo-35aa24eb4c4bbb9ee8b6e7bd2c083d4584321f07.zip
Fixed issue #11651 (Do not fire a blur event when calling .focus() on a focused element)
Diffstat (limited to 'components/script/dom/htmlelement.rs')
-rw-r--r--components/script/dom/htmlelement.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs
index 086eb6ff687..e016f7076d9 100644
--- a/components/script/dom/htmlelement.rs
+++ b/components/script/dom/htmlelement.rs
@@ -251,6 +251,9 @@ impl HTMLElementMethods for HTMLElement {
fn Focus(&self) {
// TODO: Mark the element as locked for focus and run the focusing steps.
// https://html.spec.whatwg.org/multipage/#focusing-steps
+ if self.upcast::<Element>().focus_state() {
+ return;
+ }
let document = document_from_node(self);
document.begin_focus_transaction();
document.request_focus(self.upcast());