diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-04-10 12:25:42 -0500 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-04-10 12:25:42 -0500 |
commit | a8b0fb1e79ccc1a3da6ea4f58382b8482cdabd10 (patch) | |
tree | 93ecd36412fff334238dffd02931aba46756f66e /components/script/dom/document.rs | |
parent | 35fb5166624faa13d8a7090ce3f2456726547e11 (diff) | |
parent | 4e63a5063eb234d8b14daea9c20aa201989e1179 (diff) | |
download | servo-a8b0fb1e79ccc1a3da6ea4f58382b8482cdabd10.tar.gz servo-a8b0fb1e79ccc1a3da6ea4f58382b8482cdabd10.zip |
Auto merge of #5592 - mbrubeck:focusable, r=jdm
This begins implementing parts of the [focusing steps](https://html.spec.whatwg.org/multipage/interaction.html#focusing-steps) algorithm. r? @jdm or @Ms2ger
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index ca4182164d8..57cee418838 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -36,7 +36,7 @@ use dom::documentfragment::DocumentFragment; use dom::documenttype::DocumentType; use dom::domimplementation::DOMImplementation; use dom::element::{Element, ElementCreator, AttributeHandlers}; -use dom::element::{ElementTypeId, ActivationElementHelpers}; +use dom::element::{ElementTypeId, ActivationElementHelpers, FocusElementHelpers}; use dom::event::{Event, EventBubbles, EventCancelable, EventHelpers}; use dom::eventtarget::{EventTarget, EventTargetTypeId, EventTargetHelpers}; use dom::htmlanchorelement::HTMLAnchorElement; @@ -448,7 +448,9 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> { /// Request that the given element receive focus once the current transaction is complete. fn request_focus(self, elem: JSRef<Element>) { - self.possibly_focused.assign(Some(elem)) + if elem.is_focusable_area() { + self.possibly_focused.assign(Some(elem)) + } } /// Reassign the focus context to the element that last requested focus during this |