HTMLDocument.cpp 809 B

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