diff --git a/Userland/Libraries/LibWeb/DOM/DocumentLoading.cpp b/Userland/Libraries/LibWeb/DOM/DocumentLoading.cpp index 2354e82e670..bfa0826db72 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentLoading.cpp +++ b/Userland/Libraries/LibWeb/DOM/DocumentLoading.cpp @@ -77,7 +77,7 @@ static WebIDL::ExceptionOr> load_markdown_docume if (!markdown_document) return; - auto parser = HTML::HTMLParser::create(document, markdown_document->render_to_html(extra_head_contents), "utf-8"); + auto parser = HTML::HTMLParser::create(document, markdown_document->render_to_html(extra_head_contents), "utf-8"sv); parser->run(url); }; diff --git a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp index 6cf711d649e..d66b7641537 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp @@ -53,7 +53,7 @@ JS::NonnullGCPtr DOMParser::parse_from_string(StringView string, // 2. Create an HTML parser parser, associated with document. // 3. Place string into the input stream for parser. The encoding confidence is irrelevant. // FIXME: We don't have the concept of encoding confidence yet. - auto parser = HTMLParser::create(*document, string, "UTF-8"); + auto parser = HTMLParser::create(*document, string, "UTF-8"sv); // 4. Start parser and let it run until it has consumed all the characters just inserted into the input stream. // FIXME: This is to match the default URL. Instead, pass in this's relevant global object's associated Document's URL. diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp index 93e3f7728e9..31723cf732a 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp @@ -1127,7 +1127,7 @@ WebIDL::ExceptionOr Navigable::populate_session_history_entry_document( // FIXME: Add error message to generated error page auto error_html = load_error_page(entry->url()).release_value_but_fixme_should_propagate_errors(); entry->document_state()->set_document(create_document_for_inline_content(this, navigation_id, [error_html](auto& document) { - auto parser = HTML::HTMLParser::create(document, error_html, "utf-8"); + auto parser = HTML::HTMLParser::create(document, error_html, "utf-8"sv); document.set_url(URL::URL("about:error")); parser->run(); })); diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index 62901d05bbc..a3143c746ff 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -132,7 +132,7 @@ static bool is_html_integration_point(DOM::Element const& element) return false; } -HTMLParser::HTMLParser(DOM::Document& document, StringView input, ByteString const& encoding) +HTMLParser::HTMLParser(DOM::Document& document, StringView input, StringView encoding) : m_tokenizer(input, encoding) , m_scripting_enabled(document.is_scripting_enabled()) , m_document(JS::make_handle(document)) @@ -4144,7 +4144,7 @@ Vector> HTMLParser::parse_html_fragment(DOM::Element& cont temp_document->set_quirks_mode(context_element.document().mode()); // 3. Create a new HTML parser, and associate it with the just created Document node. - auto parser = HTMLParser::create(*temp_document, markup, "utf-8"); + auto parser = HTMLParser::create(*temp_document, markup, "utf-8"sv); parser->m_context_element = JS::make_handle(context_element); parser->m_parsing_fragment = true; @@ -4239,7 +4239,7 @@ JS::NonnullGCPtr HTMLParser::create_with_uncertain_encoding(DOM::Doc return document.heap().allocate_without_realm(document, input, encoding); } -JS::NonnullGCPtr HTMLParser::create(DOM::Document& document, StringView input, ByteString const& encoding) +JS::NonnullGCPtr HTMLParser::create(DOM::Document& document, StringView input, StringView encoding) { return document.heap().allocate_without_realm(document, input, encoding); } diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h index 9fcb3a0a74d..c170a6d2442 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h @@ -51,7 +51,7 @@ public: static JS::NonnullGCPtr create_for_scripting(DOM::Document&); static JS::NonnullGCPtr create_with_uncertain_encoding(DOM::Document&, ByteBuffer const& input); - static JS::NonnullGCPtr create(DOM::Document&, StringView input, ByteString const& encoding); + static JS::NonnullGCPtr create(DOM::Document&, StringView input, StringView encoding); void run(HTMLTokenizer::StopAtInsertionPoint = HTMLTokenizer::StopAtInsertionPoint::No); void run(const URL::URL&, HTMLTokenizer::StopAtInsertionPoint = HTMLTokenizer::StopAtInsertionPoint::No); @@ -84,7 +84,7 @@ public: size_t script_nesting_level() const { return m_script_nesting_level; } private: - HTMLParser(DOM::Document&, StringView input, ByteString const& encoding); + HTMLParser(DOM::Document&, StringView input, StringView encoding); HTMLParser(DOM::Document&); virtual void visit_edges(Cell::Visitor&) override;