HTMLDocument.h 884 B

12345678910111213141516171819202122232425262728293031
  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. JS_CELL(HTMLDocument, DOM::Document);
  15. JS_DECLARE_ALLOCATOR(HTMLDocument);
  16. public:
  17. virtual ~HTMLDocument() override;
  18. [[nodiscard]] static JS::NonnullGCPtr<HTMLDocument> create(JS::Realm&, AK::URL const& url = "about:blank"sv);
  19. WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLDocument>> construct_impl(JS::Realm&);
  20. private:
  21. HTMLDocument(JS::Realm&, AK::URL const&);
  22. };
  23. }