From de11a7dec60203bd69084b5bac2320b936912dce Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 22 Jan 2021 17:49:49 +0100 Subject: [PATCH] Rename `isEdge` to `isEdgeLegacy` (see https://support.microsoft.com/en-us/help/4533505/what-is-microsoft-edge-legacy) --- src/vs/base/browser/browser.ts | 4 ++-- src/vs/base/browser/canIUse.ts | 2 +- src/vs/base/browser/dom.ts | 4 ++-- src/vs/editor/browser/controller/mouseTarget.ts | 2 +- src/vs/editor/browser/viewParts/lines/viewLine.ts | 2 +- src/vs/editor/browser/viewParts/selections/selections.ts | 2 +- src/vs/editor/contrib/clipboard/clipboard.ts | 2 +- src/vs/platform/files/browser/indexedDBFileSystemProvider.ts | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/vs/base/browser/browser.ts b/src/vs/base/browser/browser.ts index 9a64c50adfc..06da4cad0c6 100644 --- a/src/vs/base/browser/browser.ts +++ b/src/vs/base/browser/browser.ts @@ -110,7 +110,7 @@ export const onDidChangeFullscreen = WindowManager.INSTANCE.onDidChangeFullscree const userAgent = navigator.userAgent; -export const isEdge = (userAgent.indexOf('Edge/') >= 0); +export const isEdgeLegacy = (userAgent.indexOf('Edge/') >= 0); export const isOpera = (userAgent.indexOf('Opera') >= 0); export const isFirefox = (userAgent.indexOf('Firefox') >= 0); export const isWebKit = (userAgent.indexOf('AppleWebKit') >= 0); @@ -118,6 +118,6 @@ export const isChrome = (userAgent.indexOf('Chrome') >= 0); export const isSafari = (!isChrome && (userAgent.indexOf('Safari') >= 0)); export const isWebkitWebView = (!isChrome && !isSafari && isWebKit); export const isIPad = (userAgent.indexOf('iPad') >= 0 || (isSafari && navigator.maxTouchPoints > 0)); -export const isEdgeWebView = isEdge && (userAgent.indexOf('WebView/') >= 0); +export const isEdgeLegacyWebView = isEdgeLegacy && (userAgent.indexOf('WebView/') >= 0); export const isElectron = (userAgent.indexOf('Electron/') >= 0); export const isStandalone = (window.matchMedia && window.matchMedia('(display-mode: standalone)').matches); diff --git a/src/vs/base/browser/canIUse.ts b/src/vs/base/browser/canIUse.ts index 3f5391410a7..ca5ab5e01c5 100644 --- a/src/vs/base/browser/canIUse.ts +++ b/src/vs/base/browser/canIUse.ts @@ -27,7 +27,7 @@ export const BrowserFeatures = { || !!(navigator && navigator.clipboard && navigator.clipboard.readText) ), richText: (() => { - if (browser.isEdge) { + if (browser.isEdgeLegacy) { let index = navigator.userAgent.indexOf('Edge/'); let version = parseInt(navigator.userAgent.substring(index + 5, navigator.userAgent.indexOf('.', index)), 10); diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index 7bbfbb3040b..0e21c5087d8 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -841,7 +841,7 @@ export const EventType = { MOUSE_OUT: 'mouseout', MOUSE_ENTER: 'mouseenter', MOUSE_LEAVE: 'mouseleave', - MOUSE_WHEEL: browser.isEdge ? 'mousewheel' : 'wheel', + MOUSE_WHEEL: browser.isEdgeLegacy ? 'mousewheel' : 'wheel', POINTER_UP: 'pointerup', POINTER_DOWN: 'pointerdown', POINTER_MOVE: 'pointermove', @@ -1194,7 +1194,7 @@ export function computeScreenAwareSize(cssPx: number): number { * See https://mathiasbynens.github.io/rel-noopener/ */ export function windowOpenNoOpener(url: string): void { - if (browser.isElectron || browser.isEdgeWebView) { + if (browser.isElectron || browser.isEdgeLegacyWebView) { // In VSCode, window.open() always returns null... // The same is true for a WebView (see https://github.com/microsoft/monaco-editor/issues/628) // Also call directly window.open in sandboxed Electron (see https://github.com/microsoft/monaco-editor/issues/2220) diff --git a/src/vs/editor/browser/controller/mouseTarget.ts b/src/vs/editor/browser/controller/mouseTarget.ts index d880c1a322f..fd22696e802 100644 --- a/src/vs/editor/browser/controller/mouseTarget.ts +++ b/src/vs/editor/browser/controller/mouseTarget.ts @@ -767,7 +767,7 @@ export class MouseTargetFactory { const lineWidth = ctx.getLineWidth(lineNumber); if (request.mouseContentHorizontalOffset > lineWidth) { - if (browser.isEdge && pos.column === 1) { + if (browser.isEdgeLegacy && pos.column === 1) { // See https://github.com/microsoft/vscode/issues/10875 const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth); return request.fulfill(MouseTargetType.CONTENT_EMPTY, new Position(lineNumber, ctx.model.getLineMaxColumn(lineNumber)), undefined, detail); diff --git a/src/vs/editor/browser/viewParts/lines/viewLine.ts b/src/vs/editor/browser/viewParts/lines/viewLine.ts index d80556fb9ee..96754ec4bbd 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLine.ts +++ b/src/vs/editor/browser/viewParts/lines/viewLine.ts @@ -44,7 +44,7 @@ const canUseFastRenderedViewLine = (function () { let monospaceAssumptionsAreValid = true; -const alwaysRenderInlineSelection = (browser.isEdge); +const alwaysRenderInlineSelection = (browser.isEdgeLegacy); export class DomReadingContext { diff --git a/src/vs/editor/browser/viewParts/selections/selections.ts b/src/vs/editor/browser/viewParts/selections/selections.ts index cdb00570ce0..81417f0bee1 100644 --- a/src/vs/editor/browser/viewParts/selections/selections.ts +++ b/src/vs/editor/browser/viewParts/selections/selections.ts @@ -60,7 +60,7 @@ function toStyled(item: LineVisibleRanges): LineVisibleRangesWithStyle { // 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. // Unfortunately, this auto-zooming is buggy around dealing with rounded borders -const isIEWithZoomingIssuesNearRoundedBorders = browser.isEdge; +const isIEWithZoomingIssuesNearRoundedBorders = browser.isEdgeLegacy; export class SelectionsOverlay extends DynamicViewOverlay { diff --git a/src/vs/editor/contrib/clipboard/clipboard.ts b/src/vs/editor/contrib/clipboard/clipboard.ts index 164131ffbea..8a0f08ffc40 100644 --- a/src/vs/editor/contrib/clipboard/clipboard.ts +++ b/src/vs/editor/contrib/clipboard/clipboard.ts @@ -24,7 +24,7 @@ const CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste'; const supportsCut = (platform.isNative || document.queryCommandSupported('cut')); const supportsCopy = (platform.isNative || document.queryCommandSupported('copy')); // IE and Edge have trouble with setting html content in clipboard -const supportsCopyWithSyntaxHighlighting = (supportsCopy && !browser.isEdge); +const supportsCopyWithSyntaxHighlighting = (supportsCopy && !browser.isEdgeLegacy); // Firefox only supports navigator.clipboard.readText() in browser extensions. // See https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText#Browser_compatibility // When loading over http, navigator.clipboard can be undefined. See https://github.com/microsoft/monaco-editor/issues/2313 diff --git a/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts b/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts index 02309f48720..c863c64bfee 100644 --- a/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts +++ b/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts @@ -48,7 +48,7 @@ export class IndexedDB { } private openIndexedDB(name: string, version: number, stores: string[]): Promise { - if (browser.isEdge) { + if (browser.isEdgeLegacy) { return Promise.resolve(null); } return new Promise((c, e) => { -- GitLab