Title: [164376] trunk
Revision
164376
Author
[email protected]
Date
2014-02-19 11:22:43 -0800 (Wed, 19 Feb 2014)

Log Message

Web Inspector: AX: clarify reason for ignored state where possible (hidden, default for tag, etc)
https://bugs.webkit.org/show_bug.cgi?id=129037

Patch by James Craig <[email protected]> on 2014-02-19
Reviewed by Timothy Hatcher.

Source/WebCore:

Passing back hidden and ignoredByDefault attrs to clarify some reasons for "ignored" status.

Test Updated: inspector-protocol/dom/getAccessibilityPropertiesForNode.html

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* inspector/protocol/DOM.json:

Source/WebInspectorUI:

Passing back hidden and ignoredByDefault attrs to clarify some reasons for "ignored" status.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/DOMNode.js:
* UserInterface/DOMNodeDetailsSidebarPanel.js:

LayoutTests:

Test updates to support hidden and ignoredByDefault in accessibility properties.

* inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt:
* inspector-protocol/dom/getAccessibilityPropertiesForNode.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (164375 => 164376)


--- trunk/LayoutTests/ChangeLog	2014-02-19 19:07:44 UTC (rev 164375)
+++ trunk/LayoutTests/ChangeLog	2014-02-19 19:22:43 UTC (rev 164376)
@@ -1,3 +1,15 @@
+2014-02-19  James Craig  <[email protected]>
+
+        Web Inspector: AX: clarify reason for ignored state where possible (hidden, default for tag, etc)
+        https://bugs.webkit.org/show_bug.cgi?id=129037
+
+        Reviewed by Timothy Hatcher.
+
+        Test updates to support hidden and ignoredByDefault in accessibility properties.
+
+        * inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt:
+        * inspector-protocol/dom/getAccessibilityPropertiesForNode.html:
+
 2014-02-19  Jon Honeycutt  <[email protected]>
 
         Add missing layout test results for

Modified: trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt (164375 => 164376)


--- trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt	2014-02-19 19:07:44 UTC (rev 164375)
+++ trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt	2014-02-19 19:22:43 UTC (rev 164376)
@@ -1,8 +1,21 @@
 Checking Web Inspector protocol for the Accessibility Node Inspector.
 
-           
-Total elements to be tested: 15.
+              
+Total elements to be tested: 23.
 
+<img src="" alt="x" style="display:none;">
+    exists: false
+    label: 
+    role: 
+
+<img src="" alt="x" aria-hidden="true">
+    exists: true
+    label: 
+    role: img
+    ignored: true
+    ignoredByDefault: true
+    hidden: true
+
 <img src="" alt="x">
     exists: true
     label: 
@@ -20,6 +33,20 @@
     role: img
     ignored: true
 
+<input style="display:none;">
+    exists: false
+    label: 
+    role: 
+
+<input aria-hidden="true">
+    exists: true
+    label: 
+    role: 
+    ignored: true
+    ignoredByDefault: true
+    hidden: true
+    required: false
+
 <input aria-invalid="fake-value-will-eval-to-true">
     exists: true
     label: 
@@ -46,6 +73,12 @@
     role: 
     required: true
 
+<input>
+    exists: true
+    label: 
+    role: 
+    required: false
+
 <input type="button">
     exists: true
     label: 
@@ -61,12 +94,29 @@
     label: 
     role: button
 
+<span aria-hidden="true"></span>
+    exists: true
+    label: 
+    role: 
+    ignored: true
+    ignoredByDefault: true
+    hidden: true
+
 <span></span>
     exists: true
     label: 
     role: 
     ignored: true
+    ignoredByDefault: true
 
+<div aria-hidden="true"></div>
+    exists: true
+    label: 
+    role: 
+    ignored: true
+    ignoredByDefault: true
+    hidden: true
+
 <div></div>
     exists: true
     label: 
@@ -85,6 +135,12 @@
     role: 
     ignored: true
 
+<script style="display:block;"></script>
+    exists: true
+    label: 
+    role: group
+    ignored: true
+
 <script></script>
     exists: false
     label: 

Modified: trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode.html (164375 => 164376)


--- trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode.html	2014-02-19 19:07:44 UTC (rev 164375)
+++ trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode.html	2014-02-19 19:22:43 UTC (rev 164376)
@@ -6,27 +6,33 @@
 
 <p>Checking Web Inspector protocol for the Accessibility Node Inspector.</p>
 
-<!-- This one is never rendered, so "exists" should return false. -->
 <script class="ex"></script>
+<script class="ex" style="display:block;"></script>
 
-<!-- The rest are rendered with various property differences. -->
 <div class="ex"><div></div></div>
 <div class="ex" role="presentation"><div></div></div>
 <div class="ex"></div>
+<div class="ex" aria-hidden="true"></div>
 <span class="ex"></span>
+<span class="ex" aria-hidden="true"></span>
 
 <div class="ex" role="button" tabindex="0"></div>
 <button class="ex"></button>
 <input class="ex" type="button">
 
+<input class="ex">
 <input class="ex" required>
 <input class="ex" aria-required="true">
 <input class="ex" aria-invalid="spelling">
 <input class="ex" aria-invalid="fake-value-will-eval-to-true">
+<input class="ex" aria-hidden="true">
+<input class="ex" style="display:none;">
 
 <img class="ex" src=""
 <img class="ex" src="" alt="">
 <img class="ex" src="" alt="x">
+<img class="ex" src="" alt="x" aria-hidden="true">
+<img class="ex" src="" alt="x" style="display:none;">
 
 <script type="text/_javascript_">
 

Modified: trunk/Source/WebCore/ChangeLog (164375 => 164376)


--- trunk/Source/WebCore/ChangeLog	2014-02-19 19:07:44 UTC (rev 164375)
+++ trunk/Source/WebCore/ChangeLog	2014-02-19 19:22:43 UTC (rev 164376)
@@ -1,3 +1,18 @@
+2014-02-19  James Craig  <[email protected]>
+
+        Web Inspector: AX: clarify reason for ignored state where possible (hidden, default for tag, etc)
+        https://bugs.webkit.org/show_bug.cgi?id=129037
+
+        Reviewed by Timothy Hatcher.
+
+        Passing back hidden and ignoredByDefault attrs to clarify some reasons for "ignored" status.
+
+        Test Updated: inspector-protocol/dom/getAccessibilityPropertiesForNode.html
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
+        * inspector/protocol/DOM.json:
+
 2014-02-19  Thiago de Barros Lacerda  <[email protected]>
 
         [WebRTC] Updating RTCConfiguration to match WebRTC editor's draft of 01/27/2014

Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (164375 => 164376)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2014-02-19 19:07:44 UTC (rev 164375)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2014-02-19 19:22:43 UTC (rev 164376)
@@ -1416,7 +1416,9 @@
 
     bool exists = false;
     bool ignored = true;
+    bool ignoredByDefault = false;
     String invalid = "false"; // String values: true, false, spelling, grammar, etc.
+    bool hidden = false;
     String label; // FIXME: Waiting on http://webkit.org/b/121134
     bool required = false;
     String role;
@@ -1426,11 +1428,14 @@
         if (AccessibilityObject* axObject = axObjectCache->getOrCreate(node)) {
             exists = true;
             ignored = axObject->accessibilityIsIgnored();
+            ignoredByDefault = axObject->accessibilityIsIgnoredByDefault();
             invalid = axObject->invalidStatus();
-            role = axObject->computedRoleString();
+            if (axObject->isARIAHidden() || axObject->isDOMHidden())
+                hidden = true;
             supportsRequired = axObject->supportsRequiredAttribute();
             if (supportsRequired)
                 required = axObject->isRequired();
+            role = axObject->computedRoleString();
         }
     }
     
@@ -1443,8 +1448,12 @@
     if (exists) {
         if (ignored)
             value->setIgnored(ignored);
+        if (ignoredByDefault)
+            value->setIgnoredByDefault(ignoredByDefault);
         if (invalid != "false")
             value->setInvalid(invalid);
+        if (hidden)
+            value->setHidden(hidden);
         if (supportsRequired)
             value->setRequired(required);
     }

Modified: trunk/Source/WebCore/inspector/protocol/DOM.json (164375 => 164376)


--- trunk/Source/WebCore/inspector/protocol/DOM.json	2014-02-19 19:07:44 UTC (rev 164375)
+++ trunk/Source/WebCore/inspector/protocol/DOM.json	2014-02-19 19:22:43 UTC (rev 164376)
@@ -61,7 +61,9 @@
             "properties": [
                 { "name": "exists", "type": "boolean", "description": "Returns whether there is an existing AX object for the DOM node. If this is false, all the other properties will be default values." },
                 { "name": "ignored", "type": "boolean", "optional": true, "description": "Returns whether the accessibility of the associated AX object node is ignored, whether heuristically or explicitly." },
+                { "name": "ignoredByDefault", "type": "boolean", "optional": true, "description": "Returns whether the accessibility of the associated AX object node is ignored by default for node type." },
                 { "name": "invalid", "type": "string", "optional": true, "description": "Returns the invalid status for form fields: true, false, grammar, spelling." },
+                { "name": "hidden", "type": "boolean", "optional": true, "description": "Returns true if node or an ancestor is hidden via CSS or explicit @aria-hidden, to clarify why the element is ignored." },
                 { "name": "label", "type": "string", "description": "Computed label value for the node, sometimes calculated by referencing other nodes." },
                 { "name": "required", "type": "boolean", "optional": true, "description": "Returns whether the element is required or not required." },
                 { "name": "role", "type": "string", "description": "Computed value for first recognized role token, default role per element, or overridden role." },

Modified: trunk/Source/WebInspectorUI/ChangeLog (164375 => 164376)


--- trunk/Source/WebInspectorUI/ChangeLog	2014-02-19 19:07:44 UTC (rev 164375)
+++ trunk/Source/WebInspectorUI/ChangeLog	2014-02-19 19:22:43 UTC (rev 164376)
@@ -1,3 +1,16 @@
+2014-02-19  James Craig  <[email protected]>
+
+        Web Inspector: AX: clarify reason for ignored state where possible (hidden, default for tag, etc)
+        https://bugs.webkit.org/show_bug.cgi?id=129037
+
+        Reviewed by Timothy Hatcher.
+
+        Passing back hidden and ignoredByDefault attrs to clarify some reasons for "ignored" status.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/DOMNode.js:
+        * UserInterface/DOMNodeDetailsSidebarPanel.js:
+
 2014-02-18  James Craig  <[email protected]>
 
         Web Inspector: AX: more properties: exists, required, and invalid (exists was previously combined with ignored)

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (164375 => 164376)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2014-02-19 19:07:44 UTC (rev 164375)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2014-02-19 19:22:43 UTC (rev 164376)
@@ -25,6 +25,7 @@
 localizedStrings["%s Event Dispatched"] = "%s Event Dispatched";
 localizedStrings["%s (computed)"] = "%s (computed)";
 localizedStrings["%s (default)"] = "%s (default)";
+localizedStrings["%s (hidden)"] = "%s (hidden)";
 localizedStrings["(anonymous function)"] = "(anonymous function)";
 localizedStrings["(program)"] = "(program)";
 localizedStrings["1 match"] = "1 match";

Modified: trunk/Source/WebInspectorUI/UserInterface/DOMNode.js (164375 => 164376)


--- trunk/Source/WebInspectorUI/UserInterface/DOMNode.js	2014-02-19 19:07:44 UTC (rev 164375)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMNode.js	2014-02-19 19:22:43 UTC (rev 164376)
@@ -449,7 +449,9 @@
                 callback({
                     exists: accessibilityProperties.exists,
                     ignored: accessibilityProperties.ignored,
+                    ignoredByDefault: accessibilityProperties.ignoredByDefault,
                     invalid: accessibilityProperties.invalid,
+                    hidden: accessibilityProperties.hidden,
                     label: accessibilityProperties.label,
                     required: accessibilityProperties.required,
                     role: accessibilityProperties.role

Modified: trunk/Source/WebInspectorUI/UserInterface/DOMNodeDetailsSidebarPanel.js (164375 => 164376)


--- trunk/Source/WebInspectorUI/UserInterface/DOMNodeDetailsSidebarPanel.js	2014-02-19 19:07:44 UTC (rev 164375)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMNodeDetailsSidebarPanel.js	2014-02-19 19:22:43 UTC (rev 164376)
@@ -248,7 +248,15 @@
 
             if (accessibilityProperties && accessibilityProperties.exists) {
                 
-                var ignored = accessibilityProperties.ignored ? WebInspector.UIString("Yes") : "";
+                var ignored = "";
+                if (accessibilityProperties.ignored) {
+                    ignored = WebInspector.UIString("Yes");
+                    if (accessibilityProperties.hidden)
+                        ignored = WebInspector.UIString("%s (hidden)").format(ignored);
+                    else if (accessibilityProperties.ignoredByDefault)
+                        ignored = WebInspector.UIString("%s (default)").format(ignored);
+                }
+
                 var invalid = accessibilityProperties.invalid ? accessibilityProperties.invalid : "";
 
                 // FIXME: label will always come back as empty. Blocked by http://webkit.org/b/121134
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to