未验证 提交 bd0f9085 编写于 作者: M Michael Goderbauer 提交者: GitHub

Adds a platfromViewId to SemanticsNode (#8055)

上级 a71609f0
...@@ -601,6 +601,11 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { ...@@ -601,6 +601,11 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
/// The fields 'textSelectionBase' and 'textSelectionExtent' describe the /// The fields 'textSelectionBase' and 'textSelectionExtent' describe the
/// currently selected text within `value`. /// currently selected text within `value`.
/// ///
/// The field `platformViewId` references the platform view, whose semantics
/// nodes will be added as children to this node. If a platform view is
/// specified, `childrenInHitTestOrder` and `childrenInTraversalOrder` must be
/// empty.
///
/// For scrollable nodes `scrollPosition` describes the current scroll /// For scrollable nodes `scrollPosition` describes the current scroll
/// position in logical pixel. `scrollExtentMax` and `scrollExtentMin` /// position in logical pixel. `scrollExtentMax` and `scrollExtentMin`
/// describe the maximum and minimum in-rage values that `scrollPosition` can /// describe the maximum and minimum in-rage values that `scrollPosition` can
...@@ -629,6 +634,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { ...@@ -629,6 +634,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
int actions, int actions,
int textSelectionBase, int textSelectionBase,
int textSelectionExtent, int textSelectionExtent,
int platformViewId,
int scrollChildren, int scrollChildren,
int scrollIndex, int scrollIndex,
double scrollPosition, double scrollPosition,
...@@ -656,6 +662,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { ...@@ -656,6 +662,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
actions, actions,
textSelectionBase, textSelectionBase,
textSelectionExtent, textSelectionExtent,
platformViewId,
scrollChildren, scrollChildren,
scrollIndex, scrollIndex,
scrollPosition, scrollPosition,
...@@ -685,6 +692,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { ...@@ -685,6 +692,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
int actions, int actions,
int textSelectionBase, int textSelectionBase,
int textSelectionExtent, int textSelectionExtent,
int platformViewId,
int scrollChildren, int scrollChildren,
int scrollIndex, int scrollIndex,
double scrollPosition, double scrollPosition,
......
...@@ -86,6 +86,7 @@ struct SemanticsNode { ...@@ -86,6 +86,7 @@ struct SemanticsNode {
int32_t actions = 0; int32_t actions = 0;
int32_t textSelectionBase = -1; int32_t textSelectionBase = -1;
int32_t textSelectionExtent = -1; int32_t textSelectionExtent = -1;
int32_t platformViewId = -1;
int32_t scrollChildren = 0; int32_t scrollChildren = 0;
int32_t scrollIndex = 0; int32_t scrollIndex = 0;
double scrollPosition = std::nan(""); double scrollPosition = std::nan("");
......
...@@ -41,6 +41,7 @@ void SemanticsUpdateBuilder::updateNode( ...@@ -41,6 +41,7 @@ void SemanticsUpdateBuilder::updateNode(
int actions, int actions,
int textSelectionBase, int textSelectionBase,
int textSelectionExtent, int textSelectionExtent,
int platformViewId,
int scrollChildren, int scrollChildren,
int scrollIndex, int scrollIndex,
double scrollPosition, double scrollPosition,
...@@ -68,6 +69,7 @@ void SemanticsUpdateBuilder::updateNode( ...@@ -68,6 +69,7 @@ void SemanticsUpdateBuilder::updateNode(
node.actions = actions; node.actions = actions;
node.textSelectionBase = textSelectionBase; node.textSelectionBase = textSelectionBase;
node.textSelectionExtent = textSelectionExtent; node.textSelectionExtent = textSelectionExtent;
node.platformViewId = platformViewId;
node.scrollChildren = scrollChildren; node.scrollChildren = scrollChildren;
node.scrollIndex = scrollIndex; node.scrollIndex = scrollIndex;
node.scrollPosition = scrollPosition; node.scrollPosition = scrollPosition;
......
...@@ -29,6 +29,7 @@ class SemanticsUpdateBuilder ...@@ -29,6 +29,7 @@ class SemanticsUpdateBuilder
int actions, int actions,
int textSelectionBase, int textSelectionBase,
int textSelectionExtent, int textSelectionExtent,
int platformViewId,
int scrollChildren, int scrollChildren,
int scrollIndex, int scrollIndex,
double scrollPosition, double scrollPosition,
......
...@@ -1614,6 +1614,7 @@ public class AccessibilityBridge extends AccessibilityNodeProvider { ...@@ -1614,6 +1614,7 @@ public class AccessibilityBridge extends AccessibilityNodeProvider {
private int actions; private int actions;
private int textSelectionBase; private int textSelectionBase;
private int textSelectionExtent; private int textSelectionExtent;
private int platformViewId;
private int scrollChildren; private int scrollChildren;
private int scrollIndex; private int scrollIndex;
private float scrollPosition; private float scrollPosition;
...@@ -1748,6 +1749,7 @@ public class AccessibilityBridge extends AccessibilityNodeProvider { ...@@ -1748,6 +1749,7 @@ public class AccessibilityBridge extends AccessibilityNodeProvider {
actions = buffer.getInt(); actions = buffer.getInt();
textSelectionBase = buffer.getInt(); textSelectionBase = buffer.getInt();
textSelectionExtent = buffer.getInt(); textSelectionExtent = buffer.getInt();
platformViewId = buffer.getInt();
scrollChildren = buffer.getInt(); scrollChildren = buffer.getInt();
scrollIndex = buffer.getInt(); scrollIndex = buffer.getInt();
scrollPosition = buffer.getFloat(); scrollPosition = buffer.getFloat();
......
...@@ -208,7 +208,7 @@ void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, ...@@ -208,7 +208,7 @@ void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env,
void PlatformViewAndroid::UpdateSemantics( void PlatformViewAndroid::UpdateSemantics(
blink::SemanticsNodeUpdates update, blink::SemanticsNodeUpdates update,
blink::CustomAccessibilityActionUpdates actions) { blink::CustomAccessibilityActionUpdates actions) {
constexpr size_t kBytesPerNode = 38 * sizeof(int32_t); constexpr size_t kBytesPerNode = 39 * sizeof(int32_t);
constexpr size_t kBytesPerChild = sizeof(int32_t); constexpr size_t kBytesPerChild = sizeof(int32_t);
constexpr size_t kBytesPerAction = 4 * sizeof(int32_t); constexpr size_t kBytesPerAction = 4 * sizeof(int32_t);
...@@ -244,6 +244,7 @@ void PlatformViewAndroid::UpdateSemantics( ...@@ -244,6 +244,7 @@ void PlatformViewAndroid::UpdateSemantics(
buffer_int32[position++] = node.actions; buffer_int32[position++] = node.actions;
buffer_int32[position++] = node.textSelectionBase; buffer_int32[position++] = node.textSelectionBase;
buffer_int32[position++] = node.textSelectionExtent; buffer_int32[position++] = node.textSelectionExtent;
buffer_int32[position++] = node.platformViewId;
buffer_int32[position++] = node.scrollChildren; buffer_int32[position++] = node.scrollChildren;
buffer_int32[position++] = node.scrollIndex; buffer_int32[position++] = node.scrollIndex;
buffer_float32[position++] = (float)node.scrollPosition; buffer_float32[position++] = (float)node.scrollPosition;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册