HTMLDocument.h 844 B

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