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

Unified Diff: Source/web/WebAXObject.cpp

Issue 23983002: Expose InlineTextBoxes in the accessibility tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | public/web/WebAXEnums.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebAXObject.cpp
diff --git a/Source/web/WebAXObject.cpp b/Source/web/WebAXObject.cpp
index 796e645fc76131f141a4c82b4626c1dda8b44211..c5c3038d6fee4b1a4d73abda04371c3b009aea24 100644
--- a/Source/web/WebAXObject.cpp
+++ b/Source/web/WebAXObject.cpp
@@ -84,6 +84,12 @@ bool WebAXObject::accessibilityEnabled()
return AXObjectCache::accessibilityEnabled();
}
+// static
+void WebAXObject::enableInlineTextBoxAccessibility()
+{
+ AXObjectCache::setInlineTextBoxAccessibility(true);
+}
+
void WebAXObject::startCachingComputedObjectAttributesUntilTreeMutates()
{
m_private->axObjectCache()->startCachingComputedObjectAttributesUntilTreeMutates();
@@ -992,6 +998,47 @@ unsigned WebAXObject::cellRowSpan() const
return rowRange.second;
}
+WebAXTextDirection WebAXObject::textDirection() const
+{
+ if (isDetached())
+ return WebAXTextDirectionLR;
+
+ return static_cast<WebAXTextDirection>(m_private->textDirection());
+}
+
+void WebAXObject::characterOffsets(WebVector<int>& offsets) const
+{
+ if (isDetached())
+ return;
+
+ Vector<int> offsetsVector;
+ m_private->textCharacterOffsets(offsetsVector);
+
+ size_t vectorSize = offsetsVector.size();
+ WebVector<int> offsetsWebVector(vectorSize);
+ for (size_t i = 0; i < vectorSize; i++)
+ offsetsWebVector[i] = offsetsVector[i];
+ offsets.swap(offsetsWebVector);
+}
+
+void WebAXObject::wordBoundaries(WebVector<int>& starts, WebVector<int>& ends) const
+{
+ if (isDetached())
+ return;
+
+ Vector<PlainTextRange> words;
+ m_private->wordBoundaries(words);
+
+ WebVector<int> startsWebVector(words.size());
+ WebVector<int> endsWebVector(words.size());
+ for (size_t i = 0; i < words.size(); i++) {
+ startsWebVector[i] = words[i].start;
+ endsWebVector[i] = words[i].start + words[i].length;
+ }
+ starts.swap(startsWebVector);
+ ends.swap(endsWebVector);
+}
+
void WebAXObject::scrollToMakeVisible() const
{
if (!isDetached())
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | public/web/WebAXEnums.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698