mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Don't allow disabled fields to be focused
This commit is contained in:
parent
35fb516662
commit
4e63a5063e
4 changed files with 58 additions and 21 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue