From f53d0ddba202e9ff5f8ca2c31ff0f3a723450c55 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 29 Sep 2021 20:31:01 +0200 Subject: [PATCH] LibWeb: Make CSSStyleDeclaration.camelCaseProperty work :^) This resolves a long-standing FIXME about exposing CSS properties to JavaScript via "camelCase" names rather than "dash-separated" names. --- .../LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp b/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp index 66bd50f446..d00c808204 100644 --- a/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp +++ b/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp @@ -13,8 +13,7 @@ bool CSSStyleDeclarationWrapper::internal_has_property(JS::PropertyName const& n { if (!name.is_string()) return Base::internal_has_property(name); - // FIXME: These should actually use camelCase versions of the property names! - auto property_id = CSS::property_id_from_string(name.to_string()); + auto property_id = CSS::property_id_from_camel_case_string(name.to_string()); return property_id != CSS::PropertyID::Invalid; } @@ -22,8 +21,7 @@ JS::Value CSSStyleDeclarationWrapper::internal_get(JS::PropertyName const& name, { if (!name.is_string()) return Base::internal_get(name, receiver); - // FIXME: These should actually use camelCase versions of the property names! - auto property_id = CSS::property_id_from_string(name.to_string()); + auto property_id = CSS::property_id_from_camel_case_string(name.to_string()); if (property_id == CSS::PropertyID::Invalid) return Base::internal_get(name, receiver); if (auto maybe_property = impl().property(property_id); maybe_property.has_value()) @@ -35,8 +33,7 @@ bool CSSStyleDeclarationWrapper::internal_set(JS::PropertyName const& name, JS:: { if (!name.is_string()) return Base::internal_set(name, value, receiver); - // FIXME: These should actually use camelCase versions of the property names! - auto property_id = CSS::property_id_from_string(name.to_string()); + auto property_id = CSS::property_id_from_camel_case_string(name.to_string()); if (property_id == CSS::PropertyID::Invalid) return Base::internal_set(name, value, receiver);