diff --git a/Tests/LibWeb/Ref/reference/images/text-decorations.png b/Tests/LibWeb/Ref/reference/images/text-decorations.png
new file mode 100644
index 0000000000..6bcb8a514b
Binary files /dev/null and b/Tests/LibWeb/Ref/reference/images/text-decorations.png differ
diff --git a/Tests/LibWeb/Ref/reference/text-decorations-ref.html b/Tests/LibWeb/Ref/reference/text-decorations-ref.html
new file mode 100644
index 0000000000..340055c73b
--- /dev/null
+++ b/Tests/LibWeb/Ref/reference/text-decorations-ref.html
@@ -0,0 +1,9 @@
+
+
diff --git a/Tests/LibWeb/Ref/text-decorations.html b/Tests/LibWeb/Ref/text-decorations.html
new file mode 100644
index 0000000000..b69830f702
--- /dev/null
+++ b/Tests/LibWeb/Ref/text-decorations.html
@@ -0,0 +1,39 @@
+
+
+
Hello
+Hello
+Hello
+Hello
+Hello
+ + diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp index 66b697d889..085a4df13b 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -505,7 +505,7 @@ void paint_text_decoration(PaintContext& context, Layout::Node const& text_node, auto& font = fragment.layout_node().first_available_font(); auto fragment_box = fragment.absolute_rect(); CSSPixels glyph_height = CSSPixels::nearest_value_for(font.pixel_size()); - auto baseline = fragment_box.height() / 2 - (glyph_height + 4) / 2 + glyph_height; + auto baseline = fragment.baseline(); auto line_color = text_node.computed_values().text_decoration_color();