@@ -13,12 +13,12 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
1313import * as colorRegistry from 'vs/platform/theme/common/colorRegistry' ;
1414import { DARK , ITheme , IThemeService , LIGHT } from 'vs/platform/theme/common/themeService' ;
1515import { registerFileProtocol , WebviewProtocol } from 'vs/workbench/contrib/webview/electron-browser/webviewProtocols' ;
16+ import { areWebviewInputOptionsEqual } from './webviewEditorService' ;
1617import { WebviewFindWidget } from './webviewFindWidget' ;
1718import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
1819import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent' ;
1920import { endsWith } from 'vs/base/common/strings' ;
2021import { isMacintosh } from 'vs/base/common/platform' ;
21- import { equals } from 'vs/base/common/arrays' ;
2222
2323export interface WebviewOptions {
2424 readonly allowSvgs ?: boolean ;
@@ -33,20 +33,6 @@ export interface WebviewContentOptions {
3333 readonly disableFindView ?: boolean ;
3434}
3535
36-
37- export function areWebviewContentOptionsEqual ( a : WebviewContentOptions , b : WebviewContentOptions ) : boolean {
38- const sameArray = < T > ( a1 : ReadonlyArray < T > , a2 : ReadonlyArray < T > ) =>
39- ( a . localResourceRoots === b . localResourceRoots
40- || ( Array . isArray ( a . localResourceRoots ) && Array . isArray ( b . localResourceRoots )
41- && equals ( a . localResourceRoots , b . localResourceRoots , ( a , b ) => a . toString ( ) === b . toString ( ) ) ) ) ;
42-
43- return a . allowScripts === b . allowScripts
44- && a . disableFindView === b . disableFindView
45- && sameArray ( a . svgWhiteList , b . svgWhiteList )
46- && sameArray ( a . localResourceRoots , b . localResourceRoots ) ;
47- }
48-
49-
5036interface IKeydownEvent {
5137 key : string ;
5238 keyCode : number ;
@@ -263,7 +249,6 @@ export class WebviewElement extends Disposable {
263249 this . _webview . setAttribute ( 'partition' , `webview${ Date . now ( ) } ` ) ;
264250
265251 this . _webview . setAttribute ( 'webpreferences' , 'contextIsolation=yes' ) ;
266- this . _webview . setAttribute ( 'autosize' , 'on' ) ;
267252
268253 this . _webview . style . flex = '0 1' ;
269254 this . _webview . style . width = '0' ;
@@ -417,7 +402,7 @@ export class WebviewElement extends Disposable {
417402 }
418403
419404 public set options ( value : WebviewContentOptions ) {
420- if ( this . _contentOptions && areWebviewContentOptionsEqual ( value , this . _contentOptions ) ) {
405+ if ( this . _contentOptions && areWebviewInputOptionsEqual ( value , this . _contentOptions ) ) {
421406 return ;
422407 }
423408
@@ -439,7 +424,7 @@ export class WebviewElement extends Disposable {
439424 }
440425
441426 public update ( value : string , options : WebviewContentOptions , retainContextWhenHidden : boolean ) {
442- if ( retainContextWhenHidden && value === this . _contents && this . _contentOptions && areWebviewContentOptionsEqual ( options , this . _contentOptions ) ) {
427+ if ( retainContextWhenHidden && value === this . _contents && this . _contentOptions && areWebviewInputOptionsEqual ( options , this . _contentOptions ) ) {
443428 return ;
444429 }
445430 this . _contents = value ;
0 commit comments