HTMLLabelElement.cpp 814 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/DOM/Document.h>
  7. #include <LibWeb/HTML/HTMLLabelElement.h>
  8. #include <LibWeb/Layout/Label.h>
  9. namespace Web::HTML {
  10. JS_DEFINE_ALLOCATOR(HTMLLabelElement);
  11. HTMLLabelElement::HTMLLabelElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  12. : HTMLElement(document, move(qualified_name))
  13. {
  14. }
  15. HTMLLabelElement::~HTMLLabelElement() = default;
  16. void HTMLLabelElement::initialize(JS::Realm& realm)
  17. {
  18. Base::initialize(realm);
  19. WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLLabelElement);
  20. }
  21. JS::GCPtr<Layout::Node> HTMLLabelElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
  22. {
  23. return heap().allocate_without_realm<Layout::Label>(document(), this, move(style));
  24. }
  25. }