HTMLDocument.h 939 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/DOM/Document.h>
  8. namespace Web::HTML {
  9. // NOTE: This class is not currently in the specifications but it *is* implemented by all major browsers.
  10. // There is discussion about bringing it back:
  11. // https://github.com/whatwg/html/issues/4792
  12. // https://github.com/whatwg/dom/issues/221
  13. class HTMLDocument final : public DOM::Document {
  14. WEB_PLATFORM_OBJECT(HTMLDocument, DOM::Document);
  15. JS_DECLARE_ALLOCATOR(HTMLDocument);
  16. public:
  17. virtual ~HTMLDocument() override;
  18. [[nodiscard]] static JS::NonnullGCPtr<HTMLDocument> create(JS::Realm&, URL const& url = "about:blank"sv);
  19. WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLDocument>> construct_impl(JS::Realm&);
  20. private:
  21. virtual void initialize(JS::Realm&) override;
  22. HTMLDocument(JS::Realm&, URL const&);
  23. };
  24. }