diff --git a/Tests/LibWeb/Layout/expected/font-fractional-size.txt b/Tests/LibWeb/Layout/expected/font-fractional-size.txt
new file mode 100644
index 0000000000..67cb968952
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/font-fractional-size.txt
@@ -0,0 +1,35 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer at (0,0) content-size 800x39.46875 [BFC] children: not-inline
+ BlockContainer
at (8,8) content-size 784x23.46875 children: inline
+ line 0 width: 54.203125, height: 23.46875, bottom: 23.46875, baseline: 18.1875
+ frag 0 from TextNode start: 0, length: 1, rect: [8,8 12.4375x22.375]
+ "x"
+ frag 1 from TextNode start: 0, length: 1, rect: [20,12 8x17.46875]
+ " "
+ frag 2 from TextNode start: 0, length: 1, rect: [28,8 12.734375x22.921875]
+ "x"
+ frag 3 from TextNode start: 0, length: 1, rect: [41,12 8x17.46875]
+ " "
+ frag 4 from TextNode start: 0, length: 1, rect: [49,8 13.03125x23.46875]
+ "x"
+ InlineNode
+ TextNode <#text>
+ TextNode <#text>
+ InlineNode
+ TextNode <#text>
+ TextNode <#text>
+ InlineNode
+ TextNode <#text>
+ TextNode <#text>
+
+ViewportPaintable (Viewport<#document>) [0,0 800x600]
+ PaintableWithLines (BlockContainer) [0,0 800x39.46875]
+ PaintableWithLines (BlockContainer) [8,8 784x23.46875]
+ InlinePaintable (InlineNode.a)
+ TextPaintable (TextNode<#text>)
+ TextPaintable (TextNode<#text>)
+ InlinePaintable (InlineNode.b)
+ TextPaintable (TextNode<#text>)
+ TextPaintable (TextNode<#text>)
+ InlinePaintable (InlineNode.c)
+ TextPaintable (TextNode<#text>)
diff --git a/Tests/LibWeb/Layout/input/font-fractional-size.html b/Tests/LibWeb/Layout/input/font-fractional-size.html
new file mode 100644
index 0000000000..95f992e714
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/font-fractional-size.html
@@ -0,0 +1,8 @@
+
+x
+x
+x
diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
index 57bd633591..d6354134a5 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
@@ -2051,8 +2051,7 @@ RefPtr StyleComputer::compute_font_for_style_values(DOM::Elemen
maybe_length = font_size.as_calculated().resolve_length(length_resolution_context);
}
if (maybe_length.has_value()) {
- auto px = maybe_length.value().to_px(length_resolution_context).to_int();
- font_size_in_px = px;
+ font_size_in_px = maybe_length.value().to_px(length_resolution_context);
}
}