Skip to content

Commit 93ced5a

Browse files
committed
Stop passing font size to DevTools
Fixes #5406
1 parent a388b01 commit 93ced5a

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed

src/extension/sdk/dev_tools/embedded_view.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ function getTheme() {
1616
const isDarkMode = !document.body.classList.contains('vscode-light');
1717
const backgroundColor = currentBackgroundColor = getComputedStyle(document.documentElement).getPropertyValue('--vscode-editor-background');
1818
const foregroundColor = getComputedStyle(document.documentElement).getPropertyValue('--vscode-editor-foreground');
19-
const fontSizeWithUnits = getComputedStyle(document.documentElement).getPropertyValue('--vscode-editor-font-size');
20-
const fontSize = fontSizeWithUnits && fontSizeWithUnits.endsWith('px') ? parseFloat(fontSizeWithUnits) : undefined;
2119
2220
return {
2321
isDarkMode: isDarkMode,
2422
backgroundColor: backgroundColor,
2523
foregroundColor: foregroundColor,
26-
fontSize: fontSize,
2724
};
2825
}
2926
@@ -45,9 +42,6 @@ window.addEventListener('message', (event) => {
4542
// Don't include # in colors
4643
// https://github.com/flutter/flutter/issues/155992
4744
let url = \`\${message.url}&theme=\${themeKind}&backgroundColor=\${encodeURIComponent(theme.backgroundColor?.replace('#', ''))}&foregroundColor=\${encodeURIComponent(theme.foregroundColor?.replace('#', ''))}\`;
48-
if (theme.fontSize) {
49-
url += \`&fontSize=\${encodeURIComponent(theme.fontSize)}\`;
50-
}
5145
if (devToolsFrame.src !== url) {
5246
devToolsFrame.src = url;
5347
vscode.setState({ frameUrl: url });

src/extension/views/devtools/base_view_provider.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,11 @@ export abstract class MyBaseWebViewProvider implements vs.WebviewViewProvider {
6060
const isDarkMode = !document.body.classList.contains('vscode-light');
6161
const backgroundColor = currentBackgroundColor = getComputedStyle(document.documentElement).getPropertyValue('--vscode-sideBar-background');
6262
const foregroundColor = getComputedStyle(document.documentElement).getPropertyValue('--vscode-sideBar-foreground');
63-
const fontSizeWithUnits = getComputedStyle(document.documentElement).getPropertyValue('--vscode-editor-font-size');
64-
const fontSize = fontSizeWithUnits && fontSizeWithUnits.endsWith('px') ? parseFloat(fontSizeWithUnits) : undefined;
6563
6664
return {
6765
isDarkMode: isDarkMode,
6866
backgroundColor: backgroundColor,
6967
foregroundColor: foregroundColor,
70-
fontSize: fontSize,
7168
};
7269
}
7370
@@ -86,10 +83,6 @@ export abstract class MyBaseWebViewProvider implements vs.WebviewViewProvider {
8683
// Don't include # in colors
8784
// https://github.com/flutter/flutter/issues/155992
8885
let url = \`\${message.url}\${qsSep}${embedFlags}&theme=\${theme}&backgroundColor=\${encodeURIComponent(background?.replace('#', ''))}&foregroundColor=\${encodeURIComponent(foreground?.replace('#', ''))}\`;
89-
const fontSizeWithUnits = getComputedStyle(document.documentElement).getPropertyValue('--vscode-editor-font-size');
90-
if (fontSizeWithUnits && fontSizeWithUnits.endsWith('px')) {
91-
url += \`&fontSize=\${encodeURIComponent(parseFloat(fontSizeWithUnits))}\`;
92-
}
9386
if (devToolsFrame.src !== url)
9487
devToolsFrame.src = url;
9588
return;

src/extension/views/devtools/legacy_post_message_sidebar/sidebar.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ class MyWebViewProvider implements vs.WebviewViewProvider, IAmDisposable {
7575
// Don't include # in colors
7676
// https://github.com/flutter/flutter/issues/155992
7777
let url = \`\${currentBaseUrl}\${qsSep}${embedFlags}&theme=\${theme}&backgroundColor=\${encodeURIComponent(background?.replace('#', ''))}&foregroundColor=\${encodeURIComponent(foreground?.replace('#', ''))}\`;
78-
const fontSizeWithUnits = getComputedStyle(document.documentElement).getPropertyValue('--vscode-editor-font-size');
79-
if (fontSizeWithUnits && fontSizeWithUnits.endsWith('px')) {
80-
url += \`&fontSize=\${encodeURIComponent(parseFloat(fontSizeWithUnits))}\`;
81-
}
8278
if (devToolsFrame.src !== url)
8379
devToolsFrame.src = url;
8480
}

0 commit comments

Comments
 (0)