LibWeb: Expose barebones CSSStyleDeclaration to JavaScript

You can now access an element's inline style via Element.style.
The interface is not very capable yet though. :^)
This commit is contained in:
Andreas Kling 2021-03-13 22:39:55 +01:00
commit 33e3f0c71f
Notes: sideshowbarker 2024-07-18 21:23:52 +09:00
9 changed files with 43 additions and 2 deletions

View file

@ -37,4 +37,11 @@ CSSStyleDeclaration::~CSSStyleDeclaration()
{
}
String CSSStyleDeclaration::item(size_t index) const
{
if (index >= m_properties.size())
return {};
return CSS::string_from_property_id(m_properties[index].property_id);
}
}