HTMLBRElement.cpp 707 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/DOM/Document.h>
  7. #include <LibWeb/HTML/HTMLBRElement.h>
  8. #include <LibWeb/Layout/BreakNode.h>
  9. namespace Web::HTML {
  10. HTMLBRElement::HTMLBRElement(DOM::Document& document, QualifiedName qualified_name)
  11. : HTMLElement(document, move(qualified_name))
  12. {
  13. }
  14. HTMLBRElement::~HTMLBRElement()
  15. {
  16. }
  17. RefPtr<Layout::Node> HTMLBRElement::create_layout_node()
  18. {
  19. auto style = document().style_computer().compute_style(*this);
  20. if (style->display() == CSS::Display::None)
  21. return nullptr;
  22. return adopt_ref(*new Layout::BreakNode(document(), *this, move(style)));
  23. }
  24. }