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:
Luke Wilde 2025-02-06 19:45:52 +00:00 committed by Andreas Kling
commit f1801fb1d2
Notes: github-actions[bot] 2025-02-07 14:37:03 +00:00
3 changed files with 102 additions and 2 deletions

View file

@ -1,7 +1,7 @@
/*
* Copyright (c) 2020-2023, Andreas Kling <andreas@ladybird.org>
* Copyright (c) 2021-2023, Linus Groh <linusg@serenityos.org>
* Copyright (c) 2021-2023, Luke Wilde <lukew@serenityos.org>
* Copyright (c) 2021-2025, Luke Wilde <luke@ladybird.org>
* Copyright (c) 2022, Ali Mohammad Pur <mpfard@serenityos.org>
* Copyright (c) 2023-2024, Kenneth Myhra <kennethmyhra@serenityos.org>
* Copyright (c) 2023-2025, Shannon Booth <shannon@serenityos.org>
@ -4523,7 +4523,7 @@ GC_DEFINE_ALLOCATOR(@namespace_class@);
void @namespace_class@::initialize(JS::Realm& realm)
{
[[maybe_unused]] auto& vm = this->vm();
[[maybe_unused]] u8 default_attributes = JS::Attribute::Enumerable;
[[maybe_unused]] u8 default_attributes = JS::Attribute::Enumerable | JS::Attribute::Configurable | JS::Attribute::Writable;
Base::initialize(realm);