Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1918)

Unified Diff: Source/modules/accessibility/AXRenderObject.cpp

Issue 762783002: Adding a11y support for HTML5 <datalist> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding support to expose link element which is inside a label element Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXRenderObject.cpp
diff --git a/Source/modules/accessibility/AXRenderObject.cpp b/Source/modules/accessibility/AXRenderObject.cpp
index dad5bff6c5d340eb100d5258322fc909b5d6ecb4..800231211eb824ed60199112614cf6145c27cdb6 100644
--- a/Source/modules/accessibility/AXRenderObject.cpp
+++ b/Source/modules/accessibility/AXRenderObject.cpp
@@ -264,36 +264,23 @@ AccessibilityRole AXRenderObject::determineAccessibilityRole()
Node* node = m_renderer->node();
RenderBoxModelObject* cssBox = renderBoxModelObject();
- if (node && node->isLink()) {
- if (cssBox && cssBox->isImage())
- return ImageMapRole;
- return LinkRole;
- }
if ((cssBox && cssBox->isListItem()) || isHTMLLIElement(node))
return ListItemRole;
if (m_renderer->isListMarker())
return ListMarkerRole;
- if (isHTMLButtonElement(node))
- return buttonRoleType();
- if (isHTMLDetailsElement(node))
- return DetailsRole;
- if (isHTMLSummaryElement(node)) {
- if (node->parentElement() && isHTMLDetailsElement(node->parentElement()))
- return DisclosureTriangleRole;
- return UnknownRole;
- }
if (isHTMLLegendElement(node))
return LegendRole;
if (m_renderer->isText())
return StaticTextRole;
if (cssBox && cssBox->isImage()) {
+ if (node && node->isLink())
+ return ImageMapRole;
if (isHTMLInputElement(node))
return ariaHasPopup() ? PopUpButtonRole : ButtonRole;
if (isSVGImage())
return SVGRootRole;
return ImageRole;
}
-
// Note: if JavaScript is disabled, the renderer won't be a RenderHTMLCanvas.
if (isHTMLCanvasElement(node) && m_renderer->isCanvas())
return CanvasRole;
@@ -301,53 +288,6 @@ AccessibilityRole AXRenderObject::determineAccessibilityRole()
if (cssBox && cssBox->isRenderView())
return WebAreaRole;
- if (cssBox && cssBox->isTextArea())
- return TextAreaRole;
-
- if (isHTMLInputElement(node)) {
- HTMLInputElement& input = toHTMLInputElement(*node);
- const AtomicString& type = input.type();
- if (type == InputTypeNames::button) {
- if ((node->parentNode() && isHTMLMenuElement(node->parentNode())) || (parentObject() && parentObject()->roleValue() == MenuRole))
- return MenuItemRole;
- return buttonRoleType();
- }
- if (type == InputTypeNames::checkbox) {
- if ((node->parentNode() && isHTMLMenuElement(node->parentNode())) || (parentObject() && parentObject()->roleValue() == MenuRole))
- return MenuItemCheckBoxRole;
- return CheckBoxRole;
- }
- if (type == InputTypeNames::date)
- return DateRole;
- if (type == InputTypeNames::datetime
- || type == InputTypeNames::datetime_local
- || type == InputTypeNames::month
- || type == InputTypeNames::week)
- return DateTimeRole;
- if (type == InputTypeNames::radio) {
- if ((node->parentNode() && isHTMLMenuElement(node->parentNode())) || (parentObject() && parentObject()->roleValue() == MenuRole))
- return MenuItemRadioRole;
- return RadioButtonRole;
- }
- if (type == InputTypeNames::file)
- return ButtonRole;
- if (type == InputTypeNames::number)
- return SpinButtonRole;
- if (input.isTextButton())
- return buttonRoleType();
- if (type == InputTypeNames::color)
- return ColorWellRole;
- if (type == InputTypeNames::time)
- return TimeRole;
- return TextFieldRole;
- }
-
- if (cssBox && cssBox->isMenuList())
- return PopUpButtonRole;
-
- if (headingLevel())
- return HeadingRole;
-
if (m_renderer->isSVGImage())
return ImageRole;
if (m_renderer->isSVGRoot())
@@ -356,9 +296,6 @@ AccessibilityRole AXRenderObject::determineAccessibilityRole()
if (node && node->hasTagName(ddTag))
return DescriptionListDetailRole;
- if (node && node->hasTagName(dlTag))
- return DescriptionListRole;
-
if (node && node->hasTagName(dtTag))
return DescriptionListTermRole;
@@ -375,33 +312,12 @@ AccessibilityRole AXRenderObject::determineAccessibilityRole()
if (m_renderer->isHR())
return SplitterRole;
- if (isHTMLOutputElement(node))
- return StatusRole;
-
- if (isHTMLParagraphElement(node))
- return ParagraphRole;
-
- if (isHTMLLabelElement(node))
- return LabelRole;
-
- if (isHTMLRubyElement(node))
- return RubyRole;
-
- if (isHTMLDivElement(node))
- return DivRole;
-
- if (isHTMLMeterElement(node))
- return MeterRole;
-
if (isHTMLFormElement(node))
return FormRole;
if (node && node->hasTagName(articleTag))
return ArticleRole;
- if (node && node->hasTagName(blockquoteTag))
- return BlockquoteRole;
-
if (node && node->hasTagName(mainTag))
return MainRole;
@@ -434,15 +350,6 @@ AccessibilityRole AXRenderObject::determineAccessibilityRole()
return IframeRole;
}
- if (isEmbeddedObject())
- return EmbeddedObjectRole;
-
- if (node && node->hasTagName(figcaptionTag))
- return FigcaptionRole;
-
- if (node && node->hasTagName(figureTag))
- return FigureRole;
-
// There should only be one banner/contentInfo per page. If header/footer are being used within an article or section
// then it should not be exposed as whole page's banner/contentInfo
if (node && node->hasTagName(headerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag))
@@ -450,8 +357,9 @@ AccessibilityRole AXRenderObject::determineAccessibilityRole()
if (node && node->hasTagName(footerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag))
return FooterRole;
- if (isHTMLAnchorElement(node) && isClickable())
- return LinkRole;
+ AccessibilityRole role = AXNodeObject::determineAccessibilityRoleUtil();
+ if (role != UnknownRole)
+ return role;
if (m_renderer->isRenderBlockFlow())
return GroupRole;
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698