Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
a2046aeb
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a2046aeb
编写于
10月 09, 2020
作者:
G
gaaclarke
提交者:
GitHub
10月 09, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "fix On iOS, dialog titles are announced twice (#19826)" (#21714)
上级
8be6cc03
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
21 deletion
+16
-21
shell/platform/darwin/ios/framework/Source/SemanticsObject.h
shell/platform/darwin/ios/framework/Source/SemanticsObject.h
+1
-1
shell/platform/darwin/ios/framework/Source/SemanticsObject.mm
...l/platform/darwin/ios/framework/Source/SemanticsObject.mm
+7
-8
shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm
...tform/darwin/ios/framework/Source/accessibility_bridge.mm
+2
-5
shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm
.../darwin/ios/framework/Source/accessibility_bridge_test.mm
+6
-7
未找到文件。
shell/platform/darwin/ios/framework/Source/SemanticsObject.h
浏览文件 @
a2046aeb
...
...
@@ -93,7 +93,7 @@ constexpr int32_t kRootNodeId = 0;
-
(
BOOL
)
nodeWillCauseScroll
:(
const
flutter
::
SemanticsNode
*
)
node
;
-
(
BOOL
)
nodeShouldTriggerAnnouncement
:(
const
flutter
::
SemanticsNode
*
)
node
;
-
(
void
)
collectRoutes
:(
NSMutableArray
<
SemanticsObject
*>*
)
edges
;
-
(
SemanticsObject
*
)
routeFocusObject
;
-
(
NSString
*
)
routeName
;
-
(
BOOL
)
onCustomAccessibilityAction
:(
FlutterCustomAccessibilityAction
*
)
action
;
@end
...
...
shell/platform/darwin/ios/framework/Source/SemanticsObject.mm
浏览文件 @
a2046aeb
...
...
@@ -282,21 +282,20 @@ flutter::SemanticsAction GetSemanticsActionForScrollDirection(
return
YES
;
}
-
(
SemanticsObject
*
)
routeFocusObject
{
// Returns the first SemanticObject in this branch that has
// the NamesRoute flag with a non-nil semantic label. Otherwise
// returns nil.
-
(
NSString
*
)
routeName
{
// Returns the first non-null and non-empty semantic label of a child
// with an NamesRoute flag. Otherwise returns nil.
if
([
self
node
].
HasFlag
(
flutter
::
SemanticsFlags
::
kNamesRoute
))
{
NSString
*
newName
=
[
self
accessibilityLabel
];
if
(
newName
!=
nil
&&
[
newName
length
]
>
0
)
{
return
self
;
return
newName
;
}
}
if
([
self
hasChildren
])
{
for
(
SemanticsObject
*
child
in
self
.
children
)
{
SemanticsObject
*
focusObject
=
[
child
routeFocusObject
];
if
(
focusObject
!=
nil
)
{
return
focusObject
;
NSString
*
newName
=
[
child
routeName
];
if
(
newName
!=
nil
&&
[
newName
length
]
>
0
)
{
return
newName
;
}
}
}
...
...
shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm
浏览文件 @
a2046aeb
...
...
@@ -198,12 +198,9 @@ void AccessibilityBridge::UpdateSemantics(flutter::SemanticsNodeUpdates nodes,
// We should send out only one notification per semantics update.
if
(
routeChanged
)
{
if
(
!
ios_delegate_
->
IsFlutterViewControllerPresentingModalViewController
(
view_controller_
))
{
SemanticsObject
*
nextToFocus
=
[
lastAdded
routeFocusObject
];
if
(
!
nextToFocus
&&
root
)
{
nextToFocus
=
FindFirstFocusable
(
root
);
}
NSString
*
routeName
=
[
lastAdded
routeName
];
ios_delegate_
->
PostAccessibilityNotification
(
UIAccessibilityScreenChangedNotification
,
nextToFocus
);
routeName
);
}
}
else
if
(
layoutChanged
)
{
SemanticsObject
*
nextToFocus
=
nil
;
...
...
shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm
浏览文件 @
a2046aeb
...
...
@@ -328,9 +328,7 @@ fml::RefPtr<fml::TaskRunner> CreateNewThread(std::string name) {
bridge
->
UpdateSemantics
(
/*nodes=*/
nodes
,
/*actions=*/
actions
);
XCTAssertEqual
([
accessibility_notifications
count
],
1ul
);
SemanticsObject
*
focusObject
=
accessibility_notifications
[
0
][
@"argument"
];
XCTAssertEqual
([
focusObject
uid
],
3
);
XCTAssertEqualObjects
([
focusObject
accessibilityLabel
],
@"node3"
);
XCTAssertEqualObjects
(
accessibility_notifications
[
0
][
@"argument"
],
@"node3"
);
XCTAssertEqual
([
accessibility_notifications
[
0
][
@"notification"
]
unsignedIntValue
],
UIAccessibilityScreenChangedNotification
);
}
...
...
@@ -373,7 +371,8 @@ fml::RefPtr<fml::TaskRunner> CreateNewThread(std::string name) {
flutter
::
SemanticsNode
node1
;
node1
.
id
=
1
;
node1
.
label
=
"node1"
;
node1
.
flags
=
static_cast
<
int32_t
>
(
flutter
::
SemanticsFlags
::
kScopesRoute
);
node1
.
flags
=
static_cast
<
int32_t
>
(
flutter
::
SemanticsFlags
::
kScopesRoute
)
|
static_cast
<
int32_t
>
(
flutter
::
SemanticsFlags
::
kNamesRoute
);
node1
.
childrenInTraversalOrder
=
{
2
,
3
};
node1
.
childrenInHitTestOrder
=
{
2
,
3
};
nodes
[
node1
.
id
]
=
node1
;
...
...
@@ -394,9 +393,9 @@ fml::RefPtr<fml::TaskRunner> CreateNewThread(std::string name) {
// Notification should focus first focusable node, which is node1.
XCTAssertEqual
([
accessibility_notifications
count
],
1ul
);
SemanticsObject
*
focusObject
=
accessibility_notifications
[
0
][
@"argument"
];
XCTAssert
Equal
([
focusObject
uid
],
2
);
XCTAssertEqualObjects
(
[
focusObject
accessibilityLabel
],
@"node2
"
);
id
focusObject
=
accessibility_notifications
[
0
][
@"argument"
];
XCTAssert
True
([
focusObject
isKindOfClass
:[
NSString
class
]]
);
XCTAssertEqualObjects
(
focusObject
,
@"node1
"
);
XCTAssertEqual
([
accessibility_notifications
[
0
][
@"notification"
]
unsignedIntValue
],
UIAccessibilityScreenChangedNotification
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录