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

Unified Diff: Source/core/accessibility/AccessibilityRenderObject.cpp

Issue 23983002: Expose InlineTextBoxes in the accessibility tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address feedback Created 7 years, 2 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: Source/core/accessibility/AccessibilityRenderObject.cpp
diff --git a/Source/core/accessibility/AccessibilityRenderObject.cpp b/Source/core/accessibility/AccessibilityRenderObject.cpp
index dbb82f676cd8028577dacce0cfe3089176ec9576..a953aa77c6d24b5fc8b7abb61c7b68ed7a4ac51d 100644
--- a/Source/core/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/core/accessibility/AccessibilityRenderObject.cpp
@@ -32,6 +32,7 @@
#include "bindings/v8/ExceptionStatePlaceholder.h"
#include "core/accessibility/AXObjectCache.h"
#include "core/accessibility/AccessibilityImageMapLink.h"
+#include "core/accessibility/AccessibilityInlineTextBox.h"
#include "core/accessibility/AccessibilitySVGRoot.h"
#include "core/accessibility/AccessibilitySpinButton.h"
#include "core/accessibility/AccessibilityTable.h"
@@ -52,6 +53,7 @@
#include "core/loader/ProgressTracker.h"
#include "core/page/Page.h"
#include "core/rendering/HitTestResult.h"
+#include "core/rendering/RenderFieldset.h"
#include "core/rendering/RenderFileUploadControl.h"
#include "core/rendering/RenderHTMLCanvas.h"
#include "core/rendering/RenderImage.h"
@@ -1472,6 +1474,7 @@ void AccessibilityRenderObject::addChildren()
addTextFieldChildren();
addCanvasChildren();
addRemoteSVGChildren();
+ addInlineTextBoxChildren();
}
bool AccessibilityRenderObject::canHaveChildren() const
@@ -1735,6 +1738,17 @@ void AccessibilityRenderObject::handleAriaExpandedChanged()
axObjectCache()->postNotification(this, document(), isExpanded() ? AXObjectCache::AXRowExpanded : AXObjectCache::AXRowCollapsed, true);
}
+void AccessibilityRenderObject::textChanged()
+{
+ if (!m_renderer)
+ return;
+
+ if (AXObjectCache::inlineTextBoxAccessibility() && roleValue() == StaticTextRole)
+ childrenChanged();
+
+ AccessibilityNodeObject::textChanged();
aboxhall 2013/10/17 22:27:55 Why does this come last?
dmazzoni 2013/10/19 06:48:07 AccessibilityNodeObject::textChanged handles live
+}
+
//
// Text metrics. Most of these should be deprecated, needs major cleanup.
//
@@ -1802,6 +1816,25 @@ int AccessibilityRenderObject::indexForVisiblePosition(const VisiblePosition& po
return TextIterator::rangeLength(range.get());
}
+void AccessibilityRenderObject::addInlineTextBoxChildren()
+{
+ if (!axObjectCache()->inlineTextBoxAccessibility())
+ return;
+
+ if (!renderer() || !renderer()->isText())
+ return;
+
+ RenderText* renderText = toRenderText(renderer());
+ if (renderText->needsLayout())
+ renderText->document().updateLayoutIgnorePendingStylesheets();
+
+ for (RefPtr<AbstractInlineTextBox> box = renderText->firstAbstractInlineTextBox(); box.get(); box = box->nextInlineTextBox()) {
+ AccessibilityObject* axObject = axObjectCache()->getOrCreate(box.get());
+ if (!axObject->accessibilityIsIgnored())
+ m_children.append(axObject);
+ }
+}
+
void AccessibilityRenderObject::lineBreaks(Vector<int>& lineBreaks) const
{
if (!isTextControl())

Powered by Google App Engine
This is Rietveld 408576698