From 91159df0dd87d8a8bd32fd945c4b2c95ae2f1e33 Mon Sep 17 00:00:00 2001 From: Psychpsyo Date: Sun, 11 May 2025 14:05:41 +0200 Subject: [PATCH] LibWeb: Draw text even if it needs to go into a 0-size inline box --- Libraries/LibWeb/Painting/Command.h | 2 -- Libraries/LibWeb/Painting/DisplayListRecorder.cpp | 2 -- Tests/LibWeb/Ref/expected/css/line-height-zero-ref.html | 2 ++ Tests/LibWeb/Ref/input/css/line-height-zero.html | 3 +++ 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 Tests/LibWeb/Ref/expected/css/line-height-zero-ref.html create mode 100644 Tests/LibWeb/Ref/input/css/line-height-zero.html diff --git a/Libraries/LibWeb/Painting/Command.h b/Libraries/LibWeb/Painting/Command.h index 25b6b0ea635..1ef3d21633c 100644 --- a/Libraries/LibWeb/Painting/Command.h +++ b/Libraries/LibWeb/Painting/Command.h @@ -46,8 +46,6 @@ struct DrawGlyphRun { Color color; Gfx::Orientation orientation { Gfx::Orientation::Horizontal }; - [[nodiscard]] Gfx::IntRect bounding_rect() const { return rect; } - void translate_by(Gfx::IntPoint const& offset); }; diff --git a/Libraries/LibWeb/Painting/DisplayListRecorder.cpp b/Libraries/LibWeb/Painting/DisplayListRecorder.cpp index 84c92c85e1f..16e3db62d55 100644 --- a/Libraries/LibWeb/Painting/DisplayListRecorder.cpp +++ b/Libraries/LibWeb/Painting/DisplayListRecorder.cpp @@ -253,8 +253,6 @@ void DisplayListRecorder::draw_text(Gfx::IntRect const& rect, String raw_text, G void DisplayListRecorder::draw_text_run(Gfx::FloatPoint baseline_start, Gfx::GlyphRun const& glyph_run, Color color, Gfx::IntRect const& rect, double scale, Orientation orientation) { - if (rect.is_empty()) - return; append(DrawGlyphRun { .glyph_run = glyph_run, .scale = scale, diff --git a/Tests/LibWeb/Ref/expected/css/line-height-zero-ref.html b/Tests/LibWeb/Ref/expected/css/line-height-zero-ref.html new file mode 100644 index 00000000000..a1519d8c292 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/css/line-height-zero-ref.html @@ -0,0 +1,2 @@ + +
Hello!
diff --git a/Tests/LibWeb/Ref/input/css/line-height-zero.html b/Tests/LibWeb/Ref/input/css/line-height-zero.html new file mode 100644 index 00000000000..54be98a05ae --- /dev/null +++ b/Tests/LibWeb/Ref/input/css/line-height-zero.html @@ -0,0 +1,3 @@ + + +
Hello!