提交 93753789 编写于 作者: A Adam Barth 提交者: GitHub

Add isAdjustable to SemanticFlags (#2776)

上级 bb986553
...@@ -24,6 +24,7 @@ struct SemanticFlags { ...@@ -24,6 +24,7 @@ struct SemanticFlags {
bool canBeScrolledVertically = false; bool canBeScrolledVertically = false;
bool hasCheckedState = false; // whether isChecked is relevant bool hasCheckedState = false; // whether isChecked is relevant
bool isChecked = false; bool isChecked = false;
bool isAdjustable = false;
}; };
struct SemanticStrings { struct SemanticStrings {
...@@ -69,4 +70,6 @@ interface SemanticsServer { ...@@ -69,4 +70,6 @@ interface SemanticsServer {
ScrollRight(uint32 nodeID); ScrollRight(uint32 nodeID);
ScrollUp(uint32 nodeID); ScrollUp(uint32 nodeID);
ScrollDown(uint32 nodeID); ScrollDown(uint32 nodeID);
AdjustIncrease(uint32 nodeID);
AdjustDecrease(uint32 nodeID);
}; };
...@@ -297,6 +297,7 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements Semantics ...@@ -297,6 +297,7 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements Semantics
canBeScrolledVertically = node.flags.canBeScrolledVertically; canBeScrolledVertically = node.flags.canBeScrolledVertically;
hasCheckedState = node.flags.hasCheckedState; hasCheckedState = node.flags.hasCheckedState;
isChecked = node.flags.isChecked; isChecked = node.flags.isChecked;
isAdjustable = node.flags.isAdjustable;
} }
if (node.strings != null) { if (node.strings != null) {
label = node.strings.label; label = node.strings.label;
...@@ -351,6 +352,7 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements Semantics ...@@ -351,6 +352,7 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements Semantics
boolean canBeScrolledVertically; boolean canBeScrolledVertically;
boolean hasCheckedState; boolean hasCheckedState;
boolean isChecked; boolean isChecked;
boolean isAdjustable;
String label; String label;
List<PersistentAccessibilityNode> children; List<PersistentAccessibilityNode> children;
......
...@@ -127,10 +127,12 @@ struct Geometry { ...@@ -127,10 +127,12 @@ struct Geometry {
} }
- (UIAccessibilityTraits)accessibilityTraits { - (UIAccessibilityTraits)accessibilityTraits {
// TODO(tvolkert): We need more semantic info in the mojom definition UIAccessibilityTraits traits = UIAccessibilityTraitNone;
// in order to distinguish buttons, links, sliders, etc. if (_flags->canBeTapped)
return _flags->canBeTapped ? UIAccessibilityTraitButton traits |= UIAccessibilityTraitButton;
: UIAccessibilityTraitNone; if (_flags->isAdjustable)
traits |= UIAccessibilityTraitAdjustable;
return traits;
} }
- (CGRect)accessibilityFrame { - (CGRect)accessibilityFrame {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册