Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
37edc037
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,发现更多精彩内容 >>
提交
37edc037
编写于
12月 30, 2019
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
editor: introduce setAria api
上级
780d875d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
45 addition
and
2 deletion
+45
-2
src/vs/editor/browser/controller/textAreaHandler.ts
src/vs/editor/browser/controller/textAreaHandler.ts
+13
-0
src/vs/editor/browser/editorBrowser.ts
src/vs/editor/browser/editorBrowser.ts
+13
-0
src/vs/editor/browser/view/viewImpl.ts
src/vs/editor/browser/view/viewImpl.ts
+5
-2
src/vs/editor/browser/widget/codeEditorWidget.ts
src/vs/editor/browser/widget/codeEditorWidget.ts
+7
-0
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+7
-0
未找到文件。
src/vs/editor/browser/controller/textAreaHandler.ts
浏览文件 @
37edc037
...
...
@@ -29,6 +29,7 @@ import { RenderingContext, RestrictedRenderingContext, HorizontalPosition } from
import
{
ViewContext
}
from
'
vs/editor/common/view/viewContext
'
;
import
*
as
viewEvents
from
'
vs/editor/common/view/viewEvents
'
;
import
{
AccessibilitySupport
}
from
'
vs/platform/accessibility/common/accessibility
'
;
import
{
IEditorAriaOptions
}
from
'
vs/editor/browser/editorBrowser
'
;
export
interface
ITextAreaHandlerHelper
{
visibleRangeForPositionRelativeToEditor
(
lineNumber
:
number
,
column
:
number
):
HorizontalPosition
|
null
;
...
...
@@ -424,6 +425,18 @@ export class TextAreaHandler extends ViewPart {
return
this
.
_lastRenderPosition
;
}
public
setAria
(
options
:
IEditorAriaOptions
):
void
{
if
(
options
.
activeDescendent
)
{
this
.
textArea
.
setAttribute
(
'
aria-haspopup
'
,
'
true
'
);
this
.
textArea
.
setAttribute
(
'
aria-autocomplete
'
,
'
list
'
);
this
.
textArea
.
setAttribute
(
'
aria-activedescendant
'
,
options
.
activeDescendent
);
}
else
{
this
.
textArea
.
setAttribute
(
'
aria-haspopup
'
,
'
false
'
);
this
.
textArea
.
setAttribute
(
'
aria-autocomplete
'
,
'
both
'
);
this
.
textArea
.
removeAttribute
(
'
aria-activedescendant
'
);
}
}
// --- end view API
private
_primaryCursorPosition
:
Position
=
new
Position
(
1
,
1
);
...
...
src/vs/editor/browser/editorBrowser.ts
浏览文件 @
37edc037
...
...
@@ -319,6 +319,13 @@ export interface IOverviewRuler {
setLayout
(
position
:
OverviewRulerPosition
):
void
;
}
/**
* Editor aria options.
*/
export
interface
IEditorAriaOptions
{
activeDescendent
:
string
|
undefined
;
}
/**
* A rich code editor.
*/
...
...
@@ -689,6 +696,12 @@ export interface ICodeEditor extends editorCommon.IEditor {
*/
setHiddenAreas
(
ranges
:
IRange
[]):
void
;
/**
* Sets the editor aria options, primarily the active descendent.
* @internal
*/
setAria
(
options
:
IEditorAriaOptions
):
void
;
/**
* @internal
*/
...
...
src/vs/editor/browser/view/viewImpl.ts
浏览文件 @
37edc037
...
...
@@ -11,7 +11,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import
{
IPointerHandlerHelper
}
from
'
vs/editor/browser/controller/mouseHandler
'
;
import
{
PointerHandler
}
from
'
vs/editor/browser/controller/pointerHandler
'
;
import
{
ITextAreaHandlerHelper
,
TextAreaHandler
}
from
'
vs/editor/browser/controller/textAreaHandler
'
;
import
{
IContentWidget
,
IContentWidgetPosition
,
IOverlayWidget
,
IOverlayWidgetPosition
,
IMouseTarget
,
IViewZoneChangeAccessor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
IContentWidget
,
IContentWidgetPosition
,
IOverlayWidget
,
IOverlayWidgetPosition
,
IMouseTarget
,
IViewZoneChangeAccessor
,
IEditorAriaOptions
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
ICommandDelegate
,
ViewController
}
from
'
vs/editor/browser/view/viewController
'
;
import
{
ViewOutgoingEvents
}
from
'
vs/editor/browser/view/viewOutgoingEvents
'
;
import
{
ContentViewOverlays
,
MarginViewOverlays
}
from
'
vs/editor/browser/view/viewOverlays
'
;
...
...
@@ -510,6 +510,10 @@ export class View extends ViewEventHandler {
this
.
_textAreaHandler
.
refreshFocusState
();
}
public
setAria
(
options
:
IEditorAriaOptions
):
void
{
this
.
_textAreaHandler
.
setAria
(
options
);
}
public
addContentWidget
(
widgetData
:
IContentWidgetData
):
void
{
this
.
contentWidgets
.
addWidget
(
widgetData
.
widget
);
this
.
layoutContentWidget
(
widgetData
);
...
...
@@ -559,4 +563,3 @@ function safeInvokeNoArg(func: Function): any {
onUnexpectedError
(
e
);
}
}
src/vs/editor/browser/widget/codeEditorWidget.ts
浏览文件 @
37edc037
...
...
@@ -1311,6 +1311,13 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
this
.
_modelData
.
view
.
render
(
true
,
forceRedraw
);
}
public
setAria
(
options
:
editorBrowser
.
IEditorAriaOptions
):
void
{
if
(
!
this
.
_modelData
||
!
this
.
_modelData
.
hasRealView
)
{
return
;
}
this
.
_modelData
.
view
.
setAria
(
options
);
}
public
applyFontInfo
(
target
:
HTMLElement
):
void
{
Configuration
.
applyFontInfoSlow
(
target
,
this
.
_configuration
.
options
.
get
(
EditorOption
.
fontInfo
));
}
...
...
src/vs/monaco.d.ts
浏览文件 @
37edc037
...
...
@@ -3726,6 +3726,13 @@ declare namespace monaco.editor {
readonly
target
:
IMouseTarget
|
null
;
}
/**
* Editor aria options.
*/
export
interface
IEditorAriaOptions
{
activeDescendent
:
string
|
undefined
;
}
/**
* A rich code editor.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录