mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
e9258ddad8
We will use this later when we introduce a MenuList class since it will want to manage focus for its menu items. This patch also extends the definition of focusable elements somewhat. MozReview-Commit-ID: 3shnC0t79rF --HG-- extra : rebase_source : 177e05adeef9708bdb78d46fda5286216db6cbb7
20 lines
743 B
JavaScript
20 lines
743 B
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
"use strict";
|
|
|
|
// Simplied selector targetting elements that can receive the focus, full
|
|
// version at
|
|
// http://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus
|
|
// .
|
|
exports.focusableSelector = [
|
|
"a[href]:not([tabindex='-1'])",
|
|
"button:not([disabled]):not([tabindex='-1'])",
|
|
"iframe:not([tabindex='-1'])",
|
|
"input:not([disabled]):not([tabindex='-1'])",
|
|
"select:not([disabled]):not([tabindex='-1'])",
|
|
"textarea:not([disabled]):not([tabindex='-1'])",
|
|
"[tabindex]:not([tabindex='-1'])",
|
|
].join(", ");
|