HTMLBRElement.cpp 832 B

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