HTMLBRElement.cpp 848 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2018-2021, Andreas Kling <andreas@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/HTMLBRElementPrototype.h>
  7. #include <LibWeb/DOM/Document.h>
  8. #include <LibWeb/HTML/HTMLBRElement.h>
  9. #include <LibWeb/Layout/BreakNode.h>
  10. namespace Web::HTML {
  11. JS_DEFINE_ALLOCATOR(HTMLBRElement);
  12. HTMLBRElement::HTMLBRElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  13. : HTMLElement(document, move(qualified_name))
  14. {
  15. }
  16. HTMLBRElement::~HTMLBRElement() = default;
  17. void HTMLBRElement::initialize(JS::Realm& realm)
  18. {
  19. Base::initialize(realm);
  20. WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLBRElement);
  21. }
  22. JS::GCPtr<Layout::Node> HTMLBRElement::create_layout_node(CSS::StyleProperties style)
  23. {
  24. return heap().allocate_without_realm<Layout::BreakNode>(document(), *this, move(style));
  25. }
  26. }