Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
99f4caf3
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
99f4caf3
编写于
4月 22, 2020
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
list: accessibilityProvider.getWidgetRole
上级
86161ffb
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
33 addition
and
12 deletion
+33
-12
src/vs/base/browser/ui/list/listWidget.ts
src/vs/base/browser/ui/list/listWidget.ts
+3
-3
src/vs/base/browser/ui/selectBox/selectBoxCustom.ts
src/vs/base/browser/ui/selectBox/selectBoxCustom.ts
+8
-1
src/vs/base/browser/ui/tree/abstractTree.ts
src/vs/base/browser/ui/tree/abstractTree.ts
+2
-2
src/vs/base/browser/ui/tree/asyncDataTree.ts
src/vs/base/browser/ui/tree/asyncDataTree.ts
+1
-1
src/vs/base/parts/quickinput/browser/quickInputList.ts
src/vs/base/parts/quickinput/browser/quickInputList.ts
+5
-2
src/vs/editor/contrib/suggest/suggestWidget.ts
src/vs/editor/contrib/suggest/suggestWidget.ts
+2
-2
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
+12
-1
未找到文件。
src/vs/base/browser/ui/list/listWidget.ts
浏览文件 @
99f4caf3
...
...
@@ -822,7 +822,6 @@ export interface IListOptions<T> {
readonly
automaticKeyboardNavigation
?:
boolean
;
readonly
keyboardNavigationLabelProvider
?:
IKeyboardNavigationLabelProvider
<
T
>
;
readonly
keyboardNavigationDelegate
?:
IKeyboardNavigationDelegate
;
readonly
ariaRole
?:
string
;
readonly
keyboardSupport
?:
boolean
;
readonly
multipleSelectionSupport
?:
boolean
;
readonly
multipleSelectionController
?:
IMultipleSelectionController
<
T
>
;
...
...
@@ -1186,7 +1185,8 @@ export class List<T> implements ISpliceable<T>, IDisposable {
renderers
:
IListRenderer
<
any
/* TODO@joao */
,
any
>
[],
private
_options
:
IListOptions
<
T
>
=
DefaultOptions
)
{
this
.
selection
=
new
SelectionTrait
(
this
.
_options
.
ariaRole
!==
'
listbox
'
);
const
role
=
this
.
_options
.
accessibilityProvider
&&
this
.
_options
.
accessibilityProvider
.
getWidgetRole
?
this
.
_options
.
accessibilityProvider
?.
getWidgetRole
()
:
'
list
'
;
this
.
selection
=
new
SelectionTrait
(
role
!==
'
listbox
'
);
this
.
focus
=
new
Trait
(
'
focused
'
);
mixin
(
_options
,
defaultStyles
,
false
);
...
...
@@ -1211,7 +1211,7 @@ export class List<T> implements ISpliceable<T>, IDisposable {
};
this
.
view
=
new
ListView
(
container
,
virtualDelegate
,
renderers
,
viewOptions
);
this
.
view
.
domNode
.
setAttribute
(
'
role
'
,
_options
.
ariaRole
??
'
list
'
);
this
.
view
.
domNode
.
setAttribute
(
'
role
'
,
role
);
if
(
_options
.
styleController
)
{
this
.
styleController
=
_options
.
styleController
(
this
.
view
.
domId
);
...
...
src/vs/base/browser/ui/selectBox/selectBoxCustom.ts
浏览文件 @
99f4caf3
...
...
@@ -20,6 +20,7 @@ import { ISelectBoxDelegate, ISelectOptionItem, ISelectBoxOptions, ISelectBoxSty
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
renderMarkdown
}
from
'
vs/base/browser/markdownRenderer
'
;
import
{
IContentActionHandler
}
from
'
vs/base/browser/formattedTextRenderer
'
;
import
{
localize
}
from
'
vs/nls
'
;
const
$
=
dom
.
$
;
...
...
@@ -723,7 +724,13 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
useShadows
:
false
,
verticalScrollMode
:
ScrollbarVisibility
.
Visible
,
keyboardSupport
:
false
,
mouseSupport
:
false
mouseSupport
:
false
,
accessibilityProvider
:
{
getAriaLabel
:
(
element
)
=>
element
.
text
,
getWidgetAriaLabel
:
()
=>
localize
(
'
selectBox
'
,
"
Select Box
"
),
getRole
:
()
=>
'
option
'
,
getWidgetRole
:
()
=>
'
listbox
'
}
});
if
(
this
.
selectBoxOptions
.
ariaLabel
)
{
this
.
selectList
.
ariaLabel
=
this
.
selectBoxOptions
.
ariaLabel
;
...
...
src/vs/base/browser/ui/tree/abstractTree.ts
浏览文件 @
99f4caf3
...
...
@@ -192,6 +192,7 @@ function asListOptions<T, TFilterData, TRef>(modelProvider: () => ITreeModel<T,
getWidgetAriaLabel
()
{
return
options
.
accessibilityProvider
!
.
getWidgetAriaLabel
();
},
getWidgetRole
:
options
.
accessibilityProvider
&&
options
.
accessibilityProvider
.
getWidgetRole
?
()
=>
options
.
accessibilityProvider
!
.
getWidgetRole
!
()
:
()
=>
'
tree
'
,
getAriaLevel
(
node
)
{
return
node
.
depth
;
},
...
...
@@ -205,8 +206,7 @@ function asListOptions<T, TFilterData, TRef>(modelProvider: () => ITreeModel<T,
return
options
.
keyboardNavigationLabelProvider
!
.
getKeyboardNavigationLabel
(
node
.
element
);
}
},
enableKeyboardNavigation
:
options
.
simpleKeyboardNavigation
,
ariaRole
:
'
tree
'
enableKeyboardNavigation
:
options
.
simpleKeyboardNavigation
};
}
...
...
src/vs/base/browser/ui/tree/asyncDataTree.ts
浏览文件 @
99f4caf3
...
...
@@ -245,6 +245,7 @@ function asObjectTreeOptions<TInput, T, TFilterData>(options?: IAsyncDataTreeOpt
getWidgetAriaLabel
()
{
return
options
.
accessibilityProvider
!
.
getWidgetAriaLabel
();
},
getWidgetRole
:
options
.
accessibilityProvider
!
.
getWidgetRole
?
()
=>
options
.
accessibilityProvider
!
.
getWidgetRole
!
()
:
()
=>
'
tree
'
,
getAriaLevel
:
options
.
accessibilityProvider
!
.
getAriaLevel
&&
(
node
=>
{
return
options
.
accessibilityProvider
!
.
getAriaLevel
!
(
node
.
element
as
T
);
}),
...
...
@@ -269,7 +270,6 @@ function asObjectTreeOptions<TInput, T, TFilterData>(options?: IAsyncDataTreeOpt
e
=>
(
options
.
expandOnlyOnTwistieClick
as
((
e
:
T
)
=>
boolean
))(
e
.
element
as
T
)
)
),
ariaRole
:
'
tree
'
,
additionalScrollHeight
:
options
.
additionalScrollHeight
};
}
...
...
src/vs/base/parts/quickinput/browser/quickInputList.ts
浏览文件 @
99f4caf3
...
...
@@ -287,8 +287,7 @@ export class QuickInputList {
setRowLineHeight
:
false
,
multipleSelectionSupport
:
false
,
horizontalScrolling
:
false
,
accessibilityProvider
,
ariaRole
:
'
listbox
'
accessibilityProvider
}
as
IListOptions
<
ListElement
>
);
this
.
list
.
getHTMLElement
().
id
=
id
;
this
.
disposables
.
push
(
this
.
list
);
...
...
@@ -723,6 +722,10 @@ class QuickInputAccessibilityProvider implements IListAccessibilityProvider<List
return
element
.
saneAriaLabel
;
}
getWidgetRole
()
{
return
'
listbox
'
;
}
getRole
()
{
return
'
option
'
;
}
...
...
src/vs/editor/contrib/suggest/suggestWidget.ts
浏览文件 @
99f4caf3
...
...
@@ -607,7 +607,6 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
useShadows
:
false
,
openController
:
{
shouldOpen
:
()
=>
false
},
mouseSupport
:
false
,
ariaRole
:
'
listbox
'
,
accessibilityProvider
:
{
getRole
:
()
=>
'
option
'
,
getAriaLabel
:
(
item
:
CompletionItem
)
=>
{
...
...
@@ -624,7 +623,8 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
return
textLabel
;
}
},
getWidgetAriaLabel
:
()
=>
nls
.
localize
(
'
suggest
'
,
"
Suggest
"
)
getWidgetAriaLabel
:
()
=>
nls
.
localize
(
'
suggest
'
,
"
Suggest
"
),
getWidgetRole
:
()
=>
'
listbox
'
}
});
...
...
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
浏览文件 @
99f4caf3
...
...
@@ -1558,12 +1558,23 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> {
renderers
,
{
supportDynamicHeights
:
true
,
ariaRole
:
'
form
'
,
identityProvider
:
{
getId
(
e
)
{
return
e
.
id
;
}
},
accessibilityProvider
:
{
getWidgetRole
()
{
return
'
form
'
;
},
getAriaLabel
()
{
// TODO@roblourens https://github.com/microsoft/vscode/issues/95862
return
''
;
},
getWidgetAriaLabel
()
{
return
localize
(
'
settings
'
,
"
Settings
"
);
}
},
styleController
:
id
=>
new
DefaultStyleController
(
DOM
.
createStyleSheet
(
container
),
id
),
filter
:
instantiationService
.
createInstance
(
SettingsTreeFilter
,
viewState
)
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录