1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:07:46 +00:00

LibWeb: Make CSSStyleDeclaration an abstract class

This patch moves the CSS property+value storage down to a new subclass
of CSSStyleDeclaration called PropertyOwningCSSStyleDeclaration.

The JavaScript wrapper for CSSStyleDeclaration now calls virtual
functions on the C++ object.

This is preparation for supporting computed style CSSStyleDeclaration
objects which won't have internal property storage, but rather an
internal element pointer. :^)
This commit is contained in:
Andreas Kling 2021-09-12 19:24:01 +02:00
parent 10679b6df2
commit 0bcab60463
9 changed files with 106 additions and 69 deletions

View file

@ -192,7 +192,7 @@ NonnullRefPtr<CSS::CSSStyleDeclaration> Window::get_computed_style(DOM::Element&
dbgln("Generating CSS computed style for {} @ {:p}", element.node_name(), &element);
Vector<CSS::StyleProperty> properties;
HashMap<String, CSS::StyleProperty> custom_properties;
return CSS::CSSStyleDeclaration::create(move(properties), move(custom_properties));
return CSS::PropertyOwningCSSStyleDeclaration::create(move(properties), move(custom_properties));
}
NonnullRefPtr<CSS::MediaQueryList> Window::match_media(String media)