cefclient: OSR accessibility enhancements (see issue #2604)

- Implement multi-tree support (e.g. page with iframes contains several trees)
- Implement OnAccessibilityLocationChange support
- Add scroll offset calculation
- Fix new Chromium tree layout parsing
- Fix uninitialized OsrAXNode::offset_container_id_
- Fix Windows non ascii AxName, AxValue, AxDescription representation
This commit is contained in:
Andrei Kurushin
2019-03-21 16:56:06 +00:00
committed by Marshall Greenblatt
parent b3468451f5
commit af349ade33
13 changed files with 411 additions and 137 deletions

View File

@@ -33,12 +33,17 @@ class OsrAccessibilityHelper;
class OsrAXNode {
public:
// Create and return the platform specific OsrAXNode Object.
static OsrAXNode* CreateNode(CefRefPtr<CefDictionaryValue> value,
static OsrAXNode* CreateNode(int treeId,
int nodeId,
CefRefPtr<CefDictionaryValue> value,
OsrAccessibilityHelper* helper);
// Update Value.
void UpdateValue(CefRefPtr<CefDictionaryValue> value);
// UpdateLocation
void UpdateLocation(CefRefPtr<CefDictionaryValue> value);
// Fire a platform-specific notification that an event has occurred on
// this object.
void NotifyAccessibilityEvent(std::string event_type) const;
@@ -58,13 +63,15 @@ class OsrAXNode {
return accessibility_helper_;
}
int GetChildCount() const { return static_cast<int>(child_ids_.size()); }
int GetChildCount() const;
// Return the Child at the specified index
OsrAXNode* ChildAtIndex(int index) const;
const CefString& AxRole() const { return role_; }
int OsrAXTreeId() const { return tree_id_; }
int OsrAXNodeId() const { return node_id_; }
const CefString& AxValue() const { return value_; }
@@ -82,15 +89,20 @@ class OsrAXNode {
void SetParent(OsrAXNode* parent);
protected:
OsrAXNode(CefRefPtr<CefDictionaryValue> value,
OsrAXNode(int treeId,
int nodeId,
CefRefPtr<CefDictionaryValue> value,
OsrAccessibilityHelper* helper);
int tree_id_;
int node_id_;
int child_tree_id_;
CefString role_;
CefString value_;
CefString name_;
CefString description_;
CefRect location_;
CefPoint scroll_;
std::vector<int> child_ids_;
CefNativeAccessible* platform_accessibility_;
OsrAXNode* parent_;