mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibWeb: Resolve Lengths to CSSPixels
This commit is contained in:
parent
7d40e3eb0d
commit
8cc0bdf777
Notes:
sideshowbarker
2024-07-17 02:08:20 +09:00
Author: https://github.com/AtkinsSJ
Commit: 8cc0bdf777
Pull-request: https://github.com/SerenityOS/serenity/pull/16514
Reviewed-by: https://github.com/MacDue
Reviewed-by: https://github.com/linusg ✅
13 changed files with 44 additions and 44 deletions
|
@ -15,7 +15,6 @@
|
|||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/HTML/BrowsingContext.h>
|
||||
#include <LibWeb/HTML/HTMLHtmlElement.h>
|
||||
#include <LibWeb/PixelUnits.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
|
@ -71,7 +70,7 @@ Length Length::resolved(Layout::Node const& layout_node) const
|
|||
return *this;
|
||||
}
|
||||
|
||||
float Length::relative_length_to_px(Gfx::IntRect const& viewport_rect, Gfx::FontPixelMetrics const& font_metrics, float font_size, float root_font_size) const
|
||||
CSSPixels Length::relative_length_to_px(Gfx::IntRect const& viewport_rect, Gfx::FontPixelMetrics const& font_metrics, CSSPixels font_size, CSSPixels root_font_size) const
|
||||
{
|
||||
switch (m_type) {
|
||||
case Type::Ex:
|
||||
|
@ -96,7 +95,7 @@ float Length::relative_length_to_px(Gfx::IntRect const& viewport_rect, Gfx::Font
|
|||
}
|
||||
}
|
||||
|
||||
float Length::to_px(Layout::Node const& layout_node) const
|
||||
CSSPixels Length::to_px(Layout::Node const& layout_node) const
|
||||
{
|
||||
if (is_calculated())
|
||||
return m_calculated_style->resolve_length(layout_node)->to_px(layout_node);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue