From cd30f542762fcd82fc3d75d0d27e3ceca454fb02 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 22 Feb 2022 14:12:29 -0600 Subject: [PATCH 1/5] get dispose to work --- src/browser/services/DecorationService.ts | 30 ++++++++++------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/browser/services/DecorationService.ts b/src/browser/services/DecorationService.ts index 957a5de5..de90649e 100644 --- a/src/browser/services/DecorationService.ts +++ b/src/browser/services/DecorationService.ts @@ -122,23 +122,6 @@ export class Decoration extends Disposable implements IDecoration { } else { this._element.style.left = this.x ? `${this.x * renderService.dimensions.actualCellWidth}px` : ''; } - this.register({ - dispose: () => { - if (this.isDisposed) { - return; - } - if (!this.marker.isDisposed) { - this.marker.dispose(); - } - if (this._element && this._container.contains(this._element)) { - this._container.removeChild(this._element); - } - this.isDisposed = true; - // Emit before super.dispose such that dispose listeners get a change to react - this._onDispose.fire(); - super.dispose(); - } - }); } private _refreshStyle(renderService: IRenderService): void { @@ -154,4 +137,17 @@ export class Decoration extends Disposable implements IDecoration { this._element.style.display = this._bufferService.buffer === this._bufferService.buffers.alt ? 'none' : 'block'; } } + + public override dispose(): void { + if (this.isDisposed) { + return; + } + if (this._element && this._container.contains(this._element)) { + this._container.removeChild(this._element); + } + this.isDisposed = true; + // Emit before super.dispose such that dispose listeners get a change to react + this._onDispose.fire(); + super.dispose(); + } } From 1da492646cb2fa1920aa2b18a3b7e5d5fad0d548 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 22 Feb 2022 14:14:05 -0600 Subject: [PATCH 2/5] re-add dispose of marker --- src/browser/services/DecorationService.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/browser/services/DecorationService.ts b/src/browser/services/DecorationService.ts index de90649e..5cf7a106 100644 --- a/src/browser/services/DecorationService.ts +++ b/src/browser/services/DecorationService.ts @@ -145,6 +145,9 @@ export class Decoration extends Disposable implements IDecoration { if (this._element && this._container.contains(this._element)) { this._container.removeChild(this._element); } + if (!this.marker.isDisposed) { + this.marker.dispose(); + } this.isDisposed = true; // Emit before super.dispose such that dispose listeners get a change to react this._onDispose.fire(); From 44bc9a1f588993059819d541e2e68bac2f3e5711 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 22 Feb 2022 14:18:39 -0600 Subject: [PATCH 3/5] don't dispose of marker on dispose of decoration --- src/browser/services/DecorationService.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/browser/services/DecorationService.ts b/src/browser/services/DecorationService.ts index 5cf7a106..de90649e 100644 --- a/src/browser/services/DecorationService.ts +++ b/src/browser/services/DecorationService.ts @@ -145,9 +145,6 @@ export class Decoration extends Disposable implements IDecoration { if (this._element && this._container.contains(this._element)) { this._container.removeChild(this._element); } - if (!this.marker.isDisposed) { - this.marker.dispose(); - } this.isDisposed = true; // Emit before super.dispose such that dispose listeners get a change to react this._onDispose.fire(); From b3d91041364a6dfddab5af62c4c7fba04608b2a8 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 22 Feb 2022 14:33:30 -0600 Subject: [PATCH 4/5] Revert "Add document role to accessibility tree root" This reverts commit 3a71b3f11e9781e0df834bafdf8c51a007b06920. --- src/browser/AccessibilityManager.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/browser/AccessibilityManager.ts b/src/browser/AccessibilityManager.ts index eda29c05..c162abcb 100644 --- a/src/browser/AccessibilityManager.ts +++ b/src/browser/AccessibilityManager.ts @@ -53,7 +53,6 @@ export class AccessibilityManager extends Disposable { ) { super(); this._accessibilityTreeRoot = document.createElement('div'); - this._accessibilityTreeRoot.setAttribute('role', 'document'); this._accessibilityTreeRoot.classList.add('xterm-accessibility'); this._accessibilityTreeRoot.tabIndex = 0; From 8df23582d279413706e185d4f11e02a26eab94ae Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 22 Feb 2022 17:40:37 -0600 Subject: [PATCH 5/5] remove super.dispose call --- src/browser/services/DecorationService.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/browser/services/DecorationService.ts b/src/browser/services/DecorationService.ts index de90649e..04b9ec0a 100644 --- a/src/browser/services/DecorationService.ts +++ b/src/browser/services/DecorationService.ts @@ -146,8 +146,6 @@ export class Decoration extends Disposable implements IDecoration { this._container.removeChild(this._element); } this.isDisposed = true; - // Emit before super.dispose such that dispose listeners get a change to react this._onDispose.fire(); - super.dispose(); } }