<https://webkit.org/b/118105> Web Inspector: AX: Add support for ARIA tablists/tabs...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2013 18:43:14 +0000 (18:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2013 18:43:14 +0000 (18:43 +0000)
Patch by James Craig <james@cookiecrook.com> on 2013-08-16
Reviewed by Joseph Pecoraro.

Updating accessibility roles and attributes for single-select toolbar item sets.

* UserInterface/ActivateButtonNavigationItem.js:
(WebInspector.ActivateButtonNavigationItem):
(WebInspector.ActivateButtonNavigationItem.prototype.set activated):
* UserInterface/ActivateButtonToolbarItem.js:
(WebInspector.ActivateButtonToolbarItem):
* UserInterface/ButtonToolbarItem.js:
(WebInspector.ButtonToolbarItem):
* UserInterface/SidebarPanel.js:
(WebInspector.SidebarPanel):
* UserInterface/Toolbar.js:
(WebInspector.Toolbar):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154196 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/ActivateButtonNavigationItem.js
Source/WebInspectorUI/UserInterface/ActivateButtonToolbarItem.js
Source/WebInspectorUI/UserInterface/ButtonToolbarItem.js
Source/WebInspectorUI/UserInterface/SidebarPanel.js
Source/WebInspectorUI/UserInterface/Toolbar.js

index 3a4a0119dc470a1a554f2c02169a5655d6853824..91284e0e0e95b641e2ef821d38f1dca970742974 100644 (file)
@@ -1,3 +1,23 @@
+2013-08-16  James Craig  <james@cookiecrook.com>
+
+        <https://webkit.org/b/118105> Web Inspector: AX: Add support for ARIA tablists/tabs to inspector tabs
+
+        Reviewed by Joseph Pecoraro.
+
+        Updating accessibility roles and attributes for single-select toolbar item sets.
+
+        * UserInterface/ActivateButtonNavigationItem.js:
+        (WebInspector.ActivateButtonNavigationItem):
+        (WebInspector.ActivateButtonNavigationItem.prototype.set activated):
+        * UserInterface/ActivateButtonToolbarItem.js:
+        (WebInspector.ActivateButtonToolbarItem):
+        * UserInterface/ButtonToolbarItem.js:
+        (WebInspector.ButtonToolbarItem):
+        * UserInterface/SidebarPanel.js:
+        (WebInspector.SidebarPanel):
+        * UserInterface/Toolbar.js:
+        (WebInspector.Toolbar):
+
 2013-08-13  Dean Jackson  <dino@apple.com>
 
         <https://webkit.org/b/119778> Add Canvas protocol observer
index 1583d96559b29b06a52dd5be030b2b22c565baf3..e5d361f2faf8a9780b4789011ccd24a4aea28687 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.ActivateButtonNavigationItem = function(identifier, defaultToolTip, activatedToolTip, image, imageWidth, imageHeight, suppressEmboss)
+WebInspector.ActivateButtonNavigationItem = function(identifier, defaultToolTip, activatedToolTip, image, imageWidth, imageHeight, suppressEmboss, role)
 {
-    WebInspector.ButtonNavigationItem.call(this, identifier, defaultToolTip, image, imageWidth, imageHeight, suppressEmboss);
+    WebInspector.ButtonNavigationItem.call(this, identifier, defaultToolTip, image, imageWidth, imageHeight, suppressEmboss, role);
 
     this._defaultToolTip = defaultToolTip;
     this._activatedToolTip = activatedToolTip || defaultToolTip;
+    this._role = role;
 };
 
 WebInspector.ActivateButtonNavigationItem.StyleClassName = "activate";
@@ -59,9 +60,13 @@ WebInspector.ActivateButtonNavigationItem.prototype = {
         if (flag) {
             this.toolTip = this._activatedToolTip;
             this.element.classList.add(WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName);
+            if (this._role === "tab")
+                this.element.setAttribute("aria-selected", "true");
         } else {
             this.toolTip = this._defaultToolTip;
             this.element.classList.remove(WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName);
+            if (this._role === "tab")
+                this.element.removeAttribute("aria-selected");
         }
     },
 
index af4d6614a2fe3d6884daebae1e09d7339a8edd3c..afa4327a4dad00fec5f89da95ea0159644e843ce 100644 (file)
@@ -23,9 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.ActivateButtonToolbarItem = function(identifier, defaultToolTip, activatedToolTip, label, image, suppressEmboss)
+WebInspector.ActivateButtonToolbarItem = function(identifier, defaultToolTip, activatedToolTip, label, image, suppressEmboss, role)
 {
-    WebInspector.ActivateButtonNavigationItem.call(this, identifier, defaultToolTip, activatedToolTip, image, 32, 32, suppressEmboss);
+    WebInspector.ActivateButtonNavigationItem.call(this, identifier, defaultToolTip, activatedToolTip, image, 32, 32, suppressEmboss, role);
 
     console.assert(label);
 
index ee2442e2f9a6efa8e1e704eaa3cb0ecf2e8bea70..61c409e814968ca7db209f4a060cf62d0908e401 100644 (file)
@@ -23,9 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.ButtonToolbarItem = function(identifier, toolTip, label, image, suppressEmboss)
+WebInspector.ButtonToolbarItem = function(identifier, toolTip, label, image, suppressEmboss, role)
 {
-    WebInspector.ButtonNavigationItem.call(this, identifier, toolTip, image, 32, 32, suppressEmboss);
+    WebInspector.ButtonNavigationItem.call(this, identifier, toolTip, image, 32, 32, suppressEmboss, role);
 
     console.assert(label);
 
index e6da757a274f9dcc80746c4688321d25636a0a00..3e5d37ccd364e128fe273bd36b5d68747ac42dc7 100644 (file)
@@ -28,7 +28,7 @@ WebInspector.SidebarPanel = function(identifier, displayName, showToolTip, hideT
 
     this._identifier = identifier;
 
-    this._toolbarItem = new WebInspector.ActivateButtonToolbarItem(identifier, showToolTip, hideToolTip, displayName, image);
+    this._toolbarItem = new WebInspector.ActivateButtonToolbarItem(identifier, showToolTip, hideToolTip, displayName, image, null, "tab");
     this._toolbarItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this.toggle, this);
     this._toolbarItem.enabled = false;
 
index 963da37623576741bd2f602481a62f9baf98218d..643fdb4f271fec2b7a2ddce568264140287f3c4b 100644 (file)
@@ -35,6 +35,7 @@ WebInspector.Toolbar = function(element, navigationItems) {
 
     this._leftSectionElement = document.createElement("div");
     this._leftSectionElement.className = WebInspector.Toolbar.ItemSectionStyleClassName + " " + WebInspector.Toolbar.LeftItemSectionStyleClassName;
+    this._leftSectionElement.setAttribute("role", "tablist");
     this._element.appendChild(this._leftSectionElement);
 
     this._centerSectionElement = document.createElement("div");
@@ -43,6 +44,7 @@ WebInspector.Toolbar = function(element, navigationItems) {
 
     this._rightSectionElement = document.createElement("div");
     this._rightSectionElement.className = WebInspector.Toolbar.ItemSectionStyleClassName + " " + WebInspector.Toolbar.RightItemSectionStyleClassName;
+    this._rightSectionElement.setAttribute("role", "tablist");
     this._element.appendChild(this._rightSectionElement);
 
     this._element.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), false);