1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

LibWeb: Store custom properties in CSSStyleDeclaration

Keep them around when parsing and store them in the CSSStyleDeclaration
when done.
This commit is contained in:
Tobias Christiansen 2021-05-24 22:54:41 +02:00 committed by Linus Groh
parent f0c6160362
commit 0d7169b91a
3 changed files with 32 additions and 13 deletions

View file

@ -9,8 +9,9 @@
namespace Web::CSS {
CSSStyleDeclaration::CSSStyleDeclaration(Vector<StyleProperty>&& properties)
CSSStyleDeclaration::CSSStyleDeclaration(Vector<StyleProperty>&& properties, HashMap<String, StyleProperty>&& custom_properties)
: m_properties(move(properties))
, m_custom_properties(move(custom_properties))
{
}
@ -26,7 +27,7 @@ String CSSStyleDeclaration::item(size_t index) const
}
ElementInlineCSSStyleDeclaration::ElementInlineCSSStyleDeclaration(DOM::Element& element)
: CSSStyleDeclaration({})
: CSSStyleDeclaration({}, {})
, m_element(element.make_weak_ptr<DOM::Element>())
{
}