1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00
ladybird/Libraries/LibWeb/Painting/TextPaintable.h
Aliaksandr Kalenik 2e256d2eac LibWeb: Invalidate text-decoration-thickness as paint-only property
Fixes underinvalidation caused by resolving text-decoration-thickness
during layout commit, while this property can be invalidated
independently of layout.
2025-03-16 22:25:26 +01:00

38 lines
1.3 KiB
C++

/*
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Painting/PaintableBox.h>
namespace Web::Painting {
class TextPaintable final : public Paintable {
GC_CELL(TextPaintable, Paintable);
GC_DECLARE_ALLOCATOR(TextPaintable);
public:
static GC::Ref<TextPaintable> create(Layout::TextNode const&, String const& text_for_rendering);
Layout::TextNode const& layout_node() const { return static_cast<Layout::TextNode const&>(Paintable::layout_node()); }
virtual bool wants_mouse_events() const override;
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, CSSPixelPoint, unsigned button, unsigned modifiers) override;
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, CSSPixelPoint, unsigned button, unsigned modifiers) override;
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, CSSPixelPoint, unsigned button, unsigned modifiers) override;
String const& text_for_rendering() const { return m_text_for_rendering; }
private:
virtual bool is_text_paintable() const override { return true; }
TextPaintable(Layout::TextNode const&, String const& text_for_rendering);
String m_text_for_rendering;
};
}