mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 02:54:54 +03:00
e800605ad3
This URL library ends up being a relatively fundamental base library of the system, as LibCore depends on LibURL. This change has two main benefits: * Moving AK back more towards being an agnostic library that can be used between the kernel and userspace. URL has never really fit that description - and is not used in the kernel. * URL _should_ depend on LibUnicode, as it needs punnycode support. However, it's not really possible to do this inside of AK as it can't depend on any external library. This change brings us a little closer to being able to do that, but unfortunately we aren't there quite yet, as the code generators depend on LibCore.
34 lines
949 B
C++
34 lines
949 B
C++
/*
|
|
* Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* 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 {
|
|
WEB_PLATFORM_OBJECT(HTMLDocument, DOM::Document);
|
|
JS_DECLARE_ALLOCATOR(HTMLDocument);
|
|
|
|
public:
|
|
virtual ~HTMLDocument() override;
|
|
|
|
[[nodiscard]] static JS::NonnullGCPtr<HTMLDocument> create(JS::Realm&, URL::URL const& url = "about:blank"sv);
|
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLDocument>> construct_impl(JS::Realm&);
|
|
|
|
private:
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
HTMLDocument(JS::Realm&, URL::URL const&);
|
|
};
|
|
|
|
}
|