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

LibWeb: Resolve Lengths to CSSPixels

This commit is contained in:
Sam Atkins 2022-11-08 17:29:52 +00:00 committed by Linus Groh
parent 7d40e3eb0d
commit 8cc0bdf777
13 changed files with 44 additions and 44 deletions

View file

@ -236,7 +236,7 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
// m_font is used by Length::to_px() when resolving sizes against this layout node.
// That's why it has to be set before everything else.
m_font = computed_style.computed_font();
computed_values.set_font_size(computed_style.property(CSS::PropertyID::FontSize)->to_length().to_px(*this));
computed_values.set_font_size(computed_style.property(CSS::PropertyID::FontSize)->to_length().to_px(*this).value());
computed_values.set_font_weight(computed_style.property(CSS::PropertyID::FontWeight)->to_integer());
m_line_height = computed_style.line_height(*this);
@ -555,9 +555,9 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
auto resolve_border_width = [&]() {
auto value = computed_style.property(width_property);
if (value->is_calculated())
return CSS::Length::make_calculated(value->as_calculated()).to_px(*this);
return CSS::Length::make_calculated(value->as_calculated()).to_px(*this).value();
if (value->has_length())
return value->to_length().to_px(*this);
return value->to_length().to_px(*this).value();
if (value->is_identifier()) {
// FIXME: These values should depend on something, e.g. a font size.
switch (value->to_identifier()) {