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

Unified Diff: Source/core/dom/Node.cpp

Issue 742353004: Implement computedRole and computedName (behind a flag) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index c533a4185e06c4747cd9d22a83a7ae41f1a2a449..822df69eb7196554e86ed5b44b712eeaf7f3adf6 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -88,6 +88,8 @@
#include "core/rendering/FlowThreadController.h"
#include "core/rendering/RenderBox.h"
#include "core/svg/graphics/SVGImage.h"
+#include "modules/accessibility/AXObject.h"
aboxhall 2014/12/03 00:00:13 These are illegal includes, I had to bypass-hooks
dmazzoni 2014/12/03 23:32:13 This is as intended. What we want to do now is add
aboxhall 2014/12/08 23:50:59 Done, PTAL.
+#include "modules/accessibility/AXObjectCacheImpl.h"
#include "platform/EventDispatchForbiddenScope.h"
#include "platform/Partitions.h"
#include "platform/TraceEvent.h"
@@ -1419,6 +1421,28 @@ void Node::setTextContent(const String& text)
ASSERT_NOT_REACHED();
}
+const AtomicString& Node::computedRole()
+{
+ AXObjectCache* cache = document().alwaysCreateAxObjectCache();
dmazzoni 2014/12/03 23:32:13 I think some sort of ScopedAXObjectCache class wou
aboxhall 2014/12/08 23:50:59 Done, PTAL.
+ AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache);
+ AXObject* axObj = cacheImpl->getOrCreate(this);
+ if (axObj == NULL)
+ return AXObject::roleName(NoRole);
dmazzoni 2014/12/03 23:32:13 nit: indentation (and below)
aboxhall 2014/12/08 23:50:59 Done.
+ AccessibilityRole role = axObj->roleValue();
+ return AXObject::roleName(role);
+}
+
+const String Node::computedText()
+{
+ AXObjectCache* cache = document().alwaysCreateAxObjectCache();
+ AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache);
+ AXObject* axObj = cacheImpl->getOrCreate(this);
+ if (axObj == NULL)
+ return String();
+ // TODO(aboxhall): figure out why this is crashing
dmazzoni 2014/12/03 23:32:13 Probably need to layout first. We require layout i
aboxhall 2014/12/08 23:50:59 Done.
+ return axObj->title();
+}
+
bool Node::offsetInCharacters() const
{
return false;
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/Node.idl » ('j') | Source/core/dom/Node.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698