2023-06-21 08:53:09 -03:00
|
|
|
/*
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2023, Andreas Kling <andreas@ladybird.org>
|
2023-06-21 08:53:09 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibWeb/DOM/Document.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
|
|
// NOTE: This class is not currently in the specifications but it *is* implemented by all major browsers.
|
|
|
|
|
// There is discussion about bringing it back:
|
|
|
|
|
// https://github.com/whatwg/html/issues/4792
|
|
|
|
|
// https://github.com/whatwg/dom/issues/221
|
|
|
|
|
class HTMLDocument final : public DOM::Document {
|
2024-03-09 16:57:15 -03:00
|
|
|
WEB_PLATFORM_OBJECT(HTMLDocument, DOM::Document);
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DECLARE_ALLOCATOR(HTMLDocument);
|
2023-06-21 08:53:09 -03:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual ~HTMLDocument() override;
|
|
|
|
|
|
2025-02-15 07:51:45 -03:00
|
|
|
[[nodiscard]] static GC::Ref<HTMLDocument> create(JS::Realm&, URL::URL const& url = URL::about_blank());
|
2024-11-14 12:01:23 -03:00
|
|
|
WebIDL::ExceptionOr<GC::Ref<HTMLDocument>> construct_impl(JS::Realm&);
|
2023-06-21 08:53:09 -03:00
|
|
|
|
|
|
|
|
private:
|
2024-03-09 16:57:15 -03:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
|
|
2024-03-18 00:22:27 -03:00
|
|
|
HTMLDocument(JS::Realm&, URL::URL const&);
|
2023-06-21 08:53:09 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|