Resolve a bunch of TODOs

This commit is contained in:
Daniel Imms
2018-05-04 09:38:24 -07:00
parent 2c3949375e
commit b14308f2c4
3 changed files with 4 additions and 7 deletions
-1
View File
@@ -64,7 +64,6 @@ export class Viewport implements IViewport {
const newBufferHeight = Math.round(this._currentRowHeight * this._lastRecordedBufferLength) + (this._lastRecordedViewportHeight - this._terminal.renderer.dimensions.canvasHeight); const newBufferHeight = Math.round(this._currentRowHeight * this._lastRecordedBufferLength) + (this._lastRecordedViewportHeight - this._terminal.renderer.dimensions.canvasHeight);
if (this._lastRecordedBufferHeight !== newBufferHeight) { if (this._lastRecordedBufferHeight !== newBufferHeight) {
this._lastRecordedBufferHeight = newBufferHeight; this._lastRecordedBufferHeight = newBufferHeight;
console.log('set scroll area height to ', this._currentRowHeight, this._lastRecordedBufferLength, this._lastRecordedBufferHeight);
this._scrollArea.style.height = this._lastRecordedBufferHeight + 'px'; this._scrollArea.style.height = this._lastRecordedBufferHeight + 'px';
} }
} }
-1
View File
@@ -15,7 +15,6 @@ import { RenderDebouncer } from '../utils/RenderDebouncer';
import { ScreenDprMonitor } from '../utils/ScreenDprMonitor'; import { ScreenDprMonitor } from '../utils/ScreenDprMonitor';
import { ITheme } from 'xterm'; import { ITheme } from 'xterm';
// TODO: Rename to CanvasRenderer and move this, render layers and atlas into ./src/renderer/canvas
export class Renderer extends EventEmitter implements IRenderer { export class Renderer extends EventEmitter implements IRenderer {
private _renderDebouncer: RenderDebouncer; private _renderDebouncer: RenderDebouncer;
+4 -5
View File
@@ -20,9 +20,9 @@ const BG_CLASS_PREFIX = 'xterm-bg-';
const FOCUS_CLASS = 'xterm-focus'; const FOCUS_CLASS = 'xterm-focus';
const SELECTION_CLASS = 'xterm-selection'; const SELECTION_CLASS = 'xterm-selection';
// TODO: Use aria-hidden to prevent screen reader from seeing the rendered elements
// TODO: Document that links aren't supported in the DOM renderer // TODO: Document that links aren't supported in the DOM renderer
// TODO: Pull into an addon? // TODO: Pull into an addon when TS composite projects allow easier sharing of code (not just
// interfaces) between core and addons
export class DomRenderer extends EventEmitter implements IRenderer { export class DomRenderer extends EventEmitter implements IRenderer {
private _renderDebouncer: RenderDebouncer; private _renderDebouncer: RenderDebouncer;
@@ -34,7 +34,6 @@ export class DomRenderer extends EventEmitter implements IRenderer {
public dimensions: IRenderDimensions; public dimensions: IRenderDimensions;
public colorManager: ColorManager; public colorManager: ColorManager;
// TODO: Theme/ColorManager might be better owned by Terminal not IRenderer to reduce duplication?
constructor(private _terminal: ITerminal, theme: ITheme | undefined) { constructor(private _terminal: ITerminal, theme: ITheme | undefined) {
super(); super();
const allowTransparency = this._terminal.options.allowTransparency; const allowTransparency = this._terminal.options.allowTransparency;
@@ -43,11 +42,12 @@ export class DomRenderer extends EventEmitter implements IRenderer {
this._rowContainer = document.createElement('div'); this._rowContainer = document.createElement('div');
this._rowContainer.classList.add(ROW_CONTAINER_CLASS); this._rowContainer.classList.add(ROW_CONTAINER_CLASS);
this._rowContainer.setAttribute('aria-hidden', 'true');
this._refreshRowElements(this._terminal.rows, this._terminal.cols); this._refreshRowElements(this._terminal.rows, this._terminal.cols);
this._selectionContainer = document.createElement('div'); this._selectionContainer = document.createElement('div');
this._selectionContainer.classList.add(SELECTION_CLASS); this._selectionContainer.classList.add(SELECTION_CLASS);
this._selectionContainer.setAttribute('aria-hidden', 'true');
// TODO: Should IRendererDimensions lose canvas-related concepts?
this.dimensions = { this.dimensions = {
scaledCharWidth: null, scaledCharWidth: null,
scaledCharHeight: null, scaledCharHeight: null,
@@ -98,7 +98,6 @@ export class DomRenderer extends EventEmitter implements IRenderer {
this.colorManager.setTheme(theme); this.colorManager.setTheme(theme);
} }
// TODO: CSS selectors would need to use some ID otherwise it will affect other terminals
this._styleElement = document.createElement('style'); this._styleElement = document.createElement('style');
let styles = let styles =
`.xterm .${ROW_CONTAINER_CLASS} {` + `.xterm .${ROW_CONTAINER_CLASS} {` +