Skip to content

Truly independent web browser

912 B
Raw Blame
/*
 * Copyright (c) 2023, Andreas Kling <[email protected]>
 *
 * 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 WEB_API HTMLDocument final : public DOM::Document {
    WEB_WRAPPABLE(HTMLDocument, DOM::Document);
    GC_DECLARE_ALLOCATOR(HTMLDocument);

public:
    virtual ~HTMLDocument() override;

    [[nodiscard]] static GC::Ref<HTMLDocument> create(Page&, GC::Ref<DOM::EventTarget> relevant_global_event_target, URL::URL const& url = URL::about_blank());

private:
    HTMLDocument(Page&, GC::Ref<DOM::EventTarget> relevant_global_event_target, URL::URL const&);
};

}