Title: [137416] trunk/Source/WebCore
Revision
137416
Author
[email protected]
Date
2012-12-11 22:04:13 -0800 (Tue, 11 Dec 2012)

Log Message

AX: accessibilityIsIgnored should avoid computing textUnderElement
https://bugs.webkit.org/show_bug.cgi?id=104688

Reviewed by Chris Fleizach.

Simplify the logic in accessibilityIsIgnored without affecting
the results of any tests. In particular, avoid expensive calls to
textUnderElement.

Covered by existing tests.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isGenericFocusableElement):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (137415 => 137416)


--- trunk/Source/WebCore/ChangeLog	2012-12-12 05:58:45 UTC (rev 137415)
+++ trunk/Source/WebCore/ChangeLog	2012-12-12 06:04:13 UTC (rev 137416)
@@ -1,3 +1,21 @@
+2012-12-11  Dominic Mazzoni  <[email protected]>
+
+        AX: accessibilityIsIgnored should avoid computing textUnderElement
+        https://bugs.webkit.org/show_bug.cgi?id=104688
+
+        Reviewed by Chris Fleizach.
+
+        Simplify the logic in accessibilityIsIgnored without affecting
+        the results of any tests. In particular, avoid expensive calls to
+        textUnderElement.
+
+        Covered by existing tests.
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::isGenericFocusableElement):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+
 2012-12-11  Kentaro Hara  <[email protected]>
 
         [V8] Reachable event listeners on image elements can be collected in a minor DOM GC

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (137415 => 137416)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2012-12-12 05:58:45 UTC (rev 137415)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2012-12-12 06:04:13 UTC (rev 137416)
@@ -1036,6 +1036,11 @@
     if (node() && node()->hasTagName(bodyTag))
         return false;
 
+    // An SVG root is focusable by default, but it's probably not interactive, so don't
+    // include it. It can still be made accessible by giving it an ARIA role.
+    if (roleValue() == SVGRootRole)
+        return false;
+
     return true;
 }
 

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (137415 => 137416)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2012-12-12 05:58:45 UTC (rev 137415)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2012-12-12 06:04:13 UTC (rev 137416)
@@ -1265,8 +1265,25 @@
     // check if there's some kind of accessible name for the element)
     // to decide an element's visibility is not as definitive as
     // previous checks, so this should remain as one of the last.
-    if (!helpText().isEmpty() || !title().isEmpty() || !accessibilityDescription().isEmpty())
+    //
+    // These checks are simplified in the interest of execution speed;
+    // for example, any element having an alt attribute will make it
+    // not ignored, rather than just images.
+    if (!getAttribute(aria_helpAttr).isEmpty() || !getAttribute(aria_describedbyAttr).isEmpty() || !getAttribute(altAttr).isEmpty() || !getAttribute(titleAttr).isEmpty())
         return false;
+
+    // Don't ignore generic focusable elements like <div tabindex=0>
+    // unless they're completely empty, with no children.
+    if (isGenericFocusableElement() && node->firstChild())
+        return false;
+
+    if (!ariaAccessibilityDescription().isEmpty())
+        return false;
+
+#if ENABLE(MATHML)
+    if (!getAttribute(MathMLNames::alttextAttr).isEmpty())
+        return false;
+#endif
     
     // By default, objects should be ignored so that the AX hierarchy is not 
     // filled with unnecessary items.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to