1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

LibWeb: Ensure inline CSS loaded from HTML is ElementInline

This commit changes inline CSS loaded from style attributes of HTML
elements to be loaded as CSS::ElementInlineCSSStyleDeclaration instead
of CSS::CSSStyleDeclaration, fixing a crash when the style of that
element is changed from JavaScript.
This commit is contained in:
DoubleNegation 2021-07-23 10:35:39 +02:00 committed by Andreas Kling
parent afcd053b68
commit 0fdfdbed9f
3 changed files with 14 additions and 2 deletions

View file

@ -32,6 +32,12 @@ ElementInlineCSSStyleDeclaration::ElementInlineCSSStyleDeclaration(DOM::Element&
{
}
ElementInlineCSSStyleDeclaration::ElementInlineCSSStyleDeclaration(DOM::Element& element, CSSStyleDeclaration& declaration)
: CSSStyleDeclaration(move(declaration.m_properties), move(declaration.m_custom_properties))
, m_element(element.make_weak_ptr<DOM::Element>())
{
}
ElementInlineCSSStyleDeclaration::~ElementInlineCSSStyleDeclaration()
{
}