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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js

Issue 2334693003: Add ARIA markup for tabs & tab panels (Closed)
Patch Set: forgot changing two aria-expanded attributes to aria-selected Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/Panel.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js b/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
index 6ae72638a847c6cbb7c83f58bfaf0805b213fd3d..a993305608a14a65f7de8e6ed280f761312ab7dd 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
@@ -42,10 +42,13 @@ WebInspector.TabbedPane = function()
this._headerElement = this.contentElement.createChild("div", "tabbed-pane-header");
this._headerElement.createChild("content").select = ".tabbed-pane-header-before";
this._headerContentsElement = this._headerElement.createChild("div", "tabbed-pane-header-contents");
+ this._headerContentsElement.setAttribute("aria-label", WebInspector.UIString("Panels"));
this._tabSlider = createElementWithClass("div", "tabbed-pane-tab-slider");
this._headerElement.createChild("content").select = ".tabbed-pane-header-after";
this._tabsElement = this._headerContentsElement.createChild("div", "tabbed-pane-header-tabs");
+ this._tabsElement.setAttribute("role", "tablist");
this._contentElement = this.contentElement.createChild("div", "tabbed-pane-content");
+ this._contentElement.setAttribute("role", "tabpanel");
this._contentElement.createChild("content");
/** @type {!Array.<!WebInspector.TabbedPaneTab>} */
this._tabs = [];
@@ -767,6 +770,7 @@ WebInspector.TabbedPane.prototype = {
_showTab: function(tab)
{
tab.tabElement.classList.add("selected");
+ tab.tabElement.setAttribute("aria-selected", "true");
tab.view.showWidget(this.element);
this._updateTabSlider();
},
@@ -793,6 +797,7 @@ WebInspector.TabbedPane.prototype = {
_hideTab: function(tab)
{
tab.tabElement.classList.remove("selected");
+ tab.tabElement.setAttribute("aria-selected", "false");
tab.view.hideWidget();
},
@@ -1038,6 +1043,8 @@ WebInspector.TabbedPaneTab.prototype = {
var tabElement = createElementWithClass("div", "tabbed-pane-header-tab");
tabElement.id = "tab-" + this._id;
tabElement.tabIndex = -1;
+ tabElement.setAttribute("role", "tab");
+ tabElement.setAttribute("aria-selected", "false");
tabElement.selectTabForTest = this._tabbedPane.selectTab.bind(this._tabbedPane, this.id, true);
var titleElement = tabElement.createChild("span", "tabbed-pane-header-tab-title");
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/Panel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698