Comparing version 5.4.0-beta.23 to 5.4.0-beta.24
{ | ||
"name": "xterm", | ||
"description": "Full xterm terminal, in your browser", | ||
"version": "5.4.0-beta.23", | ||
"version": "5.4.0-beta.24", | ||
"main": "lib/xterm.js", | ||
@@ -6,0 +6,0 @@ "style": "css/xterm.css", |
@@ -50,5 +50,7 @@ /** | ||
constructor( | ||
private readonly _document: Document, | ||
private readonly _element: HTMLElement, | ||
private readonly _screenElement: HTMLElement, | ||
private readonly _viewportElement: HTMLElement, | ||
private readonly _helperContainer: HTMLElement, | ||
private readonly _linkifier2: ILinkifier2, | ||
@@ -63,3 +65,3 @@ @IInstantiationService instantiationService: IInstantiationService, | ||
super(); | ||
this._rowContainer = document.createElement('div'); | ||
this._rowContainer = this._document.createElement('div'); | ||
this._rowContainer.classList.add(ROW_CONTAINER_CLASS); | ||
@@ -69,3 +71,3 @@ this._rowContainer.style.lineHeight = 'normal'; | ||
this._refreshRowElements(this._bufferService.cols, this._bufferService.rows); | ||
this._selectionContainer = document.createElement('div'); | ||
this._selectionContainer = this._document.createElement('div'); | ||
this._selectionContainer.classList.add(SELECTION_CLASS); | ||
@@ -102,3 +104,3 @@ this._selectionContainer.setAttribute('aria-hidden', 'true'); | ||
this._widthCache = new WidthCache(document); | ||
this._widthCache = new WidthCache(this._document, this._helperContainer); | ||
this._widthCache.setFont( | ||
@@ -137,3 +139,3 @@ this._optionsService.rawOptions.fontFamily, | ||
if (!this._dimensionsStyleElement) { | ||
this._dimensionsStyleElement = document.createElement('style'); | ||
this._dimensionsStyleElement = this._document.createElement('style'); | ||
this._screenElement.appendChild(this._dimensionsStyleElement); | ||
@@ -158,3 +160,3 @@ } | ||
if (!this._themeStyleElement) { | ||
this._themeStyleElement = document.createElement('style'); | ||
this._themeStyleElement = this._document.createElement('style'); | ||
this._screenElement.appendChild(this._themeStyleElement); | ||
@@ -285,3 +287,3 @@ } | ||
for (let i = this._rowElements.length; i <= rows; i++) { | ||
const row = document.createElement('div'); | ||
const row = this._document.createElement('div'); | ||
this._rowContainer.appendChild(row); | ||
@@ -340,3 +342,3 @@ this._rowElements.push(row); | ||
// Create the selections | ||
const documentFragment = document.createDocumentFragment(); | ||
const documentFragment = this._document.createDocumentFragment(); | ||
@@ -373,3 +375,3 @@ if (columnSelectMode) { | ||
private _createSelectionElement(row: number, colStart: number, colEnd: number, rowCount: number = 1): HTMLElement { | ||
const element = document.createElement('div'); | ||
const element = this._document.createElement('div'); | ||
element.style.height = `${rowCount * this.dimensions.css.cell.height}px`; | ||
@@ -376,0 +378,0 @@ element.style.top = `${row * this.dimensions.css.cell.height}px`; |
@@ -48,7 +48,6 @@ /** | ||
constructor(_document: Document) { | ||
constructor(_document: Document, _helperContainer: HTMLElement) { | ||
this._container = _document.createElement('div'); | ||
this._container.style.position = 'absolute'; | ||
this._container.style.top = '-50000px'; | ||
this._container.style.width = '50000px'; | ||
this._container.classList.add('xterm-width-cache-measure-container'); | ||
this._container.setAttribute('aria-hidden', 'true'); | ||
// SP should stack in spans | ||
@@ -60,10 +59,14 @@ this._container.style.whiteSpace = 'pre'; | ||
const regular = _document.createElement('span'); | ||
regular.classList.add('xterm-char-measure-element'); | ||
const bold = _document.createElement('span'); | ||
bold.classList.add('xterm-char-measure-element'); | ||
bold.style.fontWeight = 'bold'; | ||
const italic = _document.createElement('span'); | ||
italic.classList.add('xterm-char-measure-element'); | ||
italic.style.fontStyle = 'italic'; | ||
const boldItalic = _document.createElement('span'); | ||
boldItalic.classList.add('xterm-char-measure-element'); | ||
boldItalic.style.fontWeight = 'bold'; | ||
@@ -79,3 +82,3 @@ boldItalic.style.fontStyle = 'italic'; | ||
_document.body.appendChild(this._container); | ||
_helperContainer.appendChild(this._container); | ||
@@ -82,0 +85,0 @@ this.clear(); |
@@ -564,3 +564,3 @@ /** | ||
private _createRenderer(): IRenderer { | ||
return this._instantiationService.createInstance(DomRenderer, this.element!, this.screenElement!, this._viewportElement!, this.linkifier2); | ||
return this._instantiationService.createInstance(DomRenderer, this._document!, this.element!, this.screenElement!, this._viewportElement!, this._helperContainer!, this.linkifier2); | ||
} | ||
@@ -567,0 +567,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2350602
24511