Merge from vscode fcf3346a8e9f5ee1e00674461d9e2c2292a14ee3 (#12295)

* Merge from vscode fcf3346a8e9f5ee1e00674461d9e2c2292a14ee3

* Fix test build break

* Update distro

* Fix build errors

* Update distro

* Update REH build file

* Update build task names for REL

* Fix product build yaml

* Fix product REH task name

* Fix type in task name

* Update linux build step

* Update windows build tasks

* Turn off server publish

* Disable REH

* Fix typo

* Bump distro

* Update vscode tests

* Bump distro

* Fix type in disto

* Bump distro

* Turn off docker build

* Remove docker step from release

Co-authored-by: ADS Merger <andresse@microsoft.com>
Co-authored-by: Karl Burtram <karlb@microsoft.com>
This commit is contained in:
Christopher Suh
2020-10-03 14:42:05 -04:00
committed by GitHub
parent 58d02b76db
commit 6ff1e3866b
687 changed files with 10507 additions and 9104 deletions

View File

@@ -12,7 +12,6 @@ import { onUnexpectedError } from 'vs/base/common/errors';
import { Emitter, Event } from 'vs/base/common/event';
import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import * as platform from 'vs/base/common/platform';
import { coalesce } from 'vs/base/common/arrays';
import { URI } from 'vs/base/common/uri';
import { Schemas, RemoteAuthorities } from 'vs/base/common/network';
import { BrowserFeatures } from 'vs/base/browser/canIUse';
@@ -84,17 +83,17 @@ const _classList: IDomClassList = new class implements IDomClassList {
};
/** @deprecated ES6 - use classList*/
export const hasClass: (node: HTMLElement | SVGElement, className: string) => boolean = _classList.hasClass.bind(_classList);
export function hasClass(node: HTMLElement | SVGElement, className: string): boolean { return _classList.hasClass(node, className); }
/** @deprecated ES6 - use classList*/
export const addClass: (node: HTMLElement | SVGElement, className: string) => void = _classList.addClass.bind(_classList);
export function addClass(node: HTMLElement | SVGElement, className: string): void { return _classList.addClass(node, className); }
/** @deprecated ES6 - use classList*/
export const addClasses: (node: HTMLElement | SVGElement, ...classNames: string[]) => void = _classList.addClasses.bind(_classList);
export function addClasses(node: HTMLElement | SVGElement, ...classNames: string[]): void { return _classList.addClasses(node, ...classNames); }
/** @deprecated ES6 - use classList*/
export const removeClass: (node: HTMLElement | SVGElement, className: string) => void = _classList.removeClass.bind(_classList);
export function removeClass(node: HTMLElement | SVGElement, className: string): void { return _classList.removeClass(node, className); }
/** @deprecated ES6 - use classList*/
export const removeClasses: (node: HTMLElement | SVGElement, ...classNames: string[]) => void = _classList.removeClasses.bind(_classList);
export function removeClasses(node: HTMLElement | SVGElement, ...classNames: string[]): void { return _classList.removeClasses(node, ...classNames); }
/** @deprecated ES6 - use classList*/
export const toggleClass: (node: HTMLElement | SVGElement, className: string, shouldHaveIt?: boolean) => void = _classList.toggleClass.bind(_classList);
export function toggleClass(node: HTMLElement | SVGElement, className: string, shouldHaveIt?: boolean): void { return _classList.toggleClass(node, className, shouldHaveIt); }
class DomListener implements IDisposable {
@@ -411,9 +410,9 @@ export function getClientArea(element: HTMLElement): Dimension {
}
// If visual view port exits and it's on mobile, it should be used instead of window innerWidth / innerHeight, or document.body.clientWidth / document.body.clientHeight
if (platform.isIOS && (<any>window).visualViewport) {
const width = (<any>window).visualViewport.width;
const height = (<any>window).visualViewport.height - (
if (platform.isIOS && window.visualViewport) {
const width = window.visualViewport.width;
const height = window.visualViewport.height - (
browser.isStandalone
// in PWA mode, the visual viewport always includes the safe-area-inset-bottom (which is for the home indicator)
// even when you are using the onscreen monitor, the visual viewport will include the area between system statusbar and the onscreen keyboard
@@ -785,11 +784,11 @@ function getSharedStyleSheet(): HTMLStyleElement {
}
function getDynamicStyleSheetRules(style: any) {
if (style && style.sheet && style.sheet.rules) {
if (style?.sheet?.rules) {
// Chrome, IE
return style.sheet.rules;
}
if (style && style.sheet && style.sheet.cssRules) {
if (style?.sheet?.cssRules) {
// FF
return style.sheet.cssRules;
}
@@ -1012,20 +1011,23 @@ export function prepend<T extends Node>(parent: HTMLElement, child: T): T {
return child;
}
const SELECTOR_REGEX = /([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;
export function reset<T extends Node>(parent: HTMLElement, ...children: Array<Node | string>) {
/**
* Removes all children from `parent` and appends `children`
*/
export function reset(parent: HTMLElement, ...children: Array<Node | string>) {
parent.innerText = '';
coalesce(children)
.forEach(child => {
if (child instanceof Node) {
parent.appendChild(child);
} else {
parent.appendChild(document.createTextNode(child as string));
}
});
for (const child of children) {
if (child instanceof Node) {
parent.appendChild(child);
} else if (typeof child === 'string') {
parent.appendChild(document.createTextNode(child));
}
}
}
const SELECTOR_REGEX = /([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;
export enum Namespace {
HTML = 'http://www.w3.org/1999/xhtml',
SVG = 'http://www.w3.org/2000/svg'
@@ -1075,14 +1077,13 @@ function _$<T extends Element>(namespace: Namespace, description: string, attrs?
}
});
coalesce(children)
.forEach(child => {
if (child instanceof Node) {
result.appendChild(child);
} else {
result.appendChild(document.createTextNode(child as string));
}
});
for (const child of children) {
if (child instanceof Node) {
result.appendChild(child);
} else if (typeof child === 'string') {
result.appendChild(document.createTextNode(child));
}
}
return result as T;
}
@@ -1276,3 +1277,66 @@ export function triggerDownload(dataOrUri: Uint8Array | URI, name: string): void
// Ensure to remove the element from DOM eventually
setTimeout(() => document.body.removeChild(anchor));
}
export enum DetectedFullscreenMode {
/**
* The document is fullscreen, e.g. because an element
* in the document requested to be fullscreen.
*/
DOCUMENT = 1,
/**
* The browser is fullsreen, e.g. because the user enabled
* native window fullscreen for it.
*/
BROWSER
}
export interface IDetectedFullscreen {
/**
* Figure out if the document is fullscreen or the browser.
*/
mode: DetectedFullscreenMode;
/**
* Wether we know for sure that we are in fullscreen mode or
* it is a guess.
*/
guess: boolean;
}
export function detectFullscreen(): IDetectedFullscreen | null {
// Browser fullscreen: use DOM APIs to detect
if (document.fullscreenElement || (<any>document).webkitFullscreenElement || (<any>document).webkitIsFullScreen) {
return { mode: DetectedFullscreenMode.DOCUMENT, guess: false };
}
// There is no standard way to figure out if the browser
// is using native fullscreen. Via checking on screen
// height and comparing that to window height, we can guess
// it though.
if (window.innerHeight === screen.height) {
// if the height of the window matches the screen height, we can
// safely assume that the browser is fullscreen because no browser
// chrome is taking height away (e.g. like toolbars).
return { mode: DetectedFullscreenMode.BROWSER, guess: false };
}
if (platform.isMacintosh || platform.isLinux) {
// macOS and Linux do not properly report `innerHeight`, only Windows does
if (window.outerHeight === screen.height && window.outerWidth === screen.width) {
// if the height of the browser matches the screen height, we can
// only guess that we are in fullscreen. It is also possible that
// the user has turned off taskbars in the OS and the browser is
// simply able to span the entire size of the screen.
return { mode: DetectedFullscreenMode.BROWSER, guess: true };
}
}
// Not in fullscreen
return null;
}