InlineNode.cpp 841 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #include <LibWeb/DOM/Document.h>
  8. #include <LibWeb/DOM/Element.h>
  9. #include <LibWeb/Layout/BlockContainer.h>
  10. #include <LibWeb/Layout/InlineFormattingContext.h>
  11. #include <LibWeb/Layout/InlineNode.h>
  12. #include <LibWeb/Painting/InlinePaintable.h>
  13. namespace Web::Layout {
  14. JS_DEFINE_ALLOCATOR(InlineNode);
  15. InlineNode::InlineNode(DOM::Document& document, DOM::Element* element, NonnullRefPtr<CSS::StyleProperties> style)
  16. : Layout::NodeWithStyleAndBoxModelMetrics(document, element, move(style))
  17. {
  18. }
  19. InlineNode::~InlineNode() = default;
  20. JS::GCPtr<Painting::Paintable> InlineNode::create_paintable() const
  21. {
  22. return Painting::InlinePaintable::create(*this);
  23. }
  24. }