Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4056cfc2
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,体验更适合开发者的 AI 搜索 >>
提交
4056cfc2
编写于
12月 21, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove IE9/IE10 workarounds
上级
14acd45f
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
100 addition
and
331 deletion
+100
-331
src/vs/base/browser/browser.ts
src/vs/base/browser/browser.ts
+4
-12
src/vs/base/browser/dom.ts
src/vs/base/browser/dom.ts
+15
-37
src/vs/base/browser/keyboardEvent.ts
src/vs/base/browser/keyboardEvent.ts
+1
-1
src/vs/base/browser/ui/inputbox/inputBox.ts
src/vs/base/browser/ui/inputbox/inputBox.ts
+1
-5
src/vs/base/browser/ui/menu/menu.css
src/vs/base/browser/ui/menu/menu.css
+0
-4
src/vs/base/common/diff/diff.ts
src/vs/base/common/diff/diff.ts
+3
-3
src/vs/base/parts/quickopen/browser/quickOpenWidget.ts
src/vs/base/parts/quickopen/browser/quickOpenWidget.ts
+0
-7
src/vs/base/parts/quickopen/browser/quickopen.css
src/vs/base/parts/quickopen/browser/quickopen.css
+0
-10
src/vs/base/parts/tree/browser/treeView.ts
src/vs/base/parts/tree/browser/treeView.ts
+3
-3
src/vs/base/test/browser/browser.test.ts
src/vs/base/test/browser/browser.test.ts
+2
-2
src/vs/css.js
src/vs/css.js
+3
-128
src/vs/editor/browser/config/configuration.ts
src/vs/editor/browser/config/configuration.ts
+1
-4
src/vs/editor/browser/controller/input/textAreaWrapper.ts
src/vs/editor/browser/controller/input/textAreaWrapper.ts
+1
-1
src/vs/editor/browser/controller/mouseHandler.ts
src/vs/editor/browser/controller/mouseHandler.ts
+1
-1
src/vs/editor/browser/viewParts/lines/rangeUtil.ts
src/vs/editor/browser/viewParts/lines/rangeUtil.ts
+7
-7
src/vs/editor/browser/viewParts/lines/viewLine.ts
src/vs/editor/browser/viewParts/lines/viewLine.ts
+3
-21
src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts
...owser/viewParts/overviewRuler/decorationsOverviewRuler.ts
+1
-1
src/vs/editor/browser/viewParts/overviewRuler/overviewRulerImpl.ts
...itor/browser/viewParts/overviewRuler/overviewRulerImpl.ts
+0
-5
src/vs/editor/browser/viewParts/selections/selections.ts
src/vs/editor/browser/viewParts/selections/selections.ts
+2
-4
src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts
src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts
+5
-24
src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts
...editor/contrib/goToDeclaration/browser/goToDeclaration.ts
+1
-1
src/vs/editor/contrib/quickOpen/browser/quickCommand.ts
src/vs/editor/contrib/quickOpen/browser/quickCommand.ts
+1
-1
src/vs/loader.js
src/vs/loader.js
+43
-47
src/vs/nls.js
src/vs/nls.js
+2
-2
未找到文件。
src/vs/base/browser/browser.ts
浏览文件 @
4056cfc2
...
@@ -114,17 +114,9 @@ export function onDidChangeFullscreen(callback: () => void): IDisposable {
...
@@ -114,17 +114,9 @@ export function onDidChangeFullscreen(callback: () => void): IDisposable {
const
userAgent
=
navigator
.
userAgent
;
const
userAgent
=
navigator
.
userAgent
;
// DOCUMENTED FOR FUTURE REFERENCE:
export
const
isIE
=
(
userAgent
.
indexOf
(
'
Trident
'
)
>=
0
);
// When running IE11 in IE10 document mode, the code below will identify the browser as being IE10,
// which is correct because IE11 in IE10 document mode will reimplement all the bugs of IE10
export
const
isIE11
=
(
userAgent
.
indexOf
(
'
Trident
'
)
>=
0
&&
userAgent
.
indexOf
(
'
MSIE
'
)
<
0
);
export
const
isIE10
=
(
userAgent
.
indexOf
(
'
MSIE 10
'
)
>=
0
);
export
const
isIE9
=
(
userAgent
.
indexOf
(
'
MSIE 9
'
)
>=
0
);
export
const
isIE11orEarlier
=
isIE11
||
isIE10
||
isIE9
;
export
const
isIE10orEarlier
=
isIE10
||
isIE9
;
export
const
isIE10orLater
=
isIE11
||
isIE10
;
export
const
isEdge
=
(
userAgent
.
indexOf
(
'
Edge/
'
)
>=
0
);
export
const
isEdge
=
(
userAgent
.
indexOf
(
'
Edge/
'
)
>=
0
);
export
const
isEdgeOrIE
=
is
Edge
||
isIE11
||
isIE10
||
isIE9
;
export
const
isEdgeOrIE
=
is
IE
||
isEdge
;
export
const
isOpera
=
(
userAgent
.
indexOf
(
'
Opera
'
)
>=
0
);
export
const
isOpera
=
(
userAgent
.
indexOf
(
'
Opera
'
)
>=
0
);
export
const
isFirefox
=
(
userAgent
.
indexOf
(
'
Firefox
'
)
>=
0
);
export
const
isFirefox
=
(
userAgent
.
indexOf
(
'
Firefox
'
)
>=
0
);
...
@@ -133,7 +125,7 @@ export const isChrome = (userAgent.indexOf('Chrome') >= 0);
...
@@ -133,7 +125,7 @@ export const isChrome = (userAgent.indexOf('Chrome') >= 0);
export
const
isSafari
=
(
userAgent
.
indexOf
(
'
Chrome
'
)
===
-
1
)
&&
(
userAgent
.
indexOf
(
'
Safari
'
)
>=
0
);
export
const
isSafari
=
(
userAgent
.
indexOf
(
'
Chrome
'
)
===
-
1
)
&&
(
userAgent
.
indexOf
(
'
Safari
'
)
>=
0
);
export
const
isIPad
=
(
userAgent
.
indexOf
(
'
iPad
'
)
>=
0
);
export
const
isIPad
=
(
userAgent
.
indexOf
(
'
iPad
'
)
>=
0
);
export
const
canUseTranslate3d
=
!
is
IE9
&&
!
is
Firefox
;
export
const
canUseTranslate3d
=
!
isFirefox
;
export
const
enableEmptySelectionClipboard
=
isWebKit
;
export
const
enableEmptySelectionClipboard
=
isWebKit
;
...
@@ -167,7 +159,7 @@ export function hasCSSAnimationSupport() {
...
@@ -167,7 +159,7 @@ export function hasCSSAnimationSupport() {
export
function
supportsExecCommand
(
command
:
string
):
boolean
{
export
function
supportsExecCommand
(
command
:
string
):
boolean
{
return
(
return
(
(
isIE
11orEarlier
||
Platform
.
isNative
)
(
isIE
||
Platform
.
isNative
)
&&
document
.
queryCommandSupported
(
command
)
&&
document
.
queryCommandSupported
(
command
)
);
);
}
}
\ No newline at end of file
src/vs/base/browser/dom.ts
浏览文件 @
4056cfc2
...
@@ -176,58 +176,36 @@ export function toggleClass(node: HTMLElement, className: string, shouldHaveIt?:
...
@@ -176,58 +176,36 @@ export function toggleClass(node: HTMLElement, className: string, shouldHaveIt?:
}
}
}
}
class
DomListener
extends
Disposable
{
class
DomListener
implements
I
Disposable
{
private
_usedAddEventListener
:
boolean
;
private
_handler
:
(
e
:
any
)
=>
void
;
private
_wrapHandler
:
(
e
:
any
)
=>
void
;
private
_node
:
Element
|
Window
|
Document
;
private
_node
:
any
;
private
readonly
_type
:
string
;
private
_type
:
string
;
private
readonly
_useCapture
:
boolean
;
private
_useCapture
:
boolean
;
constructor
(
node
:
Element
|
Window
|
Document
,
type
:
string
,
handler
:
(
e
:
any
)
=>
void
,
useCapture
?:
boolean
)
{
super
();
constructor
(
node
:
Element
|
Window
|
Document
,
type
:
string
,
handler
:
(
e
:
any
)
=>
void
,
useCapture
:
boolean
)
{
this
.
_node
=
node
;
this
.
_node
=
node
;
this
.
_type
=
type
;
this
.
_type
=
type
;
this
.
_handler
=
handler
;
this
.
_useCapture
=
(
useCapture
||
false
);
this
.
_useCapture
=
(
useCapture
||
false
);
this
.
_node
.
addEventListener
(
this
.
_type
,
this
.
_handler
,
this
.
_useCapture
);
this
.
_wrapHandler
=
(
e
)
=>
{
e
=
e
||
window
.
event
;
handler
(
e
);
};
if
(
typeof
this
.
_node
.
addEventListener
===
'
function
'
)
{
this
.
_usedAddEventListener
=
true
;
this
.
_node
.
addEventListener
(
this
.
_type
,
this
.
_wrapHandler
,
this
.
_useCapture
);
}
else
{
this
.
_usedAddEventListener
=
false
;
this
.
_node
.
attachEvent
(
'
on
'
+
this
.
_type
,
this
.
_wrapHandler
);
}
}
}
public
dispose
():
void
{
public
dispose
():
void
{
if
(
!
this
.
_
wrapH
andler
)
{
if
(
!
this
.
_
h
andler
)
{
// Already disposed
// Already disposed
return
;
return
;
}
}
if
(
this
.
_usedAddEventListener
)
{
this
.
_node
.
removeEventListener
(
this
.
_type
,
this
.
_handler
,
this
.
_useCapture
);
this
.
_node
.
removeEventListener
(
this
.
_type
,
this
.
_wrapHandler
,
this
.
_useCapture
);
}
else
{
this
.
_node
.
detachEvent
(
'
on
'
+
this
.
_type
,
this
.
_wrapHandler
);
}
// Prevent leakers from holding on to the dom or handler func
// Prevent leakers from holding on to the dom or handler func
this
.
_node
=
null
;
this
.
_node
=
null
;
this
.
_
wrapH
andler
=
null
;
this
.
_
h
andler
=
null
;
}
}
}
}
export
function
addDisposableListener
(
node
:
Element
,
type
:
string
,
handler
:
(
event
:
any
)
=>
void
,
useCapture
?:
boolean
):
IDisposable
;
export
function
addDisposableListener
(
node
:
Element
|
Window
|
Document
,
type
:
string
,
handler
:
(
event
:
any
)
=>
void
,
useCapture
?:
boolean
):
IDisposable
{
export
function
addDisposableListener
(
node
:
Element
|
Window
,
type
:
string
,
handler
:
(
event
:
any
)
=>
void
,
useCapture
?:
boolean
):
IDisposable
;
export
function
addDisposableListener
(
node
:
Window
,
type
:
string
,
handler
:
(
event
:
any
)
=>
void
,
useCapture
?:
boolean
):
IDisposable
;
export
function
addDisposableListener
(
node
:
Document
,
type
:
string
,
handler
:
(
event
:
any
)
=>
void
,
useCapture
?:
boolean
):
IDisposable
;
export
function
addDisposableListener
(
node
:
any
,
type
:
string
,
handler
:
(
event
:
any
)
=>
void
,
useCapture
?:
boolean
):
IDisposable
{
return
new
DomListener
(
node
,
type
,
handler
,
useCapture
);
return
new
DomListener
(
node
,
type
,
handler
,
useCapture
);
}
}
...
@@ -444,9 +422,9 @@ class AnimationFrameQueueItem implements IDisposable {
...
@@ -444,9 +422,9 @@ class AnimationFrameQueueItem implements IDisposable {
};
};
})();
})();
/
// <summary>
/
**
///
Add a throttled listener. `handler` is fired at most every 16ms or with the next animation frame (if browser supports it).
*
Add a throttled listener. `handler` is fired at most every 16ms or with the next animation frame (if browser supports it).
/// </summary>
*/
export
interface
IEventMerger
<
R
>
{
export
interface
IEventMerger
<
R
>
{
(
lastEvent
:
R
,
currentEvent
:
Event
):
R
;
(
lastEvent
:
R
,
currentEvent
:
Event
):
R
;
}
}
...
...
src/vs/base/browser/keyboardEvent.ts
浏览文件 @
4056cfc2
...
@@ -128,7 +128,7 @@ let KEY_CODE_MAP: { [keyCode: number]: KeyCode } = {};
...
@@ -128,7 +128,7 @@ let KEY_CODE_MAP: { [keyCode: number]: KeyCode } = {};
KEY_CODE_MAP
[
226
]
=
KeyCode
.
OEM_102
;
KEY_CODE_MAP
[
226
]
=
KeyCode
.
OEM_102
;
if
(
browser
.
isIE
11orEarlier
)
{
if
(
browser
.
isIE
)
{
KEY_CODE_MAP
[
91
]
=
KeyCode
.
Meta
;
KEY_CODE_MAP
[
91
]
=
KeyCode
.
Meta
;
}
else
if
(
browser
.
isFirefox
)
{
}
else
if
(
browser
.
isFirefox
)
{
KEY_CODE_MAP
[
59
]
=
KeyCode
.
US_SEMICOLON
;
KEY_CODE_MAP
[
59
]
=
KeyCode
.
US_SEMICOLON
;
...
...
src/vs/base/browser/ui/inputbox/inputBox.ts
浏览文件 @
4056cfc2
...
@@ -125,15 +125,11 @@ export class InputBox extends Widget {
...
@@ -125,15 +125,11 @@ export class InputBox extends Widget {
this
.
onfocus
(
this
.
input
,
()
=>
this
.
onFocus
());
this
.
onfocus
(
this
.
input
,
()
=>
this
.
onFocus
());
// Add placeholder shim for IE because IE decides to hide the placeholder on focus (we dont want that!)
// Add placeholder shim for IE because IE decides to hide the placeholder on focus (we dont want that!)
if
(
this
.
placeholder
&&
Bal
.
isIE
11orEarlier
)
{
if
(
this
.
placeholder
&&
Bal
.
isIE
)
{
this
.
onclick
(
this
.
input
,
(
e
)
=>
{
this
.
onclick
(
this
.
input
,
(
e
)
=>
{
dom
.
EventHelper
.
stop
(
e
,
true
);
dom
.
EventHelper
.
stop
(
e
,
true
);
this
.
input
.
focus
();
this
.
input
.
focus
();
});
});
if
(
Bal
.
isIE9
)
{
this
.
onkeyup
(
this
.
input
,
()
=>
this
.
onValueChange
());
}
}
}
setTimeout
(()
=>
this
.
updateMirror
(),
0
);
setTimeout
(()
=>
this
.
updateMirror
(),
0
);
...
...
src/vs/base/browser/ui/menu/menu.css
浏览文件 @
4056cfc2
...
@@ -104,10 +104,6 @@
...
@@ -104,10 +104,6 @@
animation
:
fadeIn
0.083s
linear
;
animation
:
fadeIn
0.083s
linear
;
}
}
.ie.ie9
.context-view.monaco-menu-container
{
box-shadow
:
0
2px
8px
2px
#A8A8A8
;
}
.context-view.monaco-menu-container
:focus
{
.context-view.monaco-menu-container
:focus
{
outline
:
0
;
outline
:
0
;
}
}
...
...
src/vs/base/common/diff/diff.ts
浏览文件 @
4056cfc2
...
@@ -196,10 +196,10 @@ class DiffChangeHelper {
...
@@ -196,10 +196,10 @@ class DiffChangeHelper {
return
this
.
m_changes
;
return
this
.
m_changes
;
}
}
/**
* Retrieves all of the changes marked by the class in the reverse order
*/
public
getReverseChanges
():
DiffChange
[]
{
public
getReverseChanges
():
DiffChange
[]
{
/// <summary>
/// Retrieves all of the changes marked by the class in the reverse order
/// </summary>
if
(
this
.
m_originalCount
>
0
||
this
.
m_modifiedCount
>
0
)
{
if
(
this
.
m_originalCount
>
0
||
this
.
m_modifiedCount
>
0
)
{
// Finish up on whatever is left
// Finish up on whatever is left
this
.
MarkNextChange
();
this
.
MarkNextChange
();
...
...
src/vs/base/parts/quickopen/browser/quickOpenWidget.ts
浏览文件 @
4056cfc2
...
@@ -8,7 +8,6 @@ import 'vs/css!./quickopen';
...
@@ -8,7 +8,6 @@ import 'vs/css!./quickopen';
import
nls
=
require
(
'
vs/nls
'
);
import
nls
=
require
(
'
vs/nls
'
);
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
browser
=
require
(
'
vs/base/browser/browser
'
);
import
{
EventType
}
from
'
vs/base/common/events
'
;
import
{
EventType
}
from
'
vs/base/common/events
'
;
import
types
=
require
(
'
vs/base/common/types
'
);
import
types
=
require
(
'
vs/base/common/types
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
...
@@ -182,11 +181,6 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -182,11 +181,6 @@ export class QuickOpenWidget implements IModelProvider {
this
.
elementSelected
(
focus
,
e
,
shouldOpenInBackground
?
Mode
.
OPEN_IN_BACKGROUND
:
Mode
.
OPEN
);
this
.
elementSelected
(
focus
,
e
,
shouldOpenInBackground
?
Mode
.
OPEN_IN_BACKGROUND
:
Mode
.
OPEN
);
}
}
}
}
// Bug in IE 9: onInput is not fired for Backspace or Delete keys
else
if
(
browser
.
isIE9
&&
(
keyboardEvent
.
keyCode
===
KeyCode
.
Backspace
||
keyboardEvent
.
keyCode
===
KeyCode
.
Delete
))
{
this
.
onType
();
}
});
});
DOM
.
addDisposableListener
(
this
.
inputBox
.
inputElement
,
DOM
.
EventType
.
INPUT
,
(
e
:
Event
)
=>
{
DOM
.
addDisposableListener
(
this
.
inputBox
.
inputElement
,
DOM
.
EventType
.
INPUT
,
(
e
:
Event
)
=>
{
...
@@ -301,7 +295,6 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -301,7 +295,6 @@ export class QuickOpenWidget implements IModelProvider {
// Widget Attributes
// Widget Attributes
.
addClass
(
'
quick-open-widget
'
)
.
addClass
(
'
quick-open-widget
'
)
.
addClass
((
browser
.
isIE10orEarlier
)
?
'
no-shadow
'
:
''
)
.
build
(
this
.
container
);
.
build
(
this
.
container
);
// Support layout
// Support layout
...
...
src/vs/base/parts/quickopen/browser/quickopen.css
浏览文件 @
4056cfc2
...
@@ -107,21 +107,11 @@
...
@@ -107,21 +107,11 @@
box-shadow
:
0
5px
8px
#A8A8A8
;
box-shadow
:
0
5px
8px
#A8A8A8
;
}
}
.quick-open-widget.no-shadow
{
box-shadow
:
none
;
border
:
1px
solid
#E6E6E6
;
}
.vs-dark
.quick-open-widget
{
.vs-dark
.quick-open-widget
{
background-color
:
#252526
;
background-color
:
#252526
;
box-shadow
:
0
5px
8px
#000
;
box-shadow
:
0
5px
8px
#000
;
}
}
.vs-dark
.quick-open-widget.no-shadow
{
box-shadow
:
none
;
border
:
1px
solid
#000
;
}
.vs-dark
.quick-open-widget
input
{
.vs-dark
.quick-open-widget
input
{
background-color
:
#3C3C3C
;
background-color
:
#3C3C3C
;
color
:
inherit
;
color
:
inherit
;
...
...
src/vs/base/parts/tree/browser/treeView.ts
浏览文件 @
4056cfc2
...
@@ -495,7 +495,7 @@ export class TreeView extends HeightMap {
...
@@ -495,7 +495,7 @@ export class TreeView extends HeightMap {
this
.
emit
(
'
scroll
'
,
e
);
// TODO@Joao: is anyone interested in this event?
this
.
emit
(
'
scroll
'
,
e
);
// TODO@Joao: is anyone interested in this event?
});
});
if
(
Browser
.
isIE
11orEarlier
)
{
if
(
Browser
.
isIE
)
{
this
.
wrapper
.
style
.
msTouchAction
=
'
none
'
;
this
.
wrapper
.
style
.
msTouchAction
=
'
none
'
;
this
.
wrapper
.
style
.
msContentZooming
=
'
none
'
;
this
.
wrapper
.
style
.
msContentZooming
=
'
none
'
;
}
else
{
}
else
{
...
@@ -519,7 +519,7 @@ export class TreeView extends HeightMap {
...
@@ -519,7 +519,7 @@ export class TreeView extends HeightMap {
this
.
viewListeners
.
push
(
DOM
.
addDisposableListener
(
this
.
wrapper
,
Touch
.
EventType
.
Tap
,
(
e
)
=>
this
.
onTap
(
e
)));
this
.
viewListeners
.
push
(
DOM
.
addDisposableListener
(
this
.
wrapper
,
Touch
.
EventType
.
Tap
,
(
e
)
=>
this
.
onTap
(
e
)));
this
.
viewListeners
.
push
(
DOM
.
addDisposableListener
(
this
.
wrapper
,
Touch
.
EventType
.
Change
,
(
e
)
=>
this
.
onTouchChange
(
e
)));
this
.
viewListeners
.
push
(
DOM
.
addDisposableListener
(
this
.
wrapper
,
Touch
.
EventType
.
Change
,
(
e
)
=>
this
.
onTouchChange
(
e
)));
if
(
Browser
.
isIE
11orEarlier
)
{
if
(
Browser
.
isIE
)
{
this
.
viewListeners
.
push
(
DOM
.
addDisposableListener
(
this
.
wrapper
,
'
MSPointerDown
'
,
(
e
)
=>
this
.
onMsPointerDown
(
e
)));
this
.
viewListeners
.
push
(
DOM
.
addDisposableListener
(
this
.
wrapper
,
'
MSPointerDown
'
,
(
e
)
=>
this
.
onMsPointerDown
(
e
)));
this
.
viewListeners
.
push
(
DOM
.
addDisposableListener
(
this
.
wrapper
,
'
MSGestureTap
'
,
(
e
)
=>
this
.
onMsGestureTap
(
e
)));
this
.
viewListeners
.
push
(
DOM
.
addDisposableListener
(
this
.
wrapper
,
'
MSGestureTap
'
,
(
e
)
=>
this
.
onMsGestureTap
(
e
)));
...
@@ -1116,7 +1116,7 @@ export class TreeView extends HeightMap {
...
@@ -1116,7 +1116,7 @@ export class TreeView extends HeightMap {
return
;
return
;
}
}
if
(
Browser
.
isIE
10orLater
&&
Date
.
now
()
-
this
.
lastClickTimeStamp
<
300
)
{
if
(
Browser
.
isIE
&&
Date
.
now
()
-
this
.
lastClickTimeStamp
<
300
)
{
// IE10+ doesn't set the detail property correctly. While IE10 simply
// IE10+ doesn't set the detail property correctly. While IE10 simply
// counts the number of clicks, IE11 reports always 1. To align with
// counts the number of clicks, IE11 reports always 1. To align with
// other browser, we set the value to 2 if clicks events come in a 300ms
// other browser, we set the value to 2 if clicks events come in a 300ms
...
...
src/vs/base/test/browser/browser.test.ts
浏览文件 @
4056cfc2
...
@@ -13,7 +13,7 @@ suite('Browsers', () => {
...
@@ -13,7 +13,7 @@ suite('Browsers', () => {
assert
(
!
(
isWindows
&&
isMacintosh
));
assert
(
!
(
isWindows
&&
isMacintosh
));
let
isOpera
=
browser
.
isOpera
||
navigator
.
userAgent
.
indexOf
(
'
OPR
'
)
>=
0
;
let
isOpera
=
browser
.
isOpera
||
navigator
.
userAgent
.
indexOf
(
'
OPR
'
)
>=
0
;
let
isIE
11orEarlier
=
browser
.
isIE11orEarlier
;
let
isIE
=
browser
.
isIE
;
let
isFirefox
=
browser
.
isFirefox
;
let
isFirefox
=
browser
.
isFirefox
;
let
isWebKit
=
browser
.
isWebKit
;
let
isWebKit
=
browser
.
isWebKit
;
let
isChrome
=
browser
.
isChrome
;
let
isChrome
=
browser
.
isChrome
;
...
@@ -25,7 +25,7 @@ suite('Browsers', () => {
...
@@ -25,7 +25,7 @@ suite('Browsers', () => {
if
(
isOpera
)
{
if
(
isOpera
)
{
browserCount
++
;
browserCount
++
;
}
}
if
(
isIE
11orEarlier
)
{
if
(
isIE
)
{
browserCount
++
;
browserCount
++
;
}
}
if
(
isFirefox
)
{
if
(
isFirefox
)
{
...
...
src/vs/css.js
浏览文件 @
4056cfc2
...
@@ -14,11 +14,6 @@
...
@@ -14,11 +14,6 @@
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
'
use strict
'
;
var
__extends
=
(
this
&&
this
.
__extends
)
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
b
.
hasOwnProperty
(
p
))
d
[
p
]
=
b
[
p
];
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
var
_cssPluginGlobal
=
this
;
var
_cssPluginGlobal
=
this
;
var
CSSLoaderPlugin
;
var
CSSLoaderPlugin
;
(
function
(
CSSLoaderPlugin
)
{
(
function
(
CSSLoaderPlugin
)
{
...
@@ -99,120 +94,6 @@ var CSSLoaderPlugin;
...
@@ -99,120 +94,6 @@ var CSSLoaderPlugin;
};
};
return
BrowserCSSLoader
;
return
BrowserCSSLoader
;
}());
}());
/**
* Prior to IE10, IE could not go above 31 stylesheets in a page
* http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/internet-explorer-stylesheet-rule-selector-import-sheet-limit-maximum.aspx
*
* The general strategy here is to not write more than 31 link nodes to the page at the same time
* When stylesheets get loaded, they will get merged one into another to free up
* some positions for new link nodes.
*/
var
IE9CSSLoader
=
(
function
(
_super
)
{
__extends
(
IE9CSSLoader
,
_super
);
function
IE9CSSLoader
()
{
_super
.
call
(
this
);
this
.
_blockedLoads
=
[];
this
.
_mergeStyleSheetsTimeout
=
-
1
;
}
IE9CSSLoader
.
prototype
.
load
=
function
(
name
,
cssUrl
,
externalCallback
,
externalErrorback
)
{
if
(
this
.
_linkTagExists
(
name
,
cssUrl
))
{
externalCallback
();
return
;
}
var
linkNode
=
this
.
createLinkTag
(
name
,
cssUrl
,
externalCallback
,
externalErrorback
);
if
(
this
.
_styleSheetCount
()
<
31
)
{
this
.
_insertLinkNode
(
linkNode
);
}
else
{
this
.
_blockedLoads
.
push
(
linkNode
);
this
.
_handleBlocked
();
}
};
IE9CSSLoader
.
prototype
.
_styleSheetCount
=
function
()
{
var
linkCount
=
document
.
getElementsByTagName
(
'
link
'
).
length
;
var
styleCount
=
document
.
getElementsByTagName
(
'
style
'
).
length
;
return
linkCount
+
styleCount
;
};
IE9CSSLoader
.
prototype
.
_onLoad
=
function
(
name
,
callback
)
{
_super
.
prototype
.
_onLoad
.
call
(
this
,
name
,
callback
);
this
.
_handleBlocked
();
};
IE9CSSLoader
.
prototype
.
_onLoadError
=
function
(
name
,
errorback
,
err
)
{
_super
.
prototype
.
_onLoadError
.
call
(
this
,
name
,
errorback
,
err
);
this
.
_handleBlocked
();
};
IE9CSSLoader
.
prototype
.
_handleBlocked
=
function
()
{
var
_this
=
this
;
var
blockedLoadsCount
=
this
.
_blockedLoads
.
length
;
if
(
blockedLoadsCount
>
0
&&
this
.
_mergeStyleSheetsTimeout
===
-
1
)
{
this
.
_mergeStyleSheetsTimeout
=
window
.
setTimeout
(
function
()
{
return
_this
.
_mergeStyleSheets
();
},
0
);
}
};
IE9CSSLoader
.
prototype
.
_mergeStyleSheet
=
function
(
dstPath
,
dst
,
srcPath
,
src
)
{
for
(
var
i
=
src
.
rules
.
length
-
1
;
i
>=
0
;
i
--
)
{
dst
.
insertRule
(
Utilities
.
rewriteUrls
(
srcPath
,
dstPath
,
src
.
rules
[
i
].
cssText
),
0
);
}
};
IE9CSSLoader
.
prototype
.
_asIE9HTMLLinkElement
=
function
(
linkElement
)
{
return
linkElement
;
};
IE9CSSLoader
.
prototype
.
_mergeStyleSheets
=
function
()
{
this
.
_mergeStyleSheetsTimeout
=
-
1
;
var
blockedLoadsCount
=
this
.
_blockedLoads
.
length
;
var
i
,
linkDomNodes
=
document
.
getElementsByTagName
(
'
link
'
);
var
linkDomNodesCount
=
linkDomNodes
.
length
;
var
mergeCandidates
=
[];
for
(
i
=
0
;
i
<
linkDomNodesCount
;
i
++
)
{
if
(
linkDomNodes
[
i
].
readyState
===
'
loaded
'
||
linkDomNodes
[
i
].
readyState
===
'
complete
'
)
{
mergeCandidates
.
push
({
linkNode
:
linkDomNodes
[
i
],
rulesLength
:
this
.
_asIE9HTMLLinkElement
(
linkDomNodes
[
i
]).
styleSheet
.
rules
.
length
});
}
}
var
mergeCandidatesCount
=
mergeCandidates
.
length
;
// Just a little legend here :)
// - linkDomNodesCount: total number of link nodes in the DOM (this should be kept <= 31)
// - mergeCandidatesCount: loaded (finished) link nodes in the DOM (only these can be merged)
// - blockedLoadsCount: remaining number of load requests that did not fit in before (because of the <= 31 constraint)
// Now comes the heuristic part, we don't want to do too much work with the merging of styles,
// but we do need to merge stylesheets to free up loading slots.
var
mergeCount
=
Math
.
min
(
Math
.
floor
(
mergeCandidatesCount
/
2
),
blockedLoadsCount
);
// Sort the merge candidates descending (least rules last)
mergeCandidates
.
sort
(
function
(
a
,
b
)
{
return
b
.
rulesLength
-
a
.
rulesLength
;
});
var
srcIndex
,
dstIndex
;
for
(
i
=
0
;
i
<
mergeCount
;
i
++
)
{
srcIndex
=
mergeCandidates
.
length
-
1
-
i
;
dstIndex
=
i
%
(
mergeCandidates
.
length
-
mergeCount
);
// Merge rules of src into dst
this
.
_mergeStyleSheet
(
mergeCandidates
[
dstIndex
].
linkNode
.
href
,
this
.
_asIE9HTMLLinkElement
(
mergeCandidates
[
dstIndex
].
linkNode
).
styleSheet
,
mergeCandidates
[
srcIndex
].
linkNode
.
href
,
this
.
_asIE9HTMLLinkElement
(
mergeCandidates
[
srcIndex
].
linkNode
).
styleSheet
);
// Remove dom node of src
mergeCandidates
[
srcIndex
].
linkNode
.
parentNode
.
removeChild
(
mergeCandidates
[
srcIndex
].
linkNode
);
linkDomNodesCount
--
;
}
var
styleSheetCount
=
this
.
_styleSheetCount
();
while
(
styleSheetCount
<
31
&&
this
.
_blockedLoads
.
length
>
0
)
{
this
.
_insertLinkNode
(
this
.
_blockedLoads
.
shift
());
styleSheetCount
++
;
}
};
return
IE9CSSLoader
;
}(
BrowserCSSLoader
));
var
IE8CSSLoader
=
(
function
(
_super
)
{
__extends
(
IE8CSSLoader
,
_super
);
function
IE8CSSLoader
()
{
_super
.
call
(
this
);
}
IE8CSSLoader
.
prototype
.
attachListeners
=
function
(
name
,
linkNode
,
callback
,
errorback
)
{
linkNode
.
onload
=
function
()
{
linkNode
.
onload
=
null
;
callback
();
};
};
return
IE8CSSLoader
;
}(
IE9CSSLoader
));
var
NodeCSSLoader
=
(
function
()
{
var
NodeCSSLoader
=
(
function
()
{
function
NodeCSSLoader
()
{
function
NodeCSSLoader
()
{
this
.
fs
=
require
.
nodeRequire
(
'
fs
'
);
this
.
fs
=
require
.
nodeRequire
(
'
fs
'
);
...
@@ -225,9 +106,9 @@ var CSSLoaderPlugin;
...
@@ -225,9 +106,9 @@ var CSSLoaderPlugin;
}
}
externalCallback
(
contents
);
externalCallback
(
contents
);
};
};
NodeCSSLoader
.
BOM_CHAR_CODE
=
65279
;
return
NodeCSSLoader
;
return
NodeCSSLoader
;
}());
}());
NodeCSSLoader
.
BOM_CHAR_CODE
=
65279
;
// ------------------------------ Finally, the plugin
// ------------------------------ Finally, the plugin
var
CSSPlugin
=
(
function
()
{
var
CSSPlugin
=
(
function
()
{
function
CSSPlugin
(
cssLoader
)
{
function
CSSPlugin
(
cssLoader
)
{
...
@@ -287,10 +168,10 @@ var CSSLoaderPlugin;
...
@@ -287,10 +168,10 @@ var CSSLoaderPlugin;
CSSPlugin
.
prototype
.
getInlinedResources
=
function
()
{
CSSPlugin
.
prototype
.
getInlinedResources
=
function
()
{
return
global
.
cssInlinedResources
||
[];
return
global
.
cssInlinedResources
||
[];
};
};
CSSPlugin
.
BUILD_MAP
=
{};
CSSPlugin
.
BUILD_PATH_MAP
=
{};
return
CSSPlugin
;
return
CSSPlugin
;
}());
}());
CSSPlugin
.
BUILD_MAP
=
{};
CSSPlugin
.
BUILD_PATH_MAP
=
{};
CSSLoaderPlugin
.
CSSPlugin
=
CSSPlugin
;
CSSLoaderPlugin
.
CSSPlugin
=
CSSPlugin
;
var
Utilities
=
(
function
()
{
var
Utilities
=
(
function
()
{
function
Utilities
()
{
function
Utilities
()
{
...
@@ -472,12 +353,6 @@ var CSSLoaderPlugin;
...
@@ -472,12 +353,6 @@ var CSSLoaderPlugin;
if
(
typeof
process
!==
'
undefined
'
&&
process
.
versions
&&
!!
process
.
versions
.
node
&&
!
isElectron
)
{
if
(
typeof
process
!==
'
undefined
'
&&
process
.
versions
&&
!!
process
.
versions
.
node
&&
!
isElectron
)
{
cssLoader
=
new
NodeCSSLoader
();
cssLoader
=
new
NodeCSSLoader
();
}
}
else
if
(
typeof
navigator
!==
'
undefined
'
&&
navigator
.
userAgent
.
indexOf
(
'
MSIE 9
'
)
>=
0
)
{
cssLoader
=
new
IE9CSSLoader
();
}
else
if
(
typeof
navigator
!==
'
undefined
'
&&
navigator
.
userAgent
.
indexOf
(
'
MSIE 8
'
)
>=
0
)
{
cssLoader
=
new
IE8CSSLoader
();
}
else
{
else
{
cssLoader
=
new
BrowserCSSLoader
();
cssLoader
=
new
BrowserCSSLoader
();
}
}
...
...
src/vs/editor/browser/config/configuration.ts
浏览文件 @
4056cfc2
...
@@ -273,16 +273,13 @@ export class Configuration extends CommonEditorConfiguration {
...
@@ -273,16 +273,13 @@ export class Configuration extends CommonEditorConfiguration {
protected
_getEditorClassName
(
theme
:
string
,
fontLigatures
:
boolean
):
string
{
protected
_getEditorClassName
(
theme
:
string
,
fontLigatures
:
boolean
):
string
{
let
extra
=
''
;
let
extra
=
''
;
if
(
browser
.
isIE
11orEarlier
)
{
if
(
browser
.
isIE
)
{
extra
+=
'
ie
'
;
extra
+=
'
ie
'
;
}
else
if
(
browser
.
isFirefox
)
{
}
else
if
(
browser
.
isFirefox
)
{
extra
+=
'
ff
'
;
extra
+=
'
ff
'
;
}
else
if
(
browser
.
isEdge
)
{
}
else
if
(
browser
.
isEdge
)
{
extra
+=
'
edge
'
;
extra
+=
'
edge
'
;
}
}
if
(
browser
.
isIE9
)
{
extra
+=
'
ie9
'
;
}
if
(
platform
.
isMacintosh
)
{
if
(
platform
.
isMacintosh
)
{
extra
+=
'
mac
'
;
extra
+=
'
mac
'
;
}
}
...
...
src/vs/editor/browser/controller/input/textAreaWrapper.ts
浏览文件 @
4056cfc2
...
@@ -179,7 +179,7 @@ export class TextAreaWrapper extends Disposable implements ITextAreaWrapper {
...
@@ -179,7 +179,7 @@ export class TextAreaWrapper extends Disposable implements ITextAreaWrapper {
public
isInOverwriteMode
():
boolean
{
public
isInOverwriteMode
():
boolean
{
// In IE, pressing Insert will bring the typing into overwrite mode
// In IE, pressing Insert will bring the typing into overwrite mode
if
(
browser
.
isIE
11orEarlier
&&
document
.
queryCommandValue
(
'
OverWrite
'
))
{
if
(
browser
.
isIE
&&
document
.
queryCommandValue
(
'
OverWrite
'
))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
src/vs/editor/browser/controller/mouseHandler.ts
浏览文件 @
4056cfc2
...
@@ -291,7 +291,7 @@ export class MouseHandler extends ViewEventHandler implements IDisposable {
...
@@ -291,7 +291,7 @@ export class MouseHandler extends ViewEventHandler implements IDisposable {
// In IE11, if the focus is in the browser's address bar and
// In IE11, if the focus is in the browser's address bar and
// then you click in the editor, calling preventDefault()
// then you click in the editor, calling preventDefault()
// will not move focus properly (focus remains the address bar)
// will not move focus properly (focus remains the address bar)
if
(
browser
.
isIE
11orEarlier
&&
!
this
.
_isFocused
)
{
if
(
browser
.
isIE
&&
!
this
.
_isFocused
)
{
this
.
_asyncFocus
.
schedule
();
this
.
_asyncFocus
.
schedule
();
}
else
{
}
else
{
e
.
preventDefault
();
e
.
preventDefault
();
...
...
src/vs/editor/browser/viewParts/lines/rangeUtil.ts
浏览文件 @
4056cfc2
...
@@ -43,18 +43,18 @@ export class RangeUtil {
...
@@ -43,18 +43,18 @@ export class RangeUtil {
}
}
}
}
private
static
_createHorizontalRangesFromClientRects
(
clientRects
:
ClientRectList
,
clientRectDeltaLeft
:
number
,
scaleRatio
:
number
):
HorizontalRange
[]
{
private
static
_createHorizontalRangesFromClientRects
(
clientRects
:
ClientRectList
,
clientRectDeltaLeft
:
number
):
HorizontalRange
[]
{
if
(
!
clientRects
||
clientRects
.
length
===
0
)
{
if
(
!
clientRects
||
clientRects
.
length
===
0
)
{
return
null
;
return
null
;
}
}
let
result
:
HorizontalRange
[]
=
[];
let
result
:
HorizontalRange
[]
=
[];
let
prevLeft
=
Math
.
max
(
0
,
clientRects
[
0
].
left
*
scaleRatio
-
clientRectDeltaLeft
);
let
prevLeft
=
Math
.
max
(
0
,
clientRects
[
0
].
left
-
clientRectDeltaLeft
);
let
prevWidth
=
clientRects
[
0
].
width
*
scaleRatio
;
let
prevWidth
=
clientRects
[
0
].
width
;
for
(
let
i
=
1
,
len
=
clientRects
.
length
;
i
<
len
;
i
++
)
{
for
(
let
i
=
1
,
len
=
clientRects
.
length
;
i
<
len
;
i
++
)
{
let
myLeft
=
Math
.
max
(
0
,
clientRects
[
i
].
left
*
scaleRatio
-
clientRectDeltaLeft
);
let
myLeft
=
Math
.
max
(
0
,
clientRects
[
i
].
left
-
clientRectDeltaLeft
);
let
myWidth
=
clientRects
[
i
].
width
*
scaleRatio
;
let
myWidth
=
clientRects
[
i
].
width
;
if
(
myLeft
<
prevLeft
)
{
if
(
myLeft
<
prevLeft
)
{
console
.
error
(
'
Unexpected: RangeUtil._createHorizontalRangesFromClientRects: client rects are not sorted
'
);
console
.
error
(
'
Unexpected: RangeUtil._createHorizontalRangesFromClientRects: client rects are not sorted
'
);
...
@@ -74,7 +74,7 @@ export class RangeUtil {
...
@@ -74,7 +74,7 @@ export class RangeUtil {
return
result
;
return
result
;
}
}
public
static
readHorizontalRanges
(
domNode
:
HTMLElement
,
startChildIndex
:
number
,
startOffset
:
number
,
endChildIndex
:
number
,
endOffset
:
number
,
clientRectDeltaLeft
:
number
,
scaleRatio
:
number
,
endNode
:
HTMLElement
):
HorizontalRange
[]
{
public
static
readHorizontalRanges
(
domNode
:
HTMLElement
,
startChildIndex
:
number
,
startOffset
:
number
,
endChildIndex
:
number
,
endOffset
:
number
,
clientRectDeltaLeft
:
number
,
endNode
:
HTMLElement
):
HorizontalRange
[]
{
// Panic check
// Panic check
let
min
=
0
;
let
min
=
0
;
let
max
=
domNode
.
children
.
length
-
1
;
let
max
=
domNode
.
children
.
length
-
1
;
...
@@ -104,6 +104,6 @@ export class RangeUtil {
...
@@ -104,6 +104,6 @@ export class RangeUtil {
endOffset
=
Math
.
min
(
endElement
.
textContent
.
length
,
Math
.
max
(
0
,
endOffset
));
endOffset
=
Math
.
min
(
endElement
.
textContent
.
length
,
Math
.
max
(
0
,
endOffset
));
let
clientRects
=
this
.
_readClientRects
(
startElement
,
startOffset
,
endElement
,
endOffset
,
endNode
);
let
clientRects
=
this
.
_readClientRects
(
startElement
,
startOffset
,
endElement
,
endOffset
,
endNode
);
return
this
.
_createHorizontalRangesFromClientRects
(
clientRects
,
clientRectDeltaLeft
,
scaleRatio
);
return
this
.
_createHorizontalRangesFromClientRects
(
clientRects
,
clientRectDeltaLeft
);
}
}
}
}
src/vs/editor/browser/viewParts/lines/viewLine.ts
浏览文件 @
4056cfc2
...
@@ -312,7 +312,7 @@ class RenderedViewLine {
...
@@ -312,7 +312,7 @@ class RenderedViewLine {
let
partIndex
=
findIndexInArrayWithMax
(
this
.
input
.
lineParts
,
column
-
1
,
this
.
_lastRenderedPartIndex
);
let
partIndex
=
findIndexInArrayWithMax
(
this
.
input
.
lineParts
,
column
-
1
,
this
.
_lastRenderedPartIndex
);
let
charOffsetInPart
=
this
.
_charOffsetInPart
[
column
-
1
];
let
charOffsetInPart
=
this
.
_charOffsetInPart
[
column
-
1
];
let
r
=
RangeUtil
.
readHorizontalRanges
(
this
.
_getReadingTarget
(),
partIndex
,
charOffsetInPart
,
partIndex
,
charOffsetInPart
,
clientRectDeltaLeft
,
this
.
_getScaleRatio
(),
endNode
);
let
r
=
RangeUtil
.
readHorizontalRanges
(
this
.
_getReadingTarget
(),
partIndex
,
charOffsetInPart
,
partIndex
,
charOffsetInPart
,
clientRectDeltaLeft
,
endNode
);
if
(
!
r
||
r
.
length
===
0
)
{
if
(
!
r
||
r
.
length
===
0
)
{
return
-
1
;
return
-
1
;
}
}
...
@@ -332,11 +332,7 @@ class RenderedViewLine {
...
@@ -332,11 +332,7 @@ class RenderedViewLine {
let
endPartIndex
=
findIndexInArrayWithMax
(
this
.
input
.
lineParts
,
endColumn
-
1
,
this
.
_lastRenderedPartIndex
);
let
endPartIndex
=
findIndexInArrayWithMax
(
this
.
input
.
lineParts
,
endColumn
-
1
,
this
.
_lastRenderedPartIndex
);
let
endCharOffsetInPart
=
this
.
_charOffsetInPart
[
endColumn
-
1
];
let
endCharOffsetInPart
=
this
.
_charOffsetInPart
[
endColumn
-
1
];
return
RangeUtil
.
readHorizontalRanges
(
this
.
_getReadingTarget
(),
startPartIndex
,
startCharOffsetInPart
,
endPartIndex
,
endCharOffsetInPart
,
clientRectDeltaLeft
,
this
.
_getScaleRatio
(),
endNode
);
return
RangeUtil
.
readHorizontalRanges
(
this
.
_getReadingTarget
(),
startPartIndex
,
startCharOffsetInPart
,
endPartIndex
,
endCharOffsetInPart
,
clientRectDeltaLeft
,
endNode
);
}
protected
_getScaleRatio
():
number
{
return
1
;
}
}
/**
/**
...
@@ -364,12 +360,6 @@ class RenderedViewLine {
...
@@ -364,12 +360,6 @@ class RenderedViewLine {
}
}
}
}
class
IERenderedViewLine
extends
RenderedViewLine
{
protected
_getScaleRatio
():
number
{
return
screen
.
logicalXDPI
/
screen
.
deviceXDPI
;
}
}
class
WebKitRenderedViewLine
extends
RenderedViewLine
{
class
WebKitRenderedViewLine
extends
RenderedViewLine
{
protected
_readVisibleRangesForRange
(
startColumn
:
number
,
endColumn
:
number
,
clientRectDeltaLeft
:
number
,
endNode
:
HTMLElement
):
HorizontalRange
[]
{
protected
_readVisibleRangesForRange
(
startColumn
:
number
,
endColumn
:
number
,
clientRectDeltaLeft
:
number
,
endNode
:
HTMLElement
):
HorizontalRange
[]
{
let
output
=
super
.
_readVisibleRangesForRange
(
startColumn
,
endColumn
,
clientRectDeltaLeft
,
endNode
);
let
output
=
super
.
_readVisibleRangesForRange
(
startColumn
,
endColumn
,
clientRectDeltaLeft
,
endNode
);
...
@@ -407,20 +397,12 @@ function findIndexInArrayWithMax(lineParts: LineParts, desiredIndex: number, max
...
@@ -407,20 +397,12 @@ function findIndexInArrayWithMax(lineParts: LineParts, desiredIndex: number, max
}
}
const
createRenderedLine
:
(
domNode
:
FastDomNode
,
renderLineInput
:
RenderLineInput
,
modelContainsRTL
:
boolean
,
renderLineOutput
:
RenderLineOutput
)
=>
RenderedViewLine
=
(
function
()
{
const
createRenderedLine
:
(
domNode
:
FastDomNode
,
renderLineInput
:
RenderLineInput
,
modelContainsRTL
:
boolean
,
renderLineOutput
:
RenderLineOutput
)
=>
RenderedViewLine
=
(
function
()
{
if
(
window
.
screen
&&
window
.
screen
.
deviceXDPI
&&
(
navigator
.
userAgent
.
indexOf
(
'
Trident/6.0
'
)
>=
0
||
navigator
.
userAgent
.
indexOf
(
'
Trident/5.0
'
)
>=
0
))
{
if
(
browser
.
isWebKit
)
{
// IE11 doesn't need the screen.logicalXDPI / screen.deviceXDPI ratio multiplication
// for TextRange.getClientRects() anymore
return
createIERenderedLine
;
}
else
if
(
browser
.
isWebKit
)
{
return
createWebKitRenderedLine
;
return
createWebKitRenderedLine
;
}
}
return
createNormalRenderedLine
;
return
createNormalRenderedLine
;
})();
})();
function
createIERenderedLine
(
domNode
:
FastDomNode
,
renderLineInput
:
RenderLineInput
,
modelContainsRTL
:
boolean
,
renderLineOutput
:
RenderLineOutput
):
RenderedViewLine
{
return
new
IERenderedViewLine
(
domNode
,
renderLineInput
,
modelContainsRTL
,
renderLineOutput
);
}
function
createWebKitRenderedLine
(
domNode
:
FastDomNode
,
renderLineInput
:
RenderLineInput
,
modelContainsRTL
:
boolean
,
renderLineOutput
:
RenderLineOutput
):
RenderedViewLine
{
function
createWebKitRenderedLine
(
domNode
:
FastDomNode
,
renderLineInput
:
RenderLineInput
,
modelContainsRTL
:
boolean
,
renderLineOutput
:
RenderLineOutput
):
RenderedViewLine
{
return
new
WebKitRenderedViewLine
(
domNode
,
renderLineInput
,
modelContainsRTL
,
renderLineOutput
);
return
new
WebKitRenderedViewLine
(
domNode
,
renderLineInput
,
modelContainsRTL
,
renderLineOutput
);
}
}
...
...
src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts
浏览文件 @
4056cfc2
...
@@ -210,7 +210,7 @@ export class DecorationsOverviewRuler extends ViewPart {
...
@@ -210,7 +210,7 @@ export class DecorationsOverviewRuler extends ViewPart {
let
hasRendered
=
this
.
_overviewRuler
.
render
(
false
);
let
hasRendered
=
this
.
_overviewRuler
.
render
(
false
);
if
(
hasRendered
&&
OverviewRulerImpl
.
hasCanvas
&&
this
.
_overviewRuler
.
getLanesCount
()
>
0
&&
(
this
.
_zonesFromDecorations
.
length
>
0
||
this
.
_zonesFromCursors
.
length
>
0
))
{
if
(
hasRendered
&&
this
.
_overviewRuler
.
getLanesCount
()
>
0
&&
(
this
.
_zonesFromDecorations
.
length
>
0
||
this
.
_zonesFromCursors
.
length
>
0
))
{
let
ctx2
=
this
.
_overviewRuler
.
getDomNode
().
getContext
(
'
2d
'
);
let
ctx2
=
this
.
_overviewRuler
.
getDomNode
().
getContext
(
'
2d
'
);
ctx2
.
beginPath
();
ctx2
.
beginPath
();
ctx2
.
lineWidth
=
1
;
ctx2
.
lineWidth
=
1
;
...
...
src/vs/editor/browser/viewParts/overviewRuler/overviewRulerImpl.ts
浏览文件 @
4056cfc2
...
@@ -12,8 +12,6 @@ import { OverviewZoneManager } from 'vs/editor/common/view/overviewZoneManager';
...
@@ -12,8 +12,6 @@ import { OverviewZoneManager } from 'vs/editor/common/view/overviewZoneManager';
export
class
OverviewRulerImpl
{
export
class
OverviewRulerImpl
{
public
static
hasCanvas
=
(
window
.
navigator
.
userAgent
.
indexOf
(
'
MSIE 8
'
)
===
-
1
);
private
_canvasLeftOffset
:
number
;
private
_canvasLeftOffset
:
number
;
private
_domNode
:
HTMLCanvasElement
;
private
_domNode
:
HTMLCanvasElement
;
private
_lanesCount
:
number
;
private
_lanesCount
:
number
;
...
@@ -139,9 +137,6 @@ export class OverviewRulerImpl {
...
@@ -139,9 +137,6 @@ export class OverviewRulerImpl {
}
}
public
render
(
forceRender
:
boolean
):
boolean
{
public
render
(
forceRender
:
boolean
):
boolean
{
if
(
!
OverviewRulerImpl
.
hasCanvas
)
{
return
false
;
}
if
(
this
.
_zoneManager
.
getOuterHeight
()
===
0
)
{
if
(
this
.
_zoneManager
.
getOuterHeight
()
===
0
)
{
return
false
;
return
false
;
}
}
...
...
src/vs/editor/browser/viewParts/selections/selections.ts
浏览文件 @
4056cfc2
...
@@ -11,6 +11,7 @@ import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';
...
@@ -11,6 +11,7 @@ import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';
import
{
ViewContext
}
from
'
vs/editor/common/view/viewContext
'
;
import
{
ViewContext
}
from
'
vs/editor/common/view/viewContext
'
;
import
{
HorizontalRange
,
LineVisibleRanges
,
IRenderingContext
}
from
'
vs/editor/common/view/renderingContext
'
;
import
{
HorizontalRange
,
LineVisibleRanges
,
IRenderingContext
}
from
'
vs/editor/common/view/renderingContext
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
*
as
browser
from
'
vs/base/browser/browser
'
;
const
enum
CornerStyle
{
const
enum
CornerStyle
{
EXTERN
,
EXTERN
,
...
@@ -58,10 +59,7 @@ function toStyled(item: LineVisibleRanges): LineVisibleRangesWithStyle {
...
@@ -58,10 +59,7 @@ function toStyled(item: LineVisibleRanges): LineVisibleRangesWithStyle {
// TODO@Alex: Remove this once IE11 fixes Bug #524217
// TODO@Alex: Remove this once IE11 fixes Bug #524217
// The problem in IE11 is that it does some sort of auto-zooming to accomodate for displays with different pixel density.
// The problem in IE11 is that it does some sort of auto-zooming to accomodate for displays with different pixel density.
// Unfortunately, this auto-zooming is buggy around dealing with rounded borders
// Unfortunately, this auto-zooming is buggy around dealing with rounded borders
const
isIEWithZoomingIssuesNearRoundedBorders
=
(
const
isIEWithZoomingIssuesNearRoundedBorders
=
browser
.
isEdgeOrIE
;
(
navigator
.
userAgent
.
indexOf
(
'
Trident/7.0
'
)
>=
0
)
||
(
navigator
.
userAgent
.
indexOf
(
'
Edge/
'
)
>=
0
)
);
export
class
SelectionsOverlay
extends
DynamicViewOverlay
{
export
class
SelectionsOverlay
extends
DynamicViewOverlay
{
...
...
src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts
浏览文件 @
4056cfc2
...
@@ -14,10 +14,7 @@ import { IViewCursorRenderData, ViewCursor } from 'vs/editor/browser/viewParts/v
...
@@ -14,10 +14,7 @@ import { IViewCursorRenderData, ViewCursor } from 'vs/editor/browser/viewParts/v
import
{
ViewContext
}
from
'
vs/editor/common/view/viewContext
'
;
import
{
ViewContext
}
from
'
vs/editor/common/view/viewContext
'
;
import
{
IRenderingContext
,
IRestrictedRenderingContext
}
from
'
vs/editor/common/view/renderingContext
'
;
import
{
IRenderingContext
,
IRestrictedRenderingContext
}
from
'
vs/editor/common/view/renderingContext
'
;
import
{
FastDomNode
,
createFastDomNode
}
from
'
vs/base/browser/styleMutator
'
;
import
{
FastDomNode
,
createFastDomNode
}
from
'
vs/base/browser/styleMutator
'
;
import
{
TimeoutTimer
,
IntervalTimer
}
from
'
vs/base/common/async
'
;
import
{
TimeoutTimer
}
from
'
vs/base/common/async
'
;
import
*
as
browsers
from
'
vs/base/browser/browser
'
;
const
ANIMATIONS_SUPPORTED
=
!
browsers
.
isIE9
;
export
class
ViewCursors
extends
ViewPart
{
export
class
ViewCursors
extends
ViewPart
{
...
@@ -32,7 +29,6 @@ export class ViewCursors extends ViewPart {
...
@@ -32,7 +29,6 @@ export class ViewCursors extends ViewPart {
private
_domNode
:
FastDomNode
;
private
_domNode
:
FastDomNode
;
private
_startCursorBlinkAnimation
:
TimeoutTimer
;
private
_startCursorBlinkAnimation
:
TimeoutTimer
;
private
_compatBlink
:
IntervalTimer
;
private
_blinkingEnabled
:
boolean
;
private
_blinkingEnabled
:
boolean
;
private
_editorHasFocus
:
boolean
;
private
_editorHasFocus
:
boolean
;
...
@@ -58,7 +54,6 @@ export class ViewCursors extends ViewPart {
...
@@ -58,7 +54,6 @@ export class ViewCursors extends ViewPart {
this
.
_domNode
.
domNode
.
appendChild
(
this
.
_primaryCursor
.
getDomNode
());
this
.
_domNode
.
domNode
.
appendChild
(
this
.
_primaryCursor
.
getDomNode
());
this
.
_startCursorBlinkAnimation
=
new
TimeoutTimer
();
this
.
_startCursorBlinkAnimation
=
new
TimeoutTimer
();
this
.
_compatBlink
=
new
IntervalTimer
();
this
.
_blinkingEnabled
=
false
;
this
.
_blinkingEnabled
=
false
;
this
.
_editorHasFocus
=
false
;
this
.
_editorHasFocus
=
false
;
...
@@ -68,7 +63,6 @@ export class ViewCursors extends ViewPart {
...
@@ -68,7 +63,6 @@ export class ViewCursors extends ViewPart {
public
dispose
():
void
{
public
dispose
():
void
{
super
.
dispose
();
super
.
dispose
();
this
.
_startCursorBlinkAnimation
.
dispose
();
this
.
_startCursorBlinkAnimation
.
dispose
();
this
.
_compatBlink
.
dispose
();
}
}
public
getDomNode
():
HTMLElement
{
public
getDomNode
():
HTMLElement
{
...
@@ -204,7 +198,6 @@ export class ViewCursors extends ViewPart {
...
@@ -204,7 +198,6 @@ export class ViewCursors extends ViewPart {
private
_updateBlinking
():
void
{
private
_updateBlinking
():
void
{
this
.
_startCursorBlinkAnimation
.
cancel
();
this
.
_startCursorBlinkAnimation
.
cancel
();
this
.
_compatBlink
.
cancel
();
let
blinkingStyle
=
this
.
_getCursorBlinking
();
let
blinkingStyle
=
this
.
_getCursorBlinking
();
...
@@ -222,14 +215,10 @@ export class ViewCursors extends ViewPart {
...
@@ -222,14 +215,10 @@ export class ViewCursors extends ViewPart {
this
.
_updateDomClassName
();
this
.
_updateDomClassName
();
if
(
!
isHidden
&&
!
isSolid
)
{
if
(
!
isHidden
&&
!
isSolid
)
{
if
(
ANIMATIONS_SUPPORTED
)
{
this
.
_startCursorBlinkAnimation
.
setIfNotSet
(()
=>
{
this
.
_startCursorBlinkAnimation
.
setIfNotSet
(()
=>
{
this
.
_blinkingEnabled
=
true
;
this
.
_blinkingEnabled
=
true
;
this
.
_updateDomClassName
();
this
.
_updateDomClassName
();
},
ViewCursors
.
BLINK_INTERVAL
);
},
ViewCursors
.
BLINK_INTERVAL
);
}
else
{
this
.
_compatBlink
.
cancelAndSet
(()
=>
this
.
_compatBlinkUpdate
(),
ViewCursors
.
BLINK_INTERVAL
);
}
}
}
}
}
// --- end blinking logic
// --- end blinking logic
...
@@ -279,14 +268,6 @@ export class ViewCursors extends ViewPart {
...
@@ -279,14 +268,6 @@ export class ViewCursors extends ViewPart {
return
result
;
return
result
;
}
}
private
_compatBlinkUpdate
():
void
{
if
(
this
.
_isVisible
)
{
this
.
_hide
();
}
else
{
this
.
_show
();
}
}
private
_show
():
void
{
private
_show
():
void
{
this
.
_primaryCursor
.
show
();
this
.
_primaryCursor
.
show
();
for
(
let
i
=
0
,
len
=
this
.
_secondaryCursors
.
length
;
i
<
len
;
i
++
)
{
for
(
let
i
=
0
,
len
=
this
.
_secondaryCursors
.
length
;
i
<
len
;
i
++
)
{
...
...
src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts
浏览文件 @
4056cfc2
...
@@ -454,7 +454,7 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC
...
@@ -454,7 +454,7 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC
private
isEnabled
(
mouseEvent
:
IEditorMouseEvent
,
withKey
?:
IKeyboardEvent
):
boolean
{
private
isEnabled
(
mouseEvent
:
IEditorMouseEvent
,
withKey
?:
IKeyboardEvent
):
boolean
{
return
this
.
editor
.
getModel
()
&&
return
this
.
editor
.
getModel
()
&&
(
browser
.
isIE
11orEarlier
||
mouseEvent
.
event
.
detail
<=
1
)
&&
// IE does not support event.detail properly
(
browser
.
isIE
||
mouseEvent
.
event
.
detail
<=
1
)
&&
// IE does not support event.detail properly
mouseEvent
.
target
.
type
===
editorCommon
.
MouseTargetType
.
CONTENT_TEXT
&&
mouseEvent
.
target
.
type
===
editorCommon
.
MouseTargetType
.
CONTENT_TEXT
&&
(
mouseEvent
.
event
[
GotoDefinitionWithMouseEditorContribution
.
TRIGGER_MODIFIER
]
||
(
withKey
&&
withKey
.
keyCode
===
GotoDefinitionWithMouseEditorContribution
.
TRIGGER_KEY_VALUE
))
&&
(
mouseEvent
.
event
[
GotoDefinitionWithMouseEditorContribution
.
TRIGGER_MODIFIER
]
||
(
withKey
&&
withKey
.
keyCode
===
GotoDefinitionWithMouseEditorContribution
.
TRIGGER_KEY_VALUE
))
&&
DefinitionProviderRegistry
.
has
(
this
.
editor
.
getModel
());
DefinitionProviderRegistry
.
has
(
this
.
editor
.
getModel
());
...
...
src/vs/editor/contrib/quickOpen/browser/quickCommand.ts
浏览文件 @
4056cfc2
...
@@ -78,7 +78,7 @@ export class QuickCommandAction extends BaseEditorQuickOpenAction {
...
@@ -78,7 +78,7 @@ export class QuickCommandAction extends BaseEditorQuickOpenAction {
precondition
:
null
,
precondition
:
null
,
kbOpts
:
{
kbOpts
:
{
kbExpr
:
EditorContextKeys
.
Focus
,
kbExpr
:
EditorContextKeys
.
Focus
,
primary
:
(
browser
.
isIE
11orEarlier
?
KeyMod
.
Alt
|
KeyCode
.
F1
:
KeyCode
.
F1
)
primary
:
(
browser
.
isIE
?
KeyMod
.
Alt
|
KeyCode
.
F1
:
KeyCode
.
F1
)
},
},
menuOpts
:
{
menuOpts
:
{
}
}
...
...
src/vs/loader.js
浏览文件 @
4056cfc2
...
@@ -120,9 +120,9 @@ var AMDLoader;
...
@@ -120,9 +120,9 @@ var AMDLoader;
Utilities
.
isAnonymousModule
=
function
(
id
)
{
Utilities
.
isAnonymousModule
=
function
(
id
)
{
return
id
.
indexOf
(
'
===anonymous
'
)
===
0
;
return
id
.
indexOf
(
'
===anonymous
'
)
===
0
;
};
};
Utilities
.
NEXT_ANONYMOUS_ID
=
1
;
return
Utilities
;
return
Utilities
;
}
());
}());
Utilities
.
NEXT_ANONYMOUS_ID
=
1
;
AMDLoader
.
Utilities
=
Utilities
;
AMDLoader
.
Utilities
=
Utilities
;
var
ConfigurationOptionsUtil
=
(
function
()
{
var
ConfigurationOptionsUtil
=
(
function
()
{
function
ConfigurationOptionsUtil
()
{
function
ConfigurationOptionsUtil
()
{
...
@@ -248,7 +248,7 @@ var AMDLoader;
...
@@ -248,7 +248,7 @@ var AMDLoader;
return
ConfigurationOptionsUtil
.
validateConfigurationOptions
(
result
);
return
ConfigurationOptionsUtil
.
validateConfigurationOptions
(
result
);
};
};
return
ConfigurationOptionsUtil
;
return
ConfigurationOptionsUtil
;
}
());
}());
AMDLoader
.
ConfigurationOptionsUtil
=
ConfigurationOptionsUtil
;
AMDLoader
.
ConfigurationOptionsUtil
=
ConfigurationOptionsUtil
;
var
Configuration
=
(
function
()
{
var
Configuration
=
(
function
()
{
function
Configuration
(
options
)
{
function
Configuration
(
options
)
{
...
@@ -336,7 +336,7 @@ var AMDLoader;
...
@@ -336,7 +336,7 @@ var AMDLoader;
callback
:
function
()
{
callback
:
function
()
{
var
depsValues
=
[];
var
depsValues
=
[];
for
(
var
_i
=
0
;
_i
<
arguments
.
length
;
_i
++
)
{
for
(
var
_i
=
0
;
_i
<
arguments
.
length
;
_i
++
)
{
depsValues
[
_i
-
0
]
=
arguments
[
_i
];
depsValues
[
_i
]
=
arguments
[
_i
];
}
}
if
(
typeof
shimMD
.
init
===
'
function
'
)
{
if
(
typeof
shimMD
.
init
===
'
function
'
)
{
var
initReturnValue
=
shimMD
.
init
.
apply
(
global
,
depsValues
);
var
initReturnValue
=
shimMD
.
init
.
apply
(
global
,
depsValues
);
...
@@ -542,7 +542,7 @@ var AMDLoader;
...
@@ -542,7 +542,7 @@ var AMDLoader;
this
.
options
.
onError
(
err
);
this
.
options
.
onError
(
err
);
};
};
return
Configuration
;
return
Configuration
;
}
());
}());
AMDLoader
.
Configuration
=
Configuration
;
AMDLoader
.
Configuration
=
Configuration
;
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// ModuleIdResolver
// ModuleIdResolver
...
@@ -622,7 +622,7 @@ var AMDLoader;
...
@@ -622,7 +622,7 @@ var AMDLoader;
this
.
_config
.
onError
(
err
);
this
.
_config
.
onError
(
err
);
};
};
return
ModuleIdResolver
;
return
ModuleIdResolver
;
}
());
}());
AMDLoader
.
ModuleIdResolver
=
ModuleIdResolver
;
AMDLoader
.
ModuleIdResolver
=
ModuleIdResolver
;
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// Module
// Module
...
@@ -852,10 +852,11 @@ var AMDLoader;
...
@@ -852,10 +852,11 @@ var AMDLoader;
return
this
.
_unresolvedDependenciesCount
===
0
;
return
this
.
_unresolvedDependenciesCount
===
0
;
};
};
return
Module
;
return
Module
;
}
());
}());
AMDLoader
.
Module
=
Module
;
AMDLoader
.
Module
=
Module
;
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// LoaderEvent
// LoaderEvent
var
LoaderEventType
;
(
function
(
LoaderEventType
)
{
(
function
(
LoaderEventType
)
{
LoaderEventType
[
LoaderEventType
[
"
LoaderAvailable
"
]
=
1
]
=
"
LoaderAvailable
"
;
LoaderEventType
[
LoaderEventType
[
"
LoaderAvailable
"
]
=
1
]
=
"
LoaderAvailable
"
;
LoaderEventType
[
LoaderEventType
[
"
BeginLoadingScript
"
]
=
10
]
=
"
BeginLoadingScript
"
;
LoaderEventType
[
LoaderEventType
[
"
BeginLoadingScript
"
]
=
10
]
=
"
BeginLoadingScript
"
;
...
@@ -867,8 +868,7 @@ var AMDLoader;
...
@@ -867,8 +868,7 @@ var AMDLoader;
LoaderEventType
[
LoaderEventType
[
"
NodeEndEvaluatingScript
"
]
=
32
]
=
"
NodeEndEvaluatingScript
"
;
LoaderEventType
[
LoaderEventType
[
"
NodeEndEvaluatingScript
"
]
=
32
]
=
"
NodeEndEvaluatingScript
"
;
LoaderEventType
[
LoaderEventType
[
"
NodeBeginNativeRequire
"
]
=
33
]
=
"
NodeBeginNativeRequire
"
;
LoaderEventType
[
LoaderEventType
[
"
NodeBeginNativeRequire
"
]
=
33
]
=
"
NodeBeginNativeRequire
"
;
LoaderEventType
[
LoaderEventType
[
"
NodeEndNativeRequire
"
]
=
34
]
=
"
NodeEndNativeRequire
"
;
LoaderEventType
[
LoaderEventType
[
"
NodeEndNativeRequire
"
]
=
34
]
=
"
NodeEndNativeRequire
"
;
})(
AMDLoader
.
LoaderEventType
||
(
AMDLoader
.
LoaderEventType
=
{}));
})(
LoaderEventType
=
AMDLoader
.
LoaderEventType
||
(
AMDLoader
.
LoaderEventType
=
{}));
var
LoaderEventType
=
AMDLoader
.
LoaderEventType
;
function
getHighPerformanceTimestamp
()
{
function
getHighPerformanceTimestamp
()
{
return
(
hasPerformanceNow
?
global
.
performance
.
now
()
:
Date
.
now
());
return
(
hasPerformanceNow
?
global
.
performance
.
now
()
:
Date
.
now
());
}
}
...
@@ -879,7 +879,7 @@ var AMDLoader;
...
@@ -879,7 +879,7 @@ var AMDLoader;
this
.
timestamp
=
timestamp
;
this
.
timestamp
=
timestamp
;
}
}
return
LoaderEvent
;
return
LoaderEvent
;
}
());
}());
AMDLoader
.
LoaderEvent
=
LoaderEvent
;
AMDLoader
.
LoaderEvent
=
LoaderEvent
;
var
LoaderEventRecorder
=
(
function
()
{
var
LoaderEventRecorder
=
(
function
()
{
function
LoaderEventRecorder
(
loaderAvailableTimestamp
)
{
function
LoaderEventRecorder
(
loaderAvailableTimestamp
)
{
...
@@ -892,7 +892,7 @@ var AMDLoader;
...
@@ -892,7 +892,7 @@ var AMDLoader;
return
this
.
_events
;
return
this
.
_events
;
};
};
return
LoaderEventRecorder
;
return
LoaderEventRecorder
;
}
());
}());
AMDLoader
.
LoaderEventRecorder
=
LoaderEventRecorder
;
AMDLoader
.
LoaderEventRecorder
=
LoaderEventRecorder
;
var
NullLoaderEventRecorder
=
(
function
()
{
var
NullLoaderEventRecorder
=
(
function
()
{
function
NullLoaderEventRecorder
()
{
function
NullLoaderEventRecorder
()
{
...
@@ -903,9 +903,9 @@ var AMDLoader;
...
@@ -903,9 +903,9 @@ var AMDLoader;
NullLoaderEventRecorder
.
prototype
.
getEvents
=
function
()
{
NullLoaderEventRecorder
.
prototype
.
getEvents
=
function
()
{
return
[];
return
[];
};
};
NullLoaderEventRecorder
.
INSTANCE
=
new
NullLoaderEventRecorder
();
return
NullLoaderEventRecorder
;
return
NullLoaderEventRecorder
;
}
());
}());
NullLoaderEventRecorder
.
INSTANCE
=
new
NullLoaderEventRecorder
();
AMDLoader
.
NullLoaderEventRecorder
=
NullLoaderEventRecorder
;
AMDLoader
.
NullLoaderEventRecorder
=
NullLoaderEventRecorder
;
var
ModuleManager
=
(
function
()
{
var
ModuleManager
=
(
function
()
{
function
ModuleManager
(
scriptLoader
)
{
function
ModuleManager
(
scriptLoader
)
{
...
@@ -1009,7 +1009,7 @@ var AMDLoader;
...
@@ -1009,7 +1009,7 @@ var AMDLoader;
ModuleManager
.
prototype
.
enqueueDefineAnonymousModule
=
function
(
dependencies
,
callback
)
{
ModuleManager
.
prototype
.
enqueueDefineAnonymousModule
=
function
(
dependencies
,
callback
)
{
var
stack
=
null
;
var
stack
=
null
;
if
(
this
.
_config
.
isBuild
())
{
if
(
this
.
_config
.
isBuild
())
{
stack
=
(
new
Error
(
'
StackLocation
'
)
).
stack
;
stack
=
new
Error
(
'
StackLocation
'
).
stack
;
}
}
this
.
_queuedDefineCalls
.
push
({
this
.
_queuedDefineCalls
.
push
({
id
:
null
,
id
:
null
,
...
@@ -1540,7 +1540,7 @@ var AMDLoader;
...
@@ -1540,7 +1540,7 @@ var AMDLoader;
}
}
};
};
return
ModuleManager
;
return
ModuleManager
;
}
());
}());
AMDLoader
.
ModuleManager
=
ModuleManager
;
AMDLoader
.
ModuleManager
=
ModuleManager
;
/**
/**
* Load `scriptSrc` only once (avoid multiple <script> tags)
* Load `scriptSrc` only once (avoid multiple <script> tags)
...
@@ -1581,7 +1581,7 @@ var AMDLoader;
...
@@ -1581,7 +1581,7 @@ var AMDLoader;
}
}
};
};
return
OnlyOnceScriptLoader
;
return
OnlyOnceScriptLoader
;
}
());
}());
var
BrowserScriptLoader
=
(
function
()
{
var
BrowserScriptLoader
=
(
function
()
{
function
BrowserScriptLoader
()
{
function
BrowserScriptLoader
()
{
}
}
...
@@ -1617,7 +1617,7 @@ var AMDLoader;
...
@@ -1617,7 +1617,7 @@ var AMDLoader;
document
.
getElementsByTagName
(
'
head
'
)[
0
].
appendChild
(
script
);
document
.
getElementsByTagName
(
'
head
'
)[
0
].
appendChild
(
script
);
};
};
return
BrowserScriptLoader
;
return
BrowserScriptLoader
;
}
());
}());
var
WorkerScriptLoader
=
(
function
()
{
var
WorkerScriptLoader
=
(
function
()
{
function
WorkerScriptLoader
()
{
function
WorkerScriptLoader
()
{
this
.
loadCalls
=
[];
this
.
loadCalls
=
[];
...
@@ -1670,7 +1670,7 @@ var AMDLoader;
...
@@ -1670,7 +1670,7 @@ var AMDLoader;
}
}
};
};
return
WorkerScriptLoader
;
return
WorkerScriptLoader
;
}
());
}());
var
NodeScriptLoader
=
(
function
()
{
var
NodeScriptLoader
=
(
function
()
{
function
NodeScriptLoader
()
{
function
NodeScriptLoader
()
{
this
.
_initialized
=
false
;
this
.
_initialized
=
false
;
...
@@ -1753,31 +1753,27 @@ var AMDLoader;
...
@@ -1753,31 +1753,27 @@ var AMDLoader;
errorCode
:
'
cachedDataRejected
'
,
errorCode
:
'
cachedDataRejected
'
,
path
:
cachedDataPath_1
path
:
cachedDataPath_1
});
});
NodeScriptLoader
.
_runSoon
(
function
()
{
NodeScriptLoader
.
_runSoon
(
function
()
{
return
_this
.
_fs
.
unlink
(
cachedDataPath_1
,
function
(
err
)
{
return
_this
.
_fs
.
unlink
(
cachedDataPath_1
,
function
(
err
)
{
if
(
err
)
{
if
(
err
)
{
_this
.
_moduleManager
.
getConfigurationOptions
().
onNodeCachedDataError
({
_this
.
_moduleManager
.
getConfigurationOptions
().
onNodeCachedDataError
({
errorCode
:
'
unlink
'
,
errorCode
:
'
unlink
'
,
path
:
cachedDataPath_1
,
path
:
cachedDataPath_1
,
detail
:
err
detail
:
err
});
});
}
}
});
},
opts
.
nodeCachedDataWriteDelay
);
});
},
opts
.
nodeCachedDataWriteDelay
);
}
}
else
if
(
script
.
cachedDataProduced
)
{
else
if
(
script
.
cachedDataProduced
)
{
// data produced => write cache file
// data produced => write cache file
NodeScriptLoader
.
_runSoon
(
function
()
{
NodeScriptLoader
.
_runSoon
(
function
()
{
return
_this
.
_fs
.
writeFile
(
cachedDataPath_1
,
script
.
cachedData
,
function
(
err
)
{
return
_this
.
_fs
.
writeFile
(
cachedDataPath_1
,
script
.
cachedData
,
function
(
err
)
{
if
(
err
)
{
if
(
err
)
{
_this
.
_moduleManager
.
getConfigurationOptions
().
onNodeCachedDataError
({
_this
.
_moduleManager
.
getConfigurationOptions
().
onNodeCachedDataError
({
errorCode
:
'
writeFile
'
,
errorCode
:
'
writeFile
'
,
path
:
cachedDataPath_1
,
path
:
cachedDataPath_1
,
detail
:
err
detail
:
err
});
});
}
}
});
},
opts
.
nodeCachedDataWriteDelay
);
});
},
opts
.
nodeCachedDataWriteDelay
);
}
}
});
});
}
}
...
@@ -1803,9 +1799,9 @@ var AMDLoader;
...
@@ -1803,9 +1799,9 @@ var AMDLoader;
var
timeout
=
minTimeout
+
Math
.
ceil
(
Math
.
random
()
*
minTimeout
);
var
timeout
=
minTimeout
+
Math
.
ceil
(
Math
.
random
()
*
minTimeout
);
setTimeout
(
callback
,
timeout
);
setTimeout
(
callback
,
timeout
);
};
};
NodeScriptLoader
.
_BOM
=
0xFEFF
;
return
NodeScriptLoader
;
return
NodeScriptLoader
;
}
());
}());
NodeScriptLoader
.
_BOM
=
0xFEFF
;
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
...
@@ -1831,11 +1827,11 @@ var AMDLoader;
...
@@ -1831,11 +1827,11 @@ var AMDLoader;
moduleManager
.
enqueueDefineAnonymousModule
(
dependencies
,
callback
);
moduleManager
.
enqueueDefineAnonymousModule
(
dependencies
,
callback
);
}
}
}
}
DefineFunc
.
amd
=
{
jQuery
:
true
};
return
DefineFunc
;
return
DefineFunc
;
}
());
}());
DefineFunc
.
amd
=
{
jQuery
:
true
};
var
RequireFunc
=
(
function
()
{
var
RequireFunc
=
(
function
()
{
function
RequireFunc
()
{
function
RequireFunc
()
{
if
(
arguments
.
length
===
1
)
{
if
(
arguments
.
length
===
1
)
{
...
@@ -1882,7 +1878,7 @@ var AMDLoader;
...
@@ -1882,7 +1878,7 @@ var AMDLoader;
return
moduleManager
.
getLoaderEvents
();
return
moduleManager
.
getLoaderEvents
();
};
};
return
RequireFunc
;
return
RequireFunc
;
}
());
}());
var
global
=
_amdLoaderGlobal
,
hasPerformanceNow
=
(
global
.
performance
&&
typeof
global
.
performance
.
now
===
'
function
'
),
isWebWorker
,
isElectronRenderer
,
isElectronMain
,
isNode
,
scriptLoader
,
moduleManager
,
loaderAvailableTimestamp
;
var
global
=
_amdLoaderGlobal
,
hasPerformanceNow
=
(
global
.
performance
&&
typeof
global
.
performance
.
now
===
'
function
'
),
isWebWorker
,
isElectronRenderer
,
isElectronMain
,
isNode
,
scriptLoader
,
moduleManager
,
loaderAvailableTimestamp
;
function
initVars
()
{
function
initVars
()
{
isWebWorker
=
(
typeof
global
.
importScripts
===
'
function
'
);
isWebWorker
=
(
typeof
global
.
importScripts
===
'
function
'
);
...
...
src/vs/nls.js
浏览文件 @
4056cfc2
...
@@ -172,10 +172,10 @@ var NLSLoaderPlugin;
...
@@ -172,10 +172,10 @@ var NLSLoaderPlugin;
},
null
,
'
\t
'
));
},
null
,
'
\t
'
));
};
};
;
;
NLSPlugin
.
BUILD_MAP
=
{};
NLSPlugin
.
BUILD_MAP_KEYS
=
{};
return
NLSPlugin
;
return
NLSPlugin
;
}());
}());
NLSPlugin
.
BUILD_MAP
=
{};
NLSPlugin
.
BUILD_MAP_KEYS
=
{};
NLSLoaderPlugin
.
NLSPlugin
=
NLSPlugin
;
NLSLoaderPlugin
.
NLSPlugin
=
NLSPlugin
;
(
function
()
{
(
function
()
{
define
(
'
vs/nls
'
,
new
NLSPlugin
());
define
(
'
vs/nls
'
,
new
NLSPlugin
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录