mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 13:27:34 +00:00
LibWeb: Let Length::to_px(Layout::Node) be inline for absolute lengths
This commit is contained in:
parent
881e7fcee1
commit
b66033720a
2 changed files with 9 additions and 6 deletions
|
@ -166,7 +166,12 @@ public:
|
|||
|
||||
[[nodiscard]] CSSPixels to_px(ResolutionContext const&) const;
|
||||
|
||||
CSSPixels to_px(Layout::Node const&) const;
|
||||
[[nodiscard]] ALWAYS_INLINE CSSPixels to_px(Layout::Node const& node) const
|
||||
{
|
||||
if (is_absolute())
|
||||
return absolute_length_to_px();
|
||||
return to_px_slow_case(node);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE CSSPixels to_px(CSSPixelRect const& viewport_rect, FontMetrics const& font_metrics, FontMetrics const& root_font_metrics) const
|
||||
{
|
||||
|
@ -220,6 +225,8 @@ public:
|
|||
private:
|
||||
char const* unit_name() const;
|
||||
|
||||
[[nodiscard]] CSSPixels to_px_slow_case(Layout::Node const&) const;
|
||||
|
||||
Type m_type;
|
||||
double m_value { 0 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue