mirror of
https://github.com/RGBCube/serenity
synced 2025-07-13 22:17:36 +00:00

With this change, a stacking context can be established by any paintable, including inline paintables. The stacking context traversal is updated to remove the assumption that the stacking context root is paintable box.
38 lines
896 B
C++
38 lines
896 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Layout/InlineNode.h>
|
|
#include <LibWeb/Painting/PaintableBox.h>
|
|
|
|
namespace Web::Painting {
|
|
|
|
class InlinePaintable final : public Paintable {
|
|
JS_CELL(InlinePaintable, Paintable);
|
|
|
|
public:
|
|
static JS::NonnullGCPtr<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(); }
|
|
|
|
CSSPixelRect bounding_rect() const;
|
|
|
|
virtual bool is_inline_paintable() const override { return true; }
|
|
|
|
void mark_contained_fragments();
|
|
|
|
private:
|
|
InlinePaintable(Layout::InlineNode const&);
|
|
|
|
template<typename Callback>
|
|
void for_each_fragment(Callback) const;
|
|
};
|
|
|
|
}
|