Skip to content

Commit a094340

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/axios-1.15.0
2 parents 4b77e60 + cc7e3bb commit a094340

15 files changed

Lines changed: 198 additions & 85 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -207,31 +207,31 @@ jobs:
207207
- name: Build demo server
208208
run: npm run esbuild-demo-server
209209
- name: Integration tests (core) # Tests use 50% workers to reduce flakiness
210-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=core
210+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=core
211211
- name: Integration tests (addon-attach)
212-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-attach
212+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-attach
213213
- name: Integration tests (addon-clipboard)
214-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-clipboard
214+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-clipboard
215215
- name: Integration tests (addon-fit)
216-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-fit
216+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-fit
217217
- name: Integration tests (addon-image)
218-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-image
218+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-image
219219
- name: Integration tests (addon-progress)
220-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-progress
220+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-progress
221221
- name: Integration tests (addon-search)
222-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-search
222+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-search
223223
- name: Integration tests (addon-serialize)
224-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-serialize
224+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-serialize
225225
- name: Integration tests (addon-unicode-graphemes)
226-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-unicode-graphemes
226+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-unicode-graphemes
227227
- name: Integration tests (addon-unicode11)
228-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-unicode11
228+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-unicode11
229229
- name: Integration tests (addon-web-fonts)
230-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-web-fonts
230+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-web-fonts
231231
- name: Integration tests (addon-web-links)
232-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-web-links
232+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-web-links
233233
- name: Integration tests (addon-webgl)
234-
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-webgl
234+
run: npm run test-integration-${{ matrix.browser }} -- --workers=50% --forbid-only --suite=addon-webgl
235235

236236
release-dry-run:
237237
needs: build

addons/addon-image/src/ImageRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ export class ImageRenderer extends Disposable implements IDisposable {
358358
canvas.style.zIndex = '0';
359359
screenElement.appendChild(canvas);
360360
}
361-
const ctx = canvas.getContext('2d', { alpha: true, desynchronized: true });
361+
const ctx = canvas.getContext('2d', { alpha: true });
362362
if (!ctx) {
363363
canvas.remove();
364364
return;

addons/addon-web-fonts/test/WebFontsAddon.test.ts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,25 @@ test.describe('WebFontsAddon', () => {
3333
test.describe('font loading at runtime', () => {
3434
test('loadFonts (JS)', async () => {
3535
await ctx.page.evaluate(`
36-
const ff1 = new FontFace('Kongtext', "url(/kongtext.regular.ttf) format('truetype')");
37-
const ff2 = new FontFace('BPdots', "url(/bpdots.regular.otf) format('opentype')");
36+
const ff1 = new FontFace('Kongtext', "url(/fonts/kongtext.regular.ttf) format('truetype')");
37+
const ff2 = new FontFace('BPdots', "url(/fonts/bpdots.regular.otf) format('opentype')");
3838
loadFonts([ff1, ff2]);
3939
`);
4040
deepStrictEqual(await getDocumentFonts(), [{ family: 'Kongtext', status: 'loaded' }, { family: 'BPdots', status: 'loaded' }]);
4141
});
4242
test('loadFonts (CSS, unquoted)', async () => {
4343
await ctx.page.evaluate(`
44-
document.styleSheets[0].insertRule("@font-face {font-family: Kongtext; src: url(/kongtext.regular.ttf) format('truetype')}", 0);
45-
document.styleSheets[0].insertRule("@font-face {font-family: BPdots; src: url(/bpdots.regular.otf) format('opentype')}", 1);
44+
document.styleSheets[0].insertRule("@font-face {font-family: Kongtext; src: url(/fonts/kongtext.regular.ttf) format('truetype')}", 0);
45+
document.styleSheets[0].insertRule("@font-face {font-family: BPdots; src: url(/fonts/bpdots.regular.otf) format('opentype')}", 1);
4646
loadFonts(['Kongtext', 'BPdots']);
4747
`);
4848
deepStrictEqual(await getDocumentFonts(), [{ family: 'Kongtext', status: 'loaded' }, { family: 'BPdots', status: 'loaded' }]);
4949
});
5050
test('loadFonts (CSS, quoted)', async ({ browser }) => {
5151
// NOTE: firefox preserves family quotes from CSS rules in fontface, all other browsers unquote them
5252
await ctx.page.evaluate(`
53-
document.styleSheets[0].insertRule("@font-face {font-family: 'Kongtext'; src: url(/kongtext.regular.ttf) format('truetype')}", 0);
54-
document.styleSheets[0].insertRule("@font-face {font-family: 'BPdots'; src: url(/bpdots.regular.otf) format('opentype')}", 1);
53+
document.styleSheets[0].insertRule("@font-face {font-family: 'Kongtext'; src: url(/fonts/kongtext.regular.ttf) format('truetype')}", 0);
54+
document.styleSheets[0].insertRule("@font-face {font-family: 'BPdots'; src: url(/fonts/bpdots.regular.otf) format('opentype')}", 1);
5555
loadFonts(['Kongtext', 'BPdots']);
5656
`);
5757
if (browser.browserType().name() === 'firefox') {
@@ -63,8 +63,8 @@ test.describe('WebFontsAddon', () => {
6363
test('FontFace hashing', async () => {
6464
// multiple calls of `loadFonts` with the same objects shall not bloat document.fonts
6565
await ctx.page.evaluate(`
66-
const ff1 = new FontFace('Kongtext', "url(/kongtext.regular.ttf) format('truetype')");
67-
const ff2 = new FontFace('BPdots', "url(/bpdots.regular.otf) format('opentype')");
66+
const ff1 = new FontFace('Kongtext', "url(/fonts/kongtext.regular.ttf) format('truetype')");
67+
const ff2 = new FontFace('BPdots', "url(/fonts/bpdots.regular.otf) format('opentype')");
6868
loadFonts([ff1, ff2]);
6969
loadFonts([ff1, ff2]);
7070
loadFonts([ff1, ff2]).then(() => loadFonts([ff1, ff2]));
@@ -76,7 +76,7 @@ test.describe('WebFontsAddon', () => {
7676
// to make this test work, we exclude the default measurement char W (x57) by restricting unicode-range
7777
// now the browser will postpone font loading until codepoint is hit --> wrong glyph metrics on first usage
7878
const data = await ctx.page.evaluate(`
79-
document.styleSheets[0].insertRule("@font-face {font-family: Kongtext; src: url(/kongtext.regular.ttf) format('truetype'); unicode-range: U+00A0-00FF}", 0);
79+
document.styleSheets[0].insertRule("@font-face {font-family: Kongtext; src: url(/fonts/kongtext.regular.ttf) format('truetype'); unicode-range: U+00A0-00FF}", 0);
8080
`);
8181
deepStrictEqual(await getDocumentFonts(), [{ family: 'Kongtext', status: 'unloaded' }]);
8282

@@ -88,7 +88,11 @@ test.describe('WebFontsAddon', () => {
8888

8989
// safari loads the font, firefox & chrome dont
9090
if (browser.browserType().name() === 'webkit') {
91-
deepStrictEqual(await getDocumentFonts(), [{ family: 'Kongtext', status: 'loaded' }]);
91+
try {
92+
deepStrictEqual(await getDocumentFonts(), [{ family: 'Kongtext', status: 'loading' }]);
93+
} catch (e) {
94+
deepStrictEqual(await getDocumentFonts(), [{ family: 'Kongtext', status: 'loaded' }]);
95+
}
9296
} else {
9397
deepStrictEqual(await getDocumentFonts(), [{ family: 'Kongtext', status: 'unloaded' }]);
9498
}
@@ -103,7 +107,10 @@ test.describe('WebFontsAddon', () => {
103107
window.helperTerm.open(term.element);
104108
`);
105109
await timeout(100);
106-
deepStrictEqual(await getDocumentFonts(), [{ family: 'Kongtext', status: 'loaded' }]);
110+
if (browser.browserType().name() !== 'webkit') {
111+
// safari sometimes reports 'unloadeed'?
112+
deepStrictEqual(await getDocumentFonts(), [{ family: 'Kongtext', status: 'loaded' }]);
113+
}
107114

108115
// cleanup this messy test case
109116
await ctx.page.evaluate(`

addons/addon-webgl/src/WebglRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { createRenderDimensions } from 'browser/renderer/shared/RendererUtils';
3030

3131
export class WebglRenderer extends Disposable implements IRenderer {
3232
private _renderLayers: IRenderLayer[];
33-
private _cursorBlinkStateManager: MutableDisposable<CursorBlinkStateManager> = new MutableDisposable();
33+
private _cursorBlinkStateManager: MutableDisposable<CursorBlinkStateManager> = this._register(new MutableDisposable());
3434
private _textBlinkStateManager: TextBlinkStateManager;
3535
private _charAtlasDisposable = this._register(new MutableDisposable());
3636
private _charAtlas: ITextureAtlas | undefined;

addons/addon-webgl/test/WebglRenderer.test.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,29 @@ test.beforeAll(async ({ browser }) => {
1515
await openTerminal(ctx);
1616
ctxWrapper.value = ctx;
1717
await ctx.page.evaluate(`
18-
window.addon = new window.WebglAddon(true);
19-
window.term.loadAddon(window.addon);
18+
try {
19+
window.addon = new window.WebglAddon(true);
20+
window.term.loadAddon(window.addon);
21+
} catch (e) {}
2022
`);
2123
});
2224
test.afterAll(async () => await ctx.page.close());
2325

2426
test.describe('WebGL Renderer Integration Tests', async () => {
2527
// HACK: webgl2 is often not supported in headless firefox on Linux
2628
// https://github.com/microsoft/playwright/issues/11566
29+
// also disable safari due to #5852
2730
if (platform() === 'linux') {
28-
test.skip(({ browserName }) => browserName === 'firefox');
31+
test.skip(({ browserName }) => browserName === 'firefox' || browserName === 'webkit');
2932
}
3033

3134
injectSharedRendererTests(ctxWrapper);
3235
injectSharedRendererTestsStandalone(ctxWrapper, async () => {
3336
await ctx.page.evaluate(`
34-
window.addon = new window.WebglAddon(true);
35-
window.term.loadAddon(window.addon);
37+
try {
38+
window.addon = new window.WebglAddon(true);
39+
window.term.loadAddon(window.addon);
40+
} catch (e) {}
3641
`);
3742
});
3843
});

addons/addon-webgl/test/playwright.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ const config: PlaywrightTestConfig = {
77
{
88
name: 'Chromium',
99
use: {
10-
browserName: 'chromium'
10+
browserName: 'chromium',
11+
launchOptions: {
12+
args: ['--enable-unsafe-swiftshader']
13+
}
1114
}
1215
},
1316
{

package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/browser/decorations/OverviewRulerRenderer.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ export class OverviewRulerRenderer extends Disposable {
9494
this._register(this._coreBrowserService.onDprChange(() => this._queueRefresh(true)));
9595
this._register(this._optionsService.onSpecificOptionChange('scrollbar', () => this._queueRefresh(true)));
9696
this._register(this._themeService.onChangeColors(() => this._queueRefresh()));
97+
this._register(toDisposable(() => {
98+
if (this._animationFrame !== undefined) {
99+
this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame);
100+
this._animationFrame = undefined;
101+
}
102+
}));
97103
this._queueRefresh(true);
98104
}
99105

@@ -136,6 +142,9 @@ export class OverviewRulerRenderer extends Disposable {
136142
}
137143

138144
private _refreshCanvasDimensions(): void {
145+
if (this._store.isDisposed || !this._renderService.hasRenderer()) {
146+
return;
147+
}
139148
const cssCanvasHeight = this._renderService.dimensions.css.canvas.height;
140149
const deviceCanvasHeight = this._renderService.dimensions.device.canvas.height;
141150
this._canvas.style.width = `${this._width}px`;
@@ -147,6 +156,9 @@ export class OverviewRulerRenderer extends Disposable {
147156
}
148157

149158
private _refreshDecorations(): void {
159+
if (this._store.isDisposed || !this._renderService.hasRenderer()) {
160+
return;
161+
}
150162
if (this._shouldUpdateDimensions) {
151163
this._refreshCanvasDimensions();
152164
}
@@ -200,13 +212,18 @@ export class OverviewRulerRenderer extends Disposable {
200212
}
201213

202214
private _queueRefresh(updateCanvasDimensions?: boolean, updateAnchor?: boolean): void {
215+
if (this._store.isDisposed) {
216+
return;
217+
}
203218
this._shouldUpdateDimensions = updateCanvasDimensions || this._shouldUpdateDimensions;
204219
this._shouldUpdateAnchor = updateAnchor || this._shouldUpdateAnchor;
205220
if (this._animationFrame !== undefined) {
206221
return;
207222
}
208223
this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
209-
this._refreshDecorations();
224+
if (!this._store.isDisposed) {
225+
this._refreshDecorations();
226+
}
210227
this._animationFrame = undefined;
211228
});
212229
}

src/browser/services/RenderService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class RenderService extends Disposable implements IRenderService {
6868
) {
6969
super();
7070

71-
this._pausedResizeTask = new DebouncedIdleTask(this._logService);
71+
this._pausedResizeTask = this._register(new DebouncedIdleTask(this._logService));
7272

7373
this._renderDebouncer = new RenderDebouncer((start, end) => this._renderRows(start, end), this._coreBrowserService);
7474
this._register(this._renderDebouncer);

src/common/TaskQueue.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,8 @@ export class DebouncedIdleTask {
168168
public flush(): void {
169169
this._queue.flush();
170170
}
171+
172+
public dispose(): void {
173+
this._queue.clear();
174+
}
171175
}

0 commit comments

Comments
 (0)