HTMLDocument.cpp 782 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/HTML/HTMLDocument.h>
  7. namespace Web::HTML {
  8. JS_DEFINE_ALLOCATOR(HTMLDocument);
  9. HTMLDocument::HTMLDocument(JS::Realm& realm, URL const& url)
  10. : Document(realm, url)
  11. {
  12. }
  13. HTMLDocument::~HTMLDocument() = default;
  14. WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLDocument>> HTMLDocument::construct_impl(JS::Realm& realm)
  15. {
  16. return HTMLDocument::create(realm);
  17. }
  18. JS::NonnullGCPtr<HTMLDocument> HTMLDocument::create(JS::Realm& realm, URL const& url)
  19. {
  20. return realm.heap().allocate<HTMLDocument>(realm, realm, url);
  21. }
  22. void HTMLDocument::initialize(JS::Realm& realm)
  23. {
  24. Base::initialize(realm);
  25. WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLDocument);
  26. }
  27. }