InlinePaintable.h 745 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Layout/InlineNode.h>
  8. #include <LibWeb/Painting/PaintableBox.h>
  9. namespace Web::Painting {
  10. class InlinePaintable final : public Paintable {
  11. JS_CELL(InlinePaintable, Paintable);
  12. public:
  13. static JS::NonnullGCPtr<InlinePaintable> create(Layout::InlineNode const&);
  14. virtual void paint(PaintContext&, PaintPhase) const override;
  15. Layout::InlineNode const& layout_node() const;
  16. auto const& box_model() const { return layout_node().box_model(); }
  17. private:
  18. InlinePaintable(Layout::InlineNode const&);
  19. template<typename Callback>
  20. void for_each_fragment(Callback) const;
  21. };
  22. }