mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:37:46 +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:
parent
053766d79c
commit
aae356baf1
7 changed files with 184 additions and 126 deletions
30
Userland/Libraries/LibWeb/Painting/InlinePaintable.h
Normal file
30
Userland/Libraries/LibWeb/Painting/InlinePaintable.h
Normal 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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue