Diff
Modified: trunk/LayoutTests/ChangeLog (166174 => 166175)
--- trunk/LayoutTests/ChangeLog 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/LayoutTests/ChangeLog 2014-03-24 17:08:00 UTC (rev 166175)
@@ -1,3 +1,20 @@
+2014-03-24 Chris Fleizach <cfleiz...@apple.com>
+
+ <hr> should expose AXRole/AXSubrole, etc
+ https://bugs.webkit.org/show_bug.cgi?id=109015
+
+ Reviewed by Mario Sanchez Prada.
+
+ * accessibility/lists.html:
+ - An errant <hr> element was in this test which changed results
+ * accessibility/roles-computedRoleString-expected.txt:
+ * accessibility/roles-exposed.html:
+ * platform/gtk/accessibility/roles-exposed-expected.txt: Added.
+ * platform/mac/accessibility/hr-element-expected.txt: Added.
+ * platform/mac/accessibility/hr-element.html: Added.
+ * platform/mac/accessibility/lists-expected.txt:
+ * platform/mac/accessibility/roles-exposed-expected.txt:
+
2014-03-24 Antti Koivisto <an...@apple.com>
Invalidate sibling text node style when needed instead of attaching synchronously
Modified: trunk/LayoutTests/accessibility/lists.html (166174 => 166175)
--- trunk/LayoutTests/accessibility/lists.html 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/LayoutTests/accessibility/lists.html 2014-03-24 17:08:00 UTC (rev 166175)
@@ -25,7 +25,7 @@
<dd>meaning 2</dd>
</dl>
- <BR><BR><BR><hr><BR>
+ <BR><BR><BR><BR>
<div id="result"></div>
<script>
Modified: trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt (166174 => 166175)
--- trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt 2014-03-24 17:08:00 UTC (rev 166175)
@@ -19,6 +19,7 @@
PASS: h4 -> heading.
PASS: h5 -> heading.
PASS: h5 -> heading.
+PASS: hr -> separator.
PASS: img[alt='X'] -> img.
PASS: input[type='button'] -> button.
PASS: input[type='checkbox'] -> checkbox.
Modified: trunk/LayoutTests/accessibility/roles-exposed.html (166174 => 166175)
--- trunk/LayoutTests/accessibility/roles-exposed.html 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/LayoutTests/accessibility/roles-exposed.html 2014-03-24 17:08:00 UTC (rev 166175)
@@ -50,7 +50,7 @@
<h4 data-platform="atk,mac" data-role="AXHeading" data-subrole="" data-roledescription="heading" class="ex">X</h4>
<h5 data-platform="atk,mac" data-role="AXHeading" data-subrole="" data-roledescription="heading" class="ex">X</h5>
<h6 data-platform="atk,mac" data-role="AXHeading" data-subrole="" data-roledescription="heading" class="ex">X</h6>
-<!-- http://webkit.org/b/109015 --><hr data-platform="atk,mac" data-role="" data-role-atk="AXSeparator" data-subrole="" data-roledescription="" class="ex">
+<hr data-platform="atk,mac" data-role-mac="AXSplitter" data-role-atk="AXSeparator" data-subrole="AXContentSeparator" data-roledescription="separator" class="ex">
<!-- skipped <html> -->
<!-- [ATK] Skipped: not focusable --><i data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</i>
<!-- skipped <iframe> -->
Added: trunk/LayoutTests/platform/mac/accessibility/hr-element-expected.txt (0 => 166175)
--- trunk/LayoutTests/platform/mac/accessibility/hr-element-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/hr-element-expected.txt 2014-03-24 17:08:00 UTC (rev 166175)
@@ -0,0 +1,30 @@
+This tests that the 'hr' element is accessible on the Mac.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+hr1 role: AXRole: AXSplitter
+hr1 subrole: AXSubrole: AXContentSeparator
+hr1 roleDescription: AXRoleDescription: separator
+hr1 description: AXDescription:
+hr1 is value settable: false
+hr1 is enabled: false
+
+hr2 role: AXRole: AXSplitter
+hr2 subrole: AXSubrole: AXContentSeparator
+hr2 roleDescription: AXRoleDescription: separator
+hr2 description: AXDescription:
+hr2 is value settable: false
+hr2 is enabled: false
+
+hr3 role: AXRole: AXSplitter
+hr3 subrole: AXSubrole: AXContentSeparator
+hr3 roleDescription: AXRoleDescription: separator
+hr3 description: AXDescription: RULER
+hr3 is value settable: false
+hr3 is enabled: false
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/platform/mac/accessibility/hr-element.html (0 => 166175)
--- trunk/LayoutTests/platform/mac/accessibility/hr-element.html (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/hr-element.html 2014-03-24 17:08:00 UTC (rev 166175)
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<div id="content">
+<hr id="hr1" _onclick_="test();">
+
+<hr id="hr2">
+
+<hr id="hr3" aria-label="RULER" tabindex="0">
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+ description("This tests that the 'hr' element is accessible on the Mac.");
+
+ if (window.accessibilityController) {
+
+ for (var k = 1; k <= 3; k++) {
+ var hr = accessibilityController.accessibleElementById("hr" + k);
+ debug("hr" + k + " role: " + hr.role);
+ debug("hr" + k + " subrole: " + hr.subrole);
+ debug("hr" + k + " roleDescription: " + hr.roleDescription);
+ debug("hr" + k + " description: " + hr.description);
+ debug("hr" + k + " is value settable: " + hr.isAttributeSettable('AXValue'));
+ debug("hr" + k + " is enabled: " + hr.isEnabled + "\n");
+ }
+ document.getElementById("content").style.visibility = "none";
+ }
+
+</script>
+
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/platform/mac/accessibility/lists-expected.txt (166174 => 166175)
--- trunk/LayoutTests/platform/mac/accessibility/lists-expected.txt 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/LayoutTests/platform/mac/accessibility/lists-expected.txt 2014-03-24 17:08:00 UTC (rev 166175)
@@ -110,7 +110,7 @@
AXChildren: <array of size 0>
AXHelp:
AXParent: <AXGroup>
-AXSize: NSSize: {784, 54}
+AXSize: NSSize: {784, 72}
AXTitle:
AXDescription:
AXValue:
@@ -132,36 +132,8 @@
AXElementBusy: 0
------------
-AXRole: AXGroup
-AXSubrole: (null)
-AXRoleDescription: group
-AXChildren: <array of size 0>
-AXHelp:
-AXParent: <AXGroup>
-AXSize: NSSize: {784, 18}
-AXTitle:
-AXDescription:
-AXValue:
-AXFocused: 0
-AXEnabled: 1
-AXWindow: <AXGroup>
-AXSelectedTextMarkerRange: (null)
-AXStartTextMarker: <AXGroup>
-AXEndTextMarker: <AXGroup>
-AXVisited: 0
-AXLinkedUIElements: (null)
-AXSelected: 0
-AXBlockQuoteLevel: 0
-AXTopLevelUIElement: <AXGroup>
-AXLanguage:
-AXDOMIdentifier:
-AXDOMClassList: <array of size 0>
-AXTitleUIElement: (null)
-AXElementBusy: 0
-------------
-
AXRole: AXGroup
AXSubrole: (null)
AXRoleDescription: group
Modified: trunk/LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt (166174 => 166175)
--- trunk/LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt 2014-03-24 17:08:00 UTC (rev 166175)
@@ -170,9 +170,9 @@
AXRoleDescription: heading
PASS: hr
- AXRole:
- AXSubrole:
- AXRoleDescription:
+ AXRole: AXSplitter
+ AXSubrole: AXContentSeparator
+ AXRoleDescription: separator
PASS: i
AXRole:
Modified: trunk/Source/WebCore/ChangeLog (166174 => 166175)
--- trunk/Source/WebCore/ChangeLog 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/Source/WebCore/ChangeLog 2014-03-24 17:08:00 UTC (rev 166175)
@@ -1,3 +1,34 @@
+2014-03-24 Chris Fleizach <cfleiz...@apple.com>
+
+ <hr> should expose AXRole/AXSubrole, etc
+ https://bugs.webkit.org/show_bug.cgi?id=109015
+
+ Reviewed by Mario Sanchez Prada.
+
+ Expose the <hr> element to Mac and iOS through the accessibility interface.
+
+ Test: platform/mac/accessibility/hr-element.html
+
+ * English.lproj/Localizable.strings:
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore::AccessibilityNodeObject::isEnabled):
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::computedRoleString):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
+ * accessibility/atk/AccessibilityObjectAtk.cpp:
+ (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+ * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+ (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
+ (-[WebAccessibilityObjectWrapper accessibilityLabel]):
+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+ (createAccessibilityRoleMap):
+ (-[WebAccessibilityObjectWrapper subrole]):
+ (-[WebAccessibilityObjectWrapper roleDescription]):
+ * platform/LocalizedStrings.cpp:
+ (WebCore::AXHorizontalRuleDescriptionText):
+ * platform/LocalizedStrings.h:
+
2014-03-24 Antti Koivisto <an...@apple.com>
Invalidate sibling text node style when needed instead of attaching synchronously
@@ -3062,7 +3093,6 @@
* platform/ios/WebSafeGCActivityCallbackIOS.h:
-=======
2014-03-19 Antti Koivisto <an...@apple.com>
Crash with long selector list
Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (166174 => 166175)
--- trunk/Source/WebCore/English.lproj/Localizable.strings 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings 2014-03-24 17:08:00 UTC (rev 166175)
@@ -931,6 +931,9 @@
/* Verb stating the action that will occur when a radio button is clicked, as used by accessibility */
"select" = "select";
+/* accessibility role description for a horizontal rule [<hr>] */
+"separator" = "separator";
+
/* HTTP result code string */
"server error" = "server error";
Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (166174 => 166175)
--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2014-03-24 17:08:00 UTC (rev 166175)
@@ -640,7 +640,10 @@
if (equalIgnoringCase(disabledStatus, "false"))
break;
}
-
+
+ if (roleValue() == HorizontalRuleRole)
+ return false;
+
Node* node = this->node();
if (!node || !node->isElementNode())
return true;
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (166174 => 166175)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2014-03-24 17:08:00 UTC (rev 166175)
@@ -1749,7 +1749,11 @@
String AccessibilityObject::computedRoleString() const
{
// FIXME: Need a few special cases that aren't in the RoleMap: option, etc. http://webkit.org/b/128296
- return reverseAriaRoleMap().get(roleValue());
+ AccessibilityRole role = roleValue();
+ if (role == HorizontalRuleRole)
+ role = SplitterRole;
+
+ return reverseAriaRoleMap().get(role);
}
bool AccessibilityObject::hasHighlighting() const
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (166174 => 166175)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2014-03-24 17:08:00 UTC (rev 166175)
@@ -1252,7 +1252,10 @@
if (ariaRoleAttribute() != UnknownRole)
return false;
-
+
+ if (roleValue() == HorizontalRuleRole)
+ return false;
+
// don't ignore labels, because they serve as TitleUIElements
Node* node = m_renderer->node();
if (node && isHTMLLabelElement(node))
Modified: trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp (166174 => 166175)
--- trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp 2014-03-24 17:08:00 UTC (rev 166175)
@@ -42,9 +42,6 @@
return DefaultBehavior;
AccessibilityRole role = roleValue();
- if (role == HorizontalRuleRole)
- return IncludeObject;
-
// We expose the slider as a whole but not its value indicator.
if (role == SliderThumbRole)
return IgnoreObject;
Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (166174 => 166175)
--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm 2014-03-24 17:08:00 UTC (rev 166175)
@@ -44,6 +44,7 @@
#import "HTMLNames.h"
#import "IntRect.h"
#import "IntSize.h"
+#import "LocalizedStrings.h"
#import "Page.h"
#import "Range.h"
#import "RenderView.h"
@@ -620,6 +621,7 @@
case ListBoxOptionRole:
case TabRole:
case DocumentMathRole:
+ case HorizontalRuleRole:
return true;
case StaticTextRole:
{
@@ -750,9 +752,11 @@
NSString *axTitle = [self accessibilityTitle];
NSString *axDescription = [self accessibilityDescription];
NSString *landmarkDescription = [self ariaLandmarkRoleDescription];
-
+
NSMutableString *result = [NSMutableString string];
-
+ if (m_object->roleValue() == HorizontalRuleRole)
+ appendStringToResult(result, AXHorizontalRuleDescriptionText());
+
appendStringToResult(result, axTitle);
appendStringToResult(result, axDescription);
if ([self stringValueShouldBeUsedInLabel]) {
Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (166174 => 166175)
--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm 2014-03-24 17:08:00 UTC (rev 166175)
@@ -116,6 +116,10 @@
#define NSAccessibilityDescriptionListSubrole @"AXDescriptionList"
#endif
+#ifndef NSAccessibilityContentSeparatorSubrole
+#define NSAccessibilityContentSeparatorSubrole @"AXContentSeparator"
+#endif
+
// Miscellaneous
#ifndef NSAccessibilityBlockQuoteLevelAttribute
#define NSAccessibilityBlockQuoteLevelAttribute @"AXBlockQuoteLevel"
@@ -1916,7 +1920,8 @@
{ LegendRole, NSAccessibilityGroupRole },
{ MathElementRole, NSAccessibilityGroupRole },
{ AudioRole, NSAccessibilityGroupRole },
- { VideoRole, NSAccessibilityGroupRole }
+ { VideoRole, NSAccessibilityGroupRole },
+ { HorizontalRuleRole, NSAccessibilitySplitterRole }
};
AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap;
@@ -1962,6 +1967,9 @@
}
}
+ if (m_object->roleValue() == HorizontalRuleRole)
+ return NSAccessibilityContentSeparatorSubrole;
+
if (m_object->isSpinButtonPart()) {
if (toAccessibilitySpinButtonPart(m_object)->isIncrementor())
return NSAccessibilityIncrementArrowSubrole;
@@ -2155,6 +2163,9 @@
return AXDescriptionListText();
}
+ if (m_object->roleValue() == HorizontalRuleRole)
+ return AXHorizontalRuleDescriptionText();
+
// AppKit also returns AXTab for the role description for a tab item.
if (m_object->isTabItem())
return NSAccessibilityRoleDescription(@"AXTab", nil);
Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (166174 => 166175)
--- trunk/Source/WebCore/platform/LocalizedStrings.cpp 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp 2014-03-24 17:08:00 UTC (rev 166175)
@@ -700,6 +700,12 @@
return WEB_UI_STRING("math", "An ARIA accessibility group that contains mathematical symbols.");
return String();
}
+
+String AXHorizontalRuleDescriptionText()
+{
+ return WEB_UI_STRING("separator", "accessibility role description for a horizontal rule [<hr>]");
+}
+
#endif // PLATFORM(COCOA)
String missingPluginText()
Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (166174 => 166175)
--- trunk/Source/WebCore/platform/LocalizedStrings.h 2014-03-24 16:52:06 UTC (rev 166174)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h 2014-03-24 17:08:00 UTC (rev 166175)
@@ -181,6 +181,7 @@
#endif
#if PLATFORM(COCOA)
String AXARIAContentGroupText(const String& ariaType);
+ String AXHorizontalRuleDescriptionText();
#endif
String missingPluginText();