LibWeb: Draw text even if it needs to go into a 0-size inline box

This commit is contained in:
Psychpsyo 2025-05-11 14:05:41 +02:00 committed by Jelle Raaijmakers
commit 91159df0dd
Notes: github-actions[bot] 2025-05-12 08:50:46 +00:00
4 changed files with 5 additions and 4 deletions

View file

@ -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);
};

View file

@ -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,

View file

@ -0,0 +1,2 @@
<!DOCTYPE html>
<div style="line-height:100px; transform: translateY(-50px);">Hello!</div>

View file

@ -0,0 +1,3 @@
<!DOCTYPE html>
<link rel="match" href="../../expected/css/line-height-zero-ref.html">
<div style="line-height:0">Hello!</div>