diff options
author | Josh Matthews <josh@joshmatthews.net> | 2020-06-12 17:35:58 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2020-06-15 11:22:28 -0400 |
commit | 757371f4f08aca089659fa6774e74bb90b511363 (patch) | |
tree | 3d1326104bec462410c93d08fff1e76eda796435 /components/script/dom/htmlelement.rs | |
parent | a34d1573b6d79211f0efeafcc3ae4b505280cb54 (diff) | |
download | servo-757371f4f08aca089659fa6774e74bb90b511363.tar.gz servo-757371f4f08aca089659fa6774e74bb90b511363.zip |
Make clicking on an element request focus for focusable elements.
Diffstat (limited to 'components/script/dom/htmlelement.rs')
-rw-r--r-- | components/script/dom/htmlelement.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index 4c4d86f1642..1820c4367d5 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -411,9 +411,7 @@ impl HTMLElementMethods for HTMLElement { // TODO: Mark the element as locked for focus and run the focusing steps. // https://html.spec.whatwg.org/multipage/#focusing-steps let document = document_from_node(self); - document.begin_focus_transaction(); - document.request_focus(self.upcast()); - document.commit_focus_transaction(FocusType::Element); + document.request_focus(Some(self.upcast()), FocusType::Element); } // https://html.spec.whatwg.org/multipage/#dom-blur @@ -424,9 +422,7 @@ impl HTMLElementMethods for HTMLElement { } // https://html.spec.whatwg.org/multipage/#unfocusing-steps let document = document_from_node(self); - document.begin_focus_transaction(); - // If `request_focus` is not called, focus will be set to None. - document.commit_focus_transaction(FocusType::Element); + document.request_focus(None, FocusType::Element); } // https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent |