diff options
Diffstat (limited to 'Userland/Libraries/LibWeb')
3 files changed, 14 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp b/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp index d99d124cb5..15b9d29759 100644 --- a/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp +++ b/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp @@ -11,6 +11,13 @@ namespace Web::Bindings { +bool CSSStyleDeclarationWrapper::internal_has_property(JS::PropertyName const& name) const +{ + // FIXME: These should actually use camelCase versions of the property names! + auto property_id = CSS::property_id_from_string(name.to_string()); + return property_id != CSS::PropertyID::Invalid; +} + JS::Value CSSStyleDeclarationWrapper::internal_get(const JS::PropertyName& name, JS::Value receiver) const { // FIXME: These should actually use camelCase versions of the property names! diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.idl b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.idl index d4f425e9b4..987ae17337 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.idl +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.idl @@ -1,4 +1,4 @@ -[CustomGet,CustomSet] +[CustomGet,CustomSet,CustomHasProperty] interface CSSStyleDeclaration { readonly attribute unsigned long length; diff --git a/Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp b/Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp index a3cd0a03d0..f5067909b7 100644 --- a/Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp +++ b/Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp @@ -813,6 +813,12 @@ public: )~~~"); } + if (interface.extended_attributes.contains("CustomHasProperty")) { + generator.append(R"~~~( + virtual bool internal_has_property(JS::PropertyName const&) const override; +)~~~"); + } + if (interface.wrapper_base_class == "Wrapper") { generator.append(R"~~~( @fully_qualified_name@& impl() { return *m_impl; } |