fix: corner smoothing feature gate crash (#47759)

* fix: corner smoothing feature gate crash

* Fix ElectronCornerSmoothing::CSSValueFromComputedStyleInternal
This commit is contained in:
Calvin
2025-07-16 09:39:17 -06:00
committed by GitHub
parent 67afc10b75
commit 389927dce8
8 changed files with 65 additions and 162 deletions

View File

@@ -51,19 +51,17 @@ Use the `system-ui` keyword to match the smoothness to the OS design language.
### Controlling availibility
This CSS rule can be disabled by setting [the `cornerSmoothingCSS` web preference](./structures/web-preferences.md) to `false`.
This CSS rule can be disabled using the Blink feature flag `ElectronCSSCornerSmoothing`.
```js
const myWindow = new BrowserWindow({
// [...]
webPreferences: {
enableCornerSmoothingCSS: false // Disables the `-electron-corner-smoothing` CSS rule
disableBlinkFeatures: 'ElectronCSSCornerSmoothing' // Disables the `-electron-corner-smoothing` CSS rule
}
})
```
The CSS rule will still parse, but will have no visual effect.
### Formal reference
* **Initial value**: `0%`

View File

@@ -149,7 +149,6 @@
`WebContents` when the preferred size changes. Default is `false`.
* `transparent` boolean (optional) - Whether to enable background transparency for the guest page. Default is `true`. **Note:** The guest page's text and background colors are derived from the [color scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme) of its root element. When transparency is enabled, the text color will still change accordingly but the background will remain transparent.
* `enableDeprecatedPaste` boolean (optional) _Deprecated_ - Whether to enable the `paste` [execCommand](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand). Default is `false`.
* `enableCornerSmoothingCSS` boolean (optional) _Experimental_ - Whether the [`-electron-corner-smoothing` CSS rule](../corner-smoothing-css.md) is enabled. Default is `true`.
[chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment
[runtime-enabled-features]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5