Index: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp |
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp |
index 55b2fbcefa4cb0ad6a877212304485d89e12299d..460f37ea5926cd69516a87fe48041b1de3080b78 100644 |
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp |
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp |
@@ -547,7 +547,7 @@ AccessibilityRole AXNodeObject::NativeAccessibilityRoleIgnoringAria() const { |
return kHeadingRole; |
if (isHTMLDivElement(*GetNode())) |
- return kDivRole; |
+ return kGenericContainerRole; |
if (isHTMLMeterElement(*GetNode())) |
return kMeterRole; |
@@ -638,13 +638,13 @@ AccessibilityRole AXNodeObject::NativeAccessibilityRoleIgnoringAria() const { |
// whole page's banner/contentInfo but as a group role. |
if (GetNode()->HasTagName(headerTag)) { |
if (IsDescendantOfElementType(GetLandmarkRolesNotAllowed())) |
- return kGroupRole; |
+ return kGenericContainerRole; |
dmazzoni
2017/05/16 16:25:39
Up to you, but I can see an argument for this
bein
aleventhal1
2017/05/16 18:11:26
Acknowledged.
|
return kBannerRole; |
} |
if (GetNode()->HasTagName(footerTag)) { |
if (IsDescendantOfElementType(GetLandmarkRolesNotAllowed())) |
- return kGroupRole; |
+ return kGenericContainerRole; |
dmazzoni
2017/05/16 16:25:39
Same
aleventhal1
2017/05/16 18:11:26
Acknowledged.
|
return kFooterRole; |
} |
@@ -693,7 +693,7 @@ AccessibilityRole AXNodeObject::DetermineAccessibilityRole() { |
// The layout checks for focusability aren't critical here; a false |
// positive would be harmless. |
if (element->IsInCanvasSubtree() && element->SupportsFocus()) |
- return kGroupRole; |
+ return kGenericContainerRole; |
} |
return kUnknownRole; |
} |
@@ -1872,7 +1872,7 @@ String AXNodeObject::TextAlternative(bool recursive, |
return text_alternative; |
// Step 2F / 2G from: http://www.w3.org/TR/accname-aam-1.1 |
- if (recursive || NameFromContents()) { |
+ if (in_aria_labelled_by_traversal || NameFromContents(recursive)) { |
name_from = kAXNameFromContents; |
if (name_sources) { |
name_sources->push_back(NameSource(found_text_alternative)); |
@@ -2024,17 +2024,13 @@ bool AXNodeObject::NameFromLabelElement() const { |
return false; |
} |
-bool AXNodeObject::NameFromContents() const { |
- Node* node = GetNode(); |
- if (!node || !node->IsElementNode()) |
- return AXObjectImpl::NameFromContents(); |
- // AXObjectImpl::nameFromContents determines whether an element should take |
- // its name from its descendant contents based on role. However, <select> is a |
+bool AXNodeObject::NameFromContents(const bool recursive) const { |
+ // AXObject::nameFromContents determines whether an element should take its |
+ // name from its descendant contents based on role. However, <select> is a |
// special case, as unlike a typical pop-up button it contains its own pop-up |
// menu's contents, which should not be used as the name. |
- if (isHTMLSelectElement(node)) |
- return false; |
- return AXObjectImpl::NameFromContents(); |
+ return !isHTMLSelectElement(GetNode()) && |
+ AXObjectImpl::NameFromContents(recursive); |
} |
void AXNodeObject::GetRelativeBounds( |