Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove AccessibleBuffer #4427

Merged
merged 5 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions css/xterm.css
Original file line number Diff line number Diff line change
Expand Up @@ -151,29 +151,6 @@
color: transparent;
}

.xterm .xterm-accessible-buffer div {
white-space: pre-wrap;
}

.xterm .xterm-accessible-buffer {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
padding: .5em;
background: #000;
color: #fff;
opacity: 0;
overflow: scroll;
overflow-x: hidden;
}

.xterm .xterm-accessible-buffer:focus-within {
opacity: 1;
z-index: 20;
}

.xterm .live-region {
position: absolute;
left: -9999px;
Expand Down
101 changes: 0 additions & 101 deletions src/browser/AccessibleBuffer.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/browser/LocalizableStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ export let promptLabel = 'Terminal input';

// eslint-disable-next-line prefer-const
export let tooMuchOutput = 'Too much output to announce, navigate to rows manually to read';

// eslint-disable-next-line prefer-const
export let accessibleBuffer = 'Accessibility buffer';
14 changes: 0 additions & 14 deletions src/browser/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import * as Browser from 'common/Platform';
import { addDisposableDomListener } from 'browser/Lifecycle';
import * as Strings from 'browser/LocalizableStrings';
import { AccessibilityManager } from './AccessibilityManager';
import { AccessibleBuffer } from './AccessibleBuffer';
import { ITheme, IMarker, IDisposable, ILinkProvider, IDecorationOptions, IDecoration } from 'xterm';
import { DomRenderer } from 'browser/renderer/dom/DomRenderer';
import { KeyboardResultType, CoreMouseEventType, CoreMouseButton, CoreMouseAction, ITerminalOptions, ScrollSource, IColorEvent, ColorIndex, ColorRequestType } from 'common/Types';
Expand Down Expand Up @@ -72,7 +71,6 @@ export class Terminal extends CoreTerminal implements ITerminal {
private _viewportElement: HTMLElement | undefined;
private _helperContainer: HTMLElement | undefined;
private _compositionView: HTMLElement | undefined;
private _accessibleBuffer: AccessibleBuffer | undefined;

private _overviewRulerRenderer: OverviewRulerRenderer | undefined;

Expand Down Expand Up @@ -193,13 +191,6 @@ export class Terminal extends CoreTerminal implements ITerminal {
}));
}

public registerBufferElementProvider(bufferProvider: IBufferElementProvider): IDisposable {
if (!this._accessibleBuffer) {
throw new Error ('Cannot register buffer element provider when terminal has not been opened yet');
}
return this._accessibleBuffer.registerBufferElementProvider(bufferProvider);
}

/**
* Handle color event from inputhandler for OSC 4|104 | 10|110 | 11|111 | 12|112.
* An event from OSC 4|104 may contain multiple set or report requests, and multiple
Expand Down Expand Up @@ -585,8 +576,6 @@ export class Terminal extends CoreTerminal implements ITerminal {
// Listen for mouse events and translate
// them into terminal mouse protocols.
this.bindMouse();

this._accessibleBuffer = this._instantiationService.createInstance(AccessibleBuffer, this);
}

private _createRenderer(): IRenderer {
Expand Down Expand Up @@ -778,9 +767,6 @@ export class Terminal extends CoreTerminal implements ITerminal {
*/
this.register(addDisposableDomListener(el, 'mousedown', (ev: MouseEvent) => {
ev.preventDefault();
if (this._accessibleBuffer?.isAccessibleBufferActive) {
return;
}
this.focus();

// Don't send the mouse button to the pty if mouse events are disabled or
Expand Down
1 change: 0 additions & 1 deletion src/browser/Types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export interface IPublicTerminal extends IDisposable {
refresh(start: number, end: number): void;
clearTextureAtlas(): void;
reset(): void;
registerBufferElementProvider(bufferProvider: IBufferElementProvider): IDisposable;
}

export type CustomKeyEventHandler = (event: KeyboardEvent) => boolean;
Expand Down
3 changes: 0 additions & 3 deletions src/browser/public/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,6 @@ export class Terminal implements ITerminalApi {
public loadAddon(addon: ITerminalAddon): void {
return this._addonManager.loadAddon(this, addon);
}
public registerBufferElementProvider(bufferProvider: IBufferElementProvider): IDisposable {
return this._core.registerBufferElementProvider(bufferProvider);
}
public static get strings(): ILocalizableStrings {
return Strings;
}
Expand Down
13 changes: 0 additions & 13 deletions typings/xterm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,6 @@ declare module 'xterm' {
* being printed to the terminal when `screenReaderMode` is enabled.
*/
tooMuchOutput: string;

/**
* The aria label for the accessibility buffer
*/
accessibleBuffer: string;
}

/**
Expand Down Expand Up @@ -1108,14 +1103,6 @@ declare module 'xterm' {
* @param addon The addon to load.
*/
loadAddon(addon: ITerminalAddon): void;

/*
* Registers a buffer element provider which will provide a custom element to
* use in the terminal's accessible buffer. Using this an xterm.js embedder
* has full control over how the buffer is represented in the DOM.
* @param bufferElementProvider The buffer element provider.
*/
registerBufferElementProvider(bufferProvider: IBufferElementProvider): IDisposable;
}

/**
Expand Down