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

LibWeb: Stub out a dummy window.getComputedStyle()

This just returns an empty CSSStyleDeclaration for now. The real thing
needs to be a live object that provides a view onto the computed style
of a given element. This is far from that, but it's something. :^)
This commit is contained in:
Andreas Kling 2021-09-11 00:33:30 +02:00
parent 1484980f8f
commit d69133e4ac
4 changed files with 33 additions and 0 deletions

View file

@ -187,4 +187,12 @@ Page const* Window::page() const
return associated_document().page();
}
NonnullRefPtr<CSS::CSSStyleDeclaration> Window::get_computed_style(DOM::Element& element) const
{
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));
}
}