1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:17:45 +00:00

LibWeb: Port inline elements to the new Paintable system

This patch adds InlinePaintable which corresponds to Layout::InlineNode.
This commit is contained in:
Andreas Kling 2022-03-10 15:38:34 +01:00
parent 053766d79c
commit aae356baf1
7 changed files with 184 additions and 126 deletions

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Layout/InlineNode.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Painting {
class InlinePaintable final : public Paintable {
public:
static NonnullOwnPtr<InlinePaintable> create(Layout::InlineNode const&);
virtual void paint(PaintContext&, PaintPhase) const override;
Layout::InlineNode const& layout_node() const;
auto const& box_model() const { return layout_node().box_model(); }
private:
InlinePaintable(Layout::InlineNode const&);
template<typename Callback>
void for_each_fragment(Callback) const;
};
}