LibWeb: Change HTMLParser's factory to accept the encoding as StringView

No need to force an allocation. This makes a future patch a bit simpler,
where we will have the encoding as a String. With this patch, we won't
have to convert it to a ByteString.
This commit is contained in:
Timothy Flynn 2024-04-03 21:56:58 -04:00 committed by Andreas Kling
commit 48fb343230
Notes: sideshowbarker 2024-07-17 05:18:58 +09:00
5 changed files with 8 additions and 8 deletions

View file

@ -51,7 +51,7 @@ public:
static JS::NonnullGCPtr<HTMLParser> create_for_scripting(DOM::Document&);
static JS::NonnullGCPtr<HTMLParser> create_with_uncertain_encoding(DOM::Document&, ByteBuffer const& input);
static JS::NonnullGCPtr<HTMLParser> create(DOM::Document&, StringView input, ByteString const& encoding);
static JS::NonnullGCPtr<HTMLParser> 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;