HTMLBRElement.cpp 811 B

123456789101112131415161718192021222324252627282930313233
  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. JS_DEFINE_ALLOCATOR(HTMLBRElement);
  11. HTMLBRElement::HTMLBRElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  12. : HTMLElement(document, move(qualified_name))
  13. {
  14. }
  15. HTMLBRElement::~HTMLBRElement() = default;
  16. void HTMLBRElement::initialize(JS::Realm& realm)
  17. {
  18. Base::initialize(realm);
  19. WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLBRElement);
  20. }
  21. JS::GCPtr<Layout::Node> HTMLBRElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
  22. {
  23. return heap().allocate_without_realm<Layout::BreakNode>(document(), *this, move(style));
  24. }
  25. }