Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
531db494
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
531db494
编写于
4月 08, 2020
作者:
J
João Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup aria root roles
上级
1e960d5a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
28 deletion
+11
-28
src/vs/base/browser/ui/list/list.ts
src/vs/base/browser/ui/list/list.ts
+0
-11
src/vs/base/browser/ui/list/listWidget.ts
src/vs/base/browser/ui/list/listWidget.ts
+5
-11
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
+2
-2
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
+2
-2
未找到文件。
src/vs/base/browser/ui/list/list.ts
浏览文件 @
531db494
...
...
@@ -63,17 +63,6 @@ export interface IIdentityProvider<T> {
getId
(
element
:
T
):
{
toString
():
string
;
};
}
export
enum
ListAriaRootRole
{
/** default list structure role */
LIST
=
'
list
'
,
/** default tree structure role */
TREE
=
'
tree
'
,
/** role='tree' can interfere with screenreaders reading nested elements inside the tree row. Use FORM in that case. */
FORM
=
'
form
'
}
export
interface
IKeyboardNavigationLabelProvider
<
T
>
{
/**
...
...
src/vs/base/browser/ui/list/listWidget.ts
浏览文件 @
531db494
...
...
@@ -16,7 +16,7 @@ import { KeyCode } from 'vs/base/common/keyCodes';
import
{
StandardKeyboardEvent
,
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
Event
,
Emitter
,
EventBufferer
}
from
'
vs/base/common/event
'
;
import
{
domEvent
}
from
'
vs/base/browser/event
'
;
import
{
IListVirtualDelegate
,
IListRenderer
,
IListEvent
,
IListContextMenuEvent
,
IListMouseEvent
,
IListTouchEvent
,
IListGestureEvent
,
IIdentityProvider
,
IKeyboardNavigationLabelProvider
,
IListDragAndDrop
,
IListDragOverReaction
,
List
AriaRootRole
,
List
Error
,
IKeyboardNavigationDelegate
}
from
'
./list
'
;
import
{
IListVirtualDelegate
,
IListRenderer
,
IListEvent
,
IListContextMenuEvent
,
IListMouseEvent
,
IListTouchEvent
,
IListGestureEvent
,
IIdentityProvider
,
IKeyboardNavigationLabelProvider
,
IListDragAndDrop
,
IListDragOverReaction
,
ListError
,
IKeyboardNavigationDelegate
}
from
'
./list
'
;
import
{
ListView
,
IListViewOptions
,
IListViewDragAndDrop
,
IAriaProvider
}
from
'
./listView
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
mixin
}
from
'
vs/base/common/objects
'
;
...
...
@@ -836,7 +836,7 @@ export interface IListOptions<T> {
readonly
automaticKeyboardNavigation
?:
boolean
;
readonly
keyboardNavigationLabelProvider
?:
IKeyboardNavigationLabelProvider
<
T
>
;
readonly
keyboardNavigationDelegate
?:
IKeyboardNavigationDelegate
;
readonly
ariaRole
?:
ListAriaRootRole
|
string
;
readonly
ariaRole
?:
string
;
readonly
ariaLabel
?:
string
;
readonly
keyboardSupport
?:
boolean
;
readonly
multipleSelectionSupport
?:
boolean
;
...
...
@@ -894,7 +894,7 @@ const defaultStyles: IListStyles = {
treeIndentGuidesStroke
:
Color
.
fromHex
(
'
#a9a9a9
'
)
};
const
DefaultOptions
=
{
const
DefaultOptions
:
IListOptions
<
any
>
=
{
keyboardSupport
:
true
,
mouseSupport
:
true
,
multipleSelectionSupport
:
true
,
...
...
@@ -903,8 +903,7 @@ const DefaultOptions = {
onDragStart
():
void
{
},
onDragOver
()
{
return
false
;
},
drop
()
{
}
},
ariaRootRole
:
ListAriaRootRole
.
LIST
}
};
// TODO@Joao: move these utils into a SortedArray class
...
...
@@ -1227,12 +1226,7 @@ export class List<T> implements ISpliceable<T>, IDisposable {
};
this
.
view
=
new
ListView
(
container
,
virtualDelegate
,
renderers
,
viewOptions
);
if
(
typeof
_options
.
ariaRole
!==
'
string
'
)
{
this
.
view
.
domNode
.
setAttribute
(
'
role
'
,
ListAriaRootRole
.
LIST
);
}
else
{
this
.
view
.
domNode
.
setAttribute
(
'
role
'
,
_options
.
ariaRole
);
}
this
.
view
.
domNode
.
setAttribute
(
'
role
'
,
_options
.
ariaRole
??
'
list
'
);
if
(
_options
.
styleController
)
{
this
.
styleController
=
_options
.
styleController
(
this
.
view
.
domId
);
...
...
src/vs/base/browser/ui/tree/abstractTree.ts
浏览文件 @
531db494
...
...
@@ -6,7 +6,7 @@
import
'
vs/css!./media/tree
'
;
import
{
IDisposable
,
dispose
,
Disposable
,
toDisposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
IListOptions
,
List
,
IListStyles
,
MouseController
,
DefaultKeyboardNavigationDelegate
}
from
'
vs/base/browser/ui/list/listWidget
'
;
import
{
IListVirtualDelegate
,
IListRenderer
,
IListMouseEvent
,
IListEvent
,
IListContextMenuEvent
,
IListDragAndDrop
,
IListDragOverReaction
,
IKeyboardNavigationLabelProvider
,
IIdentityProvider
,
IKeyboardNavigationDelegate
,
ListAriaRootRole
}
from
'
vs/base/browser/ui/list/list
'
;
import
{
IListVirtualDelegate
,
IListRenderer
,
IListMouseEvent
,
IListEvent
,
IListContextMenuEvent
,
IListDragAndDrop
,
IListDragOverReaction
,
IKeyboardNavigationLabelProvider
,
IIdentityProvider
,
IKeyboardNavigationDelegate
}
from
'
vs/base/browser/ui/list/list
'
;
import
{
append
,
$
,
toggleClass
,
getDomNodePagePosition
,
removeClass
,
addClass
,
hasClass
,
hasParentWithClass
,
createStyleSheet
,
clearNode
,
addClasses
,
removeClasses
}
from
'
vs/base/browser/dom
'
;
import
{
Event
,
Relay
,
Emitter
,
EventBufferer
}
from
'
vs/base/common/event
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
...
...
@@ -198,7 +198,7 @@ function asListOptions<T, TFilterData, TRef>(modelProvider: () => ITreeModel<T,
return
options
.
ariaProvider
!
.
getRole
!
(
node
.
element
);
}
:
()
=>
'
treeitem
'
},
ariaRole
:
ListAriaRootRole
.
TREE
ariaRole
:
'
tree
'
};
}
...
...
src/vs/base/browser/ui/tree/asyncDataTree.ts
浏览文件 @
531db494
...
...
@@ -5,7 +5,7 @@
import
{
ComposedTreeDelegate
,
IAbstractTreeOptions
,
IAbstractTreeOptionsUpdate
}
from
'
vs/base/browser/ui/tree/abstractTree
'
;
import
{
ObjectTree
,
IObjectTreeOptions
,
CompressibleObjectTree
,
ICompressibleTreeRenderer
,
ICompressibleKeyboardNavigationLabelProvider
,
ICompressibleObjectTreeOptions
}
from
'
vs/base/browser/ui/tree/objectTree
'
;
import
{
IListVirtualDelegate
,
IIdentityProvider
,
IListDragAndDrop
,
IListDragOverReaction
,
ListAriaRootRole
}
from
'
vs/base/browser/ui/list/list
'
;
import
{
IListVirtualDelegate
,
IIdentityProvider
,
IListDragAndDrop
,
IListDragOverReaction
}
from
'
vs/base/browser/ui/list/list
'
;
import
{
ITreeElement
,
ITreeNode
,
ITreeRenderer
,
ITreeEvent
,
ITreeMouseEvent
,
ITreeContextMenuEvent
,
ITreeSorter
,
ICollapseStateChangeEvent
,
IAsyncDataSource
,
ITreeDragAndDrop
,
TreeError
,
WeakMapper
,
ITreeFilter
,
TreeVisibility
,
TreeFilterResult
}
from
'
vs/base/browser/ui/tree/tree
'
;
import
{
IDisposable
,
dispose
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
...
...
@@ -272,7 +272,7 @@ function asObjectTreeOptions<TInput, T, TFilterData>(options?: IAsyncDataTreeOpt
return
!!
(
options
.
ariaProvider
?.
isChecked
!
(
e
.
element
as
T
));
}
:
undefined
},
ariaRole
:
ListAriaRootRole
.
TREE
,
ariaRole
:
'
tree
'
,
additionalScrollHeight
:
options
.
additionalScrollHeight
};
}
...
...
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
浏览文件 @
531db494
...
...
@@ -13,7 +13,7 @@ import { alert as ariaAlert } from 'vs/base/browser/ui/aria/aria';
import
{
Button
}
from
'
vs/base/browser/ui/button/button
'
;
import
{
Checkbox
}
from
'
vs/base/browser/ui/checkbox/checkbox
'
;
import
{
InputBox
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
CachedListVirtualDelegate
,
ListAriaRootRole
}
from
'
vs/base/browser/ui/list/list
'
;
import
{
CachedListVirtualDelegate
}
from
'
vs/base/browser/ui/list/list
'
;
import
{
DefaultStyleController
}
from
'
vs/base/browser/ui/list/listWidget
'
;
import
{
ISelectOptionItem
,
SelectBox
}
from
'
vs/base/browser/ui/selectBox/selectBox
'
;
import
{
ToolBar
}
from
'
vs/base/browser/ui/toolbar/toolbar
'
;
...
...
@@ -1534,7 +1534,7 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> {
renderers
,
{
supportDynamicHeights
:
true
,
ariaRole
:
ListAriaRootRole
.
FORM
,
ariaRole
:
'
form
'
,
ariaLabel
:
localize
(
'
treeAriaLabel
'
,
"
Settings
"
),
identityProvider
:
{
getId
(
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录