Index: content/browser/accessibility/browser_accessibility_win.h |
diff --git a/content/browser/accessibility/browser_accessibility_win.h b/content/browser/accessibility/browser_accessibility_win.h |
index adeb16b494be11ddfd180512c68892ed64cb7def..9dda167a59124477ce6b11f53100d6b1ec796cf0 100644 |
--- a/content/browser/accessibility/browser_accessibility_win.h |
+++ b/content/browser/accessibility/browser_accessibility_win.h |
@@ -15,6 +15,7 @@ |
#include <vector> |
#include "base/compiler_specific.h" |
+#include "base/containers/hash_tables.h" |
#include "base/gtest_prod_util.h" |
#include "base/macros.h" |
#include "content/browser/accessibility/browser_accessibility.h" |
@@ -727,6 +728,10 @@ BrowserAccessibilityWin |
base::string16 name() const { return win_attributes_->name; } |
base::string16 description() const { return win_attributes_->description; } |
base::string16 value() const { return win_attributes_->value; } |
+ base::hash_map<int, std::vector<base::string16>>& offset_to_text_attributes() |
+ const { |
+ return win_attributes_->offset_to_text_attributes; |
+ } |
std::map<int32_t, int32_t>& hyperlink_offset_to_index() const { |
return win_attributes_->hyperlink_offset_to_index; |
} |
@@ -790,6 +795,9 @@ BrowserAccessibilityWin |
// Returns true if the current object is an IA2 hyperlink. |
bool IsHyperlink() const; |
+ // Returns the hyperlink at the given text position, or nullptr if no |
+ // hyperlink can be found. |
+ BrowserAccessibilityWin* GetHyperlinkFromHypertextOffset(int offset) const; |
// Functions for retrieving offsets for hyperlinks and hypertext. |
// Return -1 in case of failure. |
@@ -836,6 +844,9 @@ BrowserAccessibilityWin |
void ComputeHypertextRemovedAndInserted( |
int* start, int* old_len, int* new_len); |
+ // Computes the IA2 text style attributes upon being requested. |
+ void ComputeTextAttributes(); |
+ |
// If offset is a member of IA2TextSpecialOffsets this function updates the |
// value of offset and returns, otherwise offset remains unchanged. |
void HandleSpecialTextOffset(const base::string16& text, LONG* offset); |
@@ -851,22 +862,28 @@ BrowserAccessibilityWin |
LONG start_offset, |
ui::TextBoundaryDirection direction); |
+ // Searches forward from the given offset until the start of the next style |
+ // is found, or searches backward from the given offset until the start of the |
+ // current style is found. |
+ LONG FindStartOfStyle(LONG start_offset, |
+ ui::TextBoundaryDirection direction) const; |
+ |
// Return a pointer to the object corresponding to the given id, |
// does not make a new reference. |
- BrowserAccessibilityWin* GetFromID(int32_t id); |
+ BrowserAccessibilityWin* GetFromID(int32_t id) const; |
// Returns true if this is a list box option with a parent of type list box, |
// or a menu list option with a parent of type menu list popup. |
bool IsListBoxOptionOrMenuListOption(); |
- // Updates object attributes of IA2 with html attributes. |
- void UpdateRequiredAttributes(); |
- |
// Given an int list attribute containing the ids of related elements, |
// add a new IAccessibleRelation for this object with the given type name. |
void AddRelations(ui::AXIntListAttribute src_attr, |
const base::string16& iaccessiblerelation_type); |
+ // Updates object attributes of IA2 with html attributes. |
+ void UpdateRequiredAttributes(); |
+ |
// Windows-specific unique ID (unique within the browser process), |
// used for get_accChild, NotifyWinEvent, and as the unique ID for |
// IAccessible2 and ISimpleDOM. |
@@ -896,6 +913,9 @@ BrowserAccessibilityWin |
// Hypertext. |
base::string16 hypertext; |
+ // Maps each style span to its start offset in hypertext. |
+ base::hash_map<int, std::vector<base::string16>> offset_to_text_attributes; |
+ |
// Maps the |hypertext_| embedded character offset to an index in |
// |hyperlinks_|. |
std::map<int32_t, int32_t> hyperlink_offset_to_index; |