Title: [154196] trunk/Source/WebInspectorUI
Revision
154196
Author
[email protected]
Date
2013-08-16 11:43:14 -0700 (Fri, 16 Aug 2013)

Log Message

<https://webkit.org/b/118105> Web Inspector: AX: Add support for ARIA tablists/tabs to inspector tabs

Patch by James Craig <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (154195 => 154196)


--- trunk/Source/WebInspectorUI/ChangeLog	2013-08-16 18:42:41 UTC (rev 154195)
+++ trunk/Source/WebInspectorUI/ChangeLog	2013-08-16 18:43:14 UTC (rev 154196)
@@ -1,3 +1,23 @@
+2013-08-16  James Craig  <[email protected]>
+
+        <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  <[email protected]>
 
         <https://webkit.org/b/119778> Add Canvas protocol observer

Modified: trunk/Source/WebInspectorUI/UserInterface/ActivateButtonNavigationItem.js (154195 => 154196)


--- trunk/Source/WebInspectorUI/UserInterface/ActivateButtonNavigationItem.js	2013-08-16 18:42:41 UTC (rev 154195)
+++ trunk/Source/WebInspectorUI/UserInterface/ActivateButtonNavigationItem.js	2013-08-16 18:43:14 UTC (rev 154196)
@@ -23,12 +23,13 @@
  * 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 @@
         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");
         }
     },
 

Modified: trunk/Source/WebInspectorUI/UserInterface/ActivateButtonToolbarItem.js (154195 => 154196)


--- trunk/Source/WebInspectorUI/UserInterface/ActivateButtonToolbarItem.js	2013-08-16 18:42:41 UTC (rev 154195)
+++ trunk/Source/WebInspectorUI/UserInterface/ActivateButtonToolbarItem.js	2013-08-16 18:43:14 UTC (rev 154196)
@@ -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);
 

Modified: trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.js (154195 => 154196)


--- trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.js	2013-08-16 18:42:41 UTC (rev 154195)
+++ trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.js	2013-08-16 18:43:14 UTC (rev 154196)
@@ -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);
 

Modified: trunk/Source/WebInspectorUI/UserInterface/SidebarPanel.js (154195 => 154196)


--- trunk/Source/WebInspectorUI/UserInterface/SidebarPanel.js	2013-08-16 18:42:41 UTC (rev 154195)
+++ trunk/Source/WebInspectorUI/UserInterface/SidebarPanel.js	2013-08-16 18:43:14 UTC (rev 154196)
@@ -28,7 +28,7 @@
 
     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;
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Toolbar.js (154195 => 154196)


--- trunk/Source/WebInspectorUI/UserInterface/Toolbar.js	2013-08-16 18:42:41 UTC (rev 154195)
+++ trunk/Source/WebInspectorUI/UserInterface/Toolbar.js	2013-08-16 18:43:14 UTC (rev 154196)
@@ -35,6 +35,7 @@
 
     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 @@
 
     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);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to