mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +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
|
@ -148,17 +148,13 @@ CSSPixels Length::to_px(ResolutionContext const& context) const
|
|||
return to_px(context.viewport_rect, context.font_metrics, context.root_font_metrics);
|
||||
}
|
||||
|
||||
CSSPixels Length::to_px(Layout::Node const& layout_node) const
|
||||
CSSPixels Length::to_px_slow_case(Layout::Node const& layout_node) const
|
||||
{
|
||||
if (is_auto()) {
|
||||
// FIXME: We really, really shouldn't end up here, but we do, and so frequently that
|
||||
// adding a dbgln() here outputs a couple hundred lines loading `welcome.html`.
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_absolute())
|
||||
return absolute_length_to_px();
|
||||
|
||||
if (!layout_node.document().browsing_context())
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue