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

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

Issue 742353004: Implement computedRole and computedName (behind a flag) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update webexposed/element-instance-property-listing.html and add some SVG test cases 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.h ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXNodeObject.cpp
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp
index 62df989824998934fb1e8d1294a04b3885f25598..4f88fcf6135f4add4895491819fbf9e2d6e07f0a 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -1371,6 +1371,40 @@ String AXNodeObject::helpText() const
return String();
}
+String AXNodeObject::computedName() const
+{
+ String title = this->title();
+
+ String titleUIText;
+ if (title.isEmpty()) {
+ AXObject* titleUIElement = this->titleUIElement();
+ if (titleUIElement) {
+ titleUIText = titleUIElement->textUnderElement();
+ if (!titleUIText.isEmpty())
+ return titleUIText;
+ }
+ }
+
+ String description = accessibilityDescription();
+ if (!description.isEmpty())
+ return description;
+
+ if (!title.isEmpty())
+ return title;
+
+ String placeholder;
+ if (isHTMLInputElement(node())) {
+ HTMLInputElement* element = toHTMLInputElement(node());
+ placeholder = element->strippedPlaceholder();
+ if (!placeholder.isEmpty())
+ return placeholder;
+ }
+
+ return String();
+}
+
+
+
LayoutRect AXNodeObject::elementRect() const
{
// First check if it has a custom rect, for example if this element is tied to a canvas path.
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.h ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698