Update playwright test to latest

This commit is contained in:
Daniel Imms
2025-12-30 06:03:17 -08:00
parent 5c2cd474ce
commit 481431fbc1
4 changed files with 23 additions and 11 deletions
+11 -4
View File
@@ -143,12 +143,19 @@ export class WidthCache implements IDisposable {
}
class WidthCacheFontVariantCanvas implements IWidthCacheFontVariantCanvas {
private _canvas: OffscreenCanvas;
private _ctx: OffscreenCanvasRenderingContext2D;
private _canvas: OffscreenCanvas | HTMLCanvasElement;
private _ctx: OffscreenCanvasRenderingContext2D | CanvasRenderingContext2D;
constructor() {
this._canvas = new OffscreenCanvas(1, 1);
this._ctx = throwIfFalsy(this._canvas.getContext('2d'));
if (typeof OffscreenCanvas !== 'undefined') {
this._canvas = new OffscreenCanvas(1, 1);
this._ctx = throwIfFalsy(this._canvas.getContext('2d'));
} else {
this._canvas = document.createElement('canvas');
this._canvas.width = 1;
this._canvas.height = 1;
this._ctx = throwIfFalsy(this._canvas.getContext('2d'));
}
}
public setFont(fontFamily: string, fontSize: number, fontWeight: FontWeight, italic: boolean): void {