瀏覽代碼

LibWeb: Allow use of calculated property for line-height

Previously, calculated properties for line-heights were not being
calculated and were simply ignored.
martinfalisse 2 年之前
父節點
當前提交
d3b4a5fbdb
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Userland/Libraries/LibWeb/CSS/StyleProperties.cpp

+ 3 - 0
Userland/Libraries/LibWeb/CSS/StyleProperties.cpp

@@ -160,6 +160,9 @@ float StyleProperties::line_height(Layout::Node const& layout_node) const
         return Length(percentage.as_fraction(), Length::Type::Em).to_px(layout_node);
     }
 
+    if (line_height->is_calculated())
+        return CSS::Length::make_calculated(line_height->as_calculated()).to_px(layout_node);
+
     return layout_node.font().pixel_metrics().line_spacing();
 }