mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Make namespace attributes writable and configurable by default
This matches the prototype attributes. Used by https://chatgpt.com/, where it runs this code: ```js CSS.supports('animation-timeline: --works') ``` If this returns false, it will attempt to polyfill Animation Timeline and override CSS.supports to support Animation Timeline properties.
This commit is contained in:
parent
ccb513abf7
commit
f1801fb1d2
Notes:
github-actions[bot]
2025-02-07 14:37:03 +00:00
Author: https://github.com/Lubrsi
Commit: f1801fb1d2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3490
3 changed files with 102 additions and 2 deletions
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
"use strict";
|
||||
println("== CSS property descriptors");
|
||||
const cssNamespaceDescriptors = Object.getOwnPropertyDescriptors(CSS);
|
||||
const cssNamespaceKeys = Object.keys(cssNamespaceDescriptors);
|
||||
|
||||
for (const key of cssNamespaceKeys) {
|
||||
const descriptor = cssNamespaceDescriptors[key];
|
||||
println(`${key} writable: ${descriptor.writable}`);
|
||||
println(`${key} configurable: ${descriptor.configurable}`);
|
||||
println(`${key} enumerable: ${descriptor.enumerable}`);
|
||||
if (descriptor.writable) {
|
||||
println(`${key} value before: ${CSS[key]}`);
|
||||
CSS[key] = "replaced";
|
||||
println(`${key} value after: ${CSS[key]}`);
|
||||
}
|
||||
}
|
||||
|
||||
println("== WebAssembly property descriptors");
|
||||
const wasmNamespaceDescriptors = Object.getOwnPropertyDescriptors(WebAssembly);
|
||||
const wasmNamespaceKeys = Object.keys(wasmNamespaceDescriptors);
|
||||
|
||||
for (const key of wasmNamespaceKeys) {
|
||||
const descriptor = wasmNamespaceDescriptors[key];
|
||||
println(`${key} writable: ${descriptor.writable}`);
|
||||
println(`${key} configurable: ${descriptor.configurable}`);
|
||||
println(`${key} enumerable: ${descriptor.enumerable}`);
|
||||
if (descriptor.writable) {
|
||||
println(`${key} value before: ${WebAssembly[key]}`);
|
||||
WebAssembly[key] = "replaced";
|
||||
println(`${key} value after: ${WebAssembly[key]}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue