Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2903)

Unified Diff: chrome/browser/resources/uber/uber.js

Issue 10388034: Disables the ability to tab to navigation items when an overlay is displayed. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Set aria-hidden=true when navigation is behind an overlay Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/uber/uber.js
diff --git a/chrome/browser/resources/uber/uber.js b/chrome/browser/resources/uber/uber.js
index c46a82137592b2e0859c425b8ff24cd550aa17b9..02cd749e4b4bf1f045d27918084f07d848d315df 100644
--- a/chrome/browser/resources/uber/uber.js
+++ b/chrome/browser/resources/uber/uber.js
@@ -138,6 +138,10 @@ cr.define('uber', function() {
showPage(e.data.params.pageId, HISTORY_STATE_OPTION.PUSH);
else if (e.data.method === 'navigationControlsLoaded')
onNavigationControlsLoaded();
+ else if (e.data.method === 'enableNavigationItemTabbing')
+ setNavigationItemTabbing(true);
+ else if (e.data.method === 'disableNavigationItemTabbing')
+ setNavigationItemTabbing(false);
else if (e.data.method === 'adjustToScroll')
adjustToScroll(e.data.params);
else if (e.data.method === 'mouseWheel')
@@ -330,6 +334,18 @@ cr.define('uber', function() {
uber.invokeMethodOnWindow(iframe.contentWindow, 'mouseWheel', params);
}
+ /**
+ * Enables or disables the ability to tab to the navigation items.
+ * @param {boolean} enabled If true, enables tabbing; if false, disables it.
+ */
+ function setNavigationItemTabbing(enabled) {
+ navFrame.firstChild.tabIndex = enabled ? 0 : -1;
+ if (enabled)
+ navFrame.firstChild.removeAttribute('aria-hidden');
+ else
+ navFrame.firstChild.setAttribute('aria-hidden', true);
+ }
+
return {
onLoad: onLoad,
onPopHistoryState: onPopHistoryState

Powered by Google App Engine
This is Rietveld 408576698