Title: [123884] trunk/Source/WebCore
Revision
123884
Author
[email protected]
Date
2012-07-27 10:39:01 -0700 (Fri, 27 Jul 2012)

Log Message

WebKit should expose @title as label (AXTitle or AXDescription) sometimes instead of AXHelp, according to the ARIA text alt computation
https://bugs.webkit.org/show_bug.cgi?id=91911

Reviewed by Darin Adler.

Update comments around code to explain rationale.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::helpText):
(WebCore::AccessibilityRenderObject::accessibilityDescription):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (123883 => 123884)


--- trunk/Source/WebCore/ChangeLog	2012-07-27 17:34:27 UTC (rev 123883)
+++ trunk/Source/WebCore/ChangeLog	2012-07-27 17:39:01 UTC (rev 123884)
@@ -1,3 +1,16 @@
+2012-07-28  Chris Fleizach  <[email protected]>
+
+        WebKit should expose @title as label (AXTitle or AXDescription) sometimes instead of AXHelp, according to the ARIA text alt computation
+        https://bugs.webkit.org/show_bug.cgi?id=91911
+
+        Reviewed by Darin Adler.
+
+        Update comments around code to explain rationale.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::helpText):
+        (WebCore::AccessibilityRenderObject::accessibilityDescription):
+
 2012-07-27  Zoltan Horvath  <[email protected]>
 
         Add runtime flag to enable/disable JS memory information

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (123883 => 123884)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2012-07-27 17:34:27 UTC (rev 123883)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2012-07-27 17:39:01 UTC (rev 123884)
@@ -1036,16 +1036,16 @@
     if (!describedBy.isEmpty())
         return describedBy;
     
-    String descriptiveText = accessibilityDescription();
+    String description = accessibilityDescription();
     for (RenderObject* curr = m_renderer; curr; curr = curr->parent()) {
         if (curr->node() && curr->node()->isHTMLElement()) {
             const AtomicString& summary = static_cast<Element*>(curr->node())->getAttribute(summaryAttr);
             if (!summary.isEmpty())
                 return summary;
             
-            // The title attribute should be used as help text, unless it is already being used as descriptive text.
+            // The title attribute should be used as help text unless it is already being used as descriptive text.
             const AtomicString& title = static_cast<Element*>(curr->node())->getAttribute(titleAttr);
-            if (!title.isEmpty() && descriptiveText != title)
+            if (!title.isEmpty() && description != title)
                 return title;
         }
         
@@ -1501,7 +1501,10 @@
     if (isWebArea())
         return webAreaAccessibilityDescription();
     
-    // The description should fall back to the title attribute as a last resort.
+    // An element's descriptive text is comprised of title() (what's visible on the screen) and accessibilityDescription() (other descriptive text).
+    // Both are used to generate what a screen reader speaks.
+    // If this point is reached (i.e. there's no accessibilityDescription) and there's no title(), we should fallback to using the title attribute.
+    // The title attribute is normally used as help text (because it is a tooltip), but if there is nothing else available, this should be used (according to ARIA).
     if (title().isEmpty())
         return getAttribute(titleAttr);
     
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to