BlockContainer.cpp 886 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Layout/BlockContainer.h>
  7. #include <LibWeb/Painting/PaintableBox.h>
  8. namespace Web::Layout {
  9. BlockContainer::BlockContainer(DOM::Document& document, DOM::Node* node, NonnullRefPtr<CSS::StyleProperties> style)
  10. : Box(document, node, move(style))
  11. {
  12. }
  13. BlockContainer::BlockContainer(DOM::Document& document, DOM::Node* node, CSS::ComputedValues computed_values)
  14. : Box(document, node, move(computed_values))
  15. {
  16. }
  17. BlockContainer::~BlockContainer() = default;
  18. Painting::PaintableWithLines const* BlockContainer::paint_box() const
  19. {
  20. return static_cast<Painting::PaintableWithLines const*>(Box::paint_box());
  21. }
  22. JS::GCPtr<Painting::Paintable> BlockContainer::create_paintable() const
  23. {
  24. return Painting::PaintableWithLines::create(*this);
  25. }
  26. }