mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
LibWeb: Make CSSStyleDeclaration GC-allocated
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 07:28:59 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/72bacba97b Pull-request: https://github.com/SerenityOS/serenity/pull/14816 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg ✅
@@ -19,8 +19,15 @@
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
ResolvedCSSStyleDeclaration* ResolvedCSSStyleDeclaration::create(DOM::Element& element)
|
||||
{
|
||||
auto& window_object = element.document().preferred_window_object();
|
||||
return window_object.heap().allocate<ResolvedCSSStyleDeclaration>(window_object.realm(), element);
|
||||
}
|
||||
|
||||
ResolvedCSSStyleDeclaration::ResolvedCSSStyleDeclaration(DOM::Element& element)
|
||||
: m_element(element)
|
||||
: CSSStyleDeclaration(element.document().preferred_window_object())
|
||||
, m_element(element)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user