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

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

Issue 2894983002: An unknown role is considered a bug, should never occur (Closed)
Patch Set: Fix frameset tests 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/AXNodeObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
index eb389e086c2e0d601ae68e914321c49eadd939c2..7bd014f0d2f0e0621d7de0b3b842b4b9f0cd5d37 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -675,6 +675,7 @@ AccessibilityRole AXNodeObject::NativeAccessibilityRoleIgnoringAria() const {
return kUnknownRole;
}
+// Determine an accessibility role.
dmazzoni 2017/05/24 21:57:02 This comment doesn't really add much value. :) Ei
aleventhal 2017/05/25 17:28:34 Yeah I'm not sure how that happened, duh.
AccessibilityRole AXNodeObject::DetermineAccessibilityRole() {
if (!GetNode())
return kUnknownRole;
@@ -685,17 +686,7 @@ AccessibilityRole AXNodeObject::DetermineAccessibilityRole() {
return kStaticTextRole;
AccessibilityRole role = NativeAccessibilityRoleIgnoringAria();
- if (role != kUnknownRole)
- return role;
- if (GetNode()->IsElementNode()) {
- Element* element = ToElement(GetNode());
- // A generic element with tabIndex explicitly set gets GroupRole.
- // The layout checks for focusability aren't critical here; a false
- // positive would be harmless.
- if (element->IsInCanvasSubtree() && element->SupportsFocus())
- return kGenericContainerRole;
- }
- return kUnknownRole;
+ return role == kUnknownRole ? kGenericContainerRole : role;
}
AccessibilityRole AXNodeObject::DetermineAriaRoleAttribute() const {

Powered by Google App Engine
This is Rietveld 408576698