Chromium Code Reviews| 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; |