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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp

Issue 2894983002: An unknown role is considered a bug, should never occur (Closed)
Patch Set: Remove useless comment Created 3 years, 7 months 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
Index: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
index 803370747873c15192e64a72b909aa4aea3faaa8..e621f714a43e0c01025cc20d210fe94cc938ccda 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -292,20 +292,11 @@ AccessibilityRole AXLayoutObject::DetermineAccessibilityRole() {
return aria_role_;
AccessibilityRole role = NativeAccessibilityRoleIgnoringAria();
- if (role != kUnknownRole)
- return role;
-
- // These are layout containers added by blink
- if (layout_object_->IsLayoutBlockFlow())
- return kGenericContainerRole;
-
- // If the element does not have role, but it has ARIA attributes or is an
- // in-page link target, accessibility should fallback to exposing it as a
- // generic container.
- if (IsInPageLinkTarget() || SupportsARIAAttributes())
- return kGenericContainerRole;
-
- return kUnknownRole;
+ // Anything that needs to still be exposed but doesn't have a more specific
+ // role should be considered a generic container. Examples are
+ // layout blocks with no node, in-page link targets, and plain elements
+ // such as a <span> with ARIA markup.
+ return role == kUnknownRole ? kGenericContainerRole : role;
}
void AXLayoutObject::Init() {

Powered by Google App Engine
This is Rietveld 408576698