mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 10:37:34 +00:00
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.
This commit is contained in:
parent
dadb92a155
commit
f53d0ddba2
1 changed files with 3 additions and 6 deletions
|
@ -13,8 +13,7 @@ bool CSSStyleDeclarationWrapper::internal_has_property(JS::PropertyName const& n
|
||||||
{
|
{
|
||||||
if (!name.is_string())
|
if (!name.is_string())
|
||||||
return Base::internal_has_property(name);
|
return Base::internal_has_property(name);
|
||||||
// FIXME: These should actually use camelCase versions of the property names!
|
auto property_id = CSS::property_id_from_camel_case_string(name.to_string());
|
||||||
auto property_id = CSS::property_id_from_string(name.to_string());
|
|
||||||
return property_id != CSS::PropertyID::Invalid;
|
return property_id != CSS::PropertyID::Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,8 +21,7 @@ JS::Value CSSStyleDeclarationWrapper::internal_get(JS::PropertyName const& name,
|
||||||
{
|
{
|
||||||
if (!name.is_string())
|
if (!name.is_string())
|
||||||
return Base::internal_get(name, receiver);
|
return Base::internal_get(name, receiver);
|
||||||
// FIXME: These should actually use camelCase versions of the property names!
|
auto property_id = CSS::property_id_from_camel_case_string(name.to_string());
|
||||||
auto property_id = CSS::property_id_from_string(name.to_string());
|
|
||||||
if (property_id == CSS::PropertyID::Invalid)
|
if (property_id == CSS::PropertyID::Invalid)
|
||||||
return Base::internal_get(name, receiver);
|
return Base::internal_get(name, receiver);
|
||||||
if (auto maybe_property = impl().property(property_id); maybe_property.has_value())
|
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())
|
if (!name.is_string())
|
||||||
return Base::internal_set(name, value, receiver);
|
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_camel_case_string(name.to_string());
|
||||||
auto property_id = CSS::property_id_from_string(name.to_string());
|
|
||||||
if (property_id == CSS::PropertyID::Invalid)
|
if (property_id == CSS::PropertyID::Invalid)
|
||||||
return Base::internal_set(name, value, receiver);
|
return Base::internal_set(name, value, receiver);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue