|
@@ -93,9 +93,15 @@ public:
|
|
|
HTML
|
|
|
};
|
|
|
|
|
|
+ enum class TemporaryDocumentForFragmentParsing {
|
|
|
+ No,
|
|
|
+ Yes,
|
|
|
+ };
|
|
|
+
|
|
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> create_and_initialize(Type, String content_type, HTML::NavigationParams const&);
|
|
|
|
|
|
[[nodiscard]] static JS::NonnullGCPtr<Document> create(JS::Realm&, URL::URL const& url = "about:blank"sv);
|
|
|
+ [[nodiscard]] static JS::NonnullGCPtr<Document> create_for_fragment_parsing(JS::Realm&);
|
|
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> construct_impl(JS::Realm&);
|
|
|
virtual ~Document() override;
|
|
|
|
|
@@ -447,8 +453,7 @@ public:
|
|
|
void set_parser(Badge<HTML::HTMLParser>, HTML::HTMLParser&);
|
|
|
void detach_parser(Badge<HTML::HTMLParser>);
|
|
|
|
|
|
- void set_is_temporary_document_for_fragment_parsing(Badge<HTML::HTMLParser>) { m_temporary_document_for_fragment_parsing = true; }
|
|
|
- [[nodiscard]] bool is_temporary_document_for_fragment_parsing() const { return m_temporary_document_for_fragment_parsing; }
|
|
|
+ [[nodiscard]] bool is_temporary_document_for_fragment_parsing() const { return m_temporary_document_for_fragment_parsing == TemporaryDocumentForFragmentParsing::Yes; }
|
|
|
|
|
|
static bool is_valid_name(String const&);
|
|
|
|
|
@@ -684,7 +689,7 @@ protected:
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
|
|
virtual void finalize() override;
|
|
|
|
|
|
- Document(JS::Realm&, URL::URL const&);
|
|
|
+ Document(JS::Realm&, URL::URL const&, TemporaryDocumentForFragmentParsing = TemporaryDocumentForFragmentParsing::No);
|
|
|
|
|
|
private:
|
|
|
// ^HTML::GlobalEventHandlers
|
|
@@ -889,7 +894,7 @@ private:
|
|
|
|
|
|
RefPtr<Core::Timer> m_active_refresh_timer;
|
|
|
|
|
|
- bool m_temporary_document_for_fragment_parsing { false };
|
|
|
+ TemporaryDocumentForFragmentParsing m_temporary_document_for_fragment_parsing { TemporaryDocumentForFragmentParsing::No };
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#latest-entry
|
|
|
JS::GCPtr<HTML::SessionHistoryEntry> m_latest_entry;
|