mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-09 00:22:36 +02:00
LibHTML: Make the CSS and HTML parsers take StringViews
This allows us to avoid unnecessary making unnecessary String copies of all the source text.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 11:45:37 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/edbf09ea296
@@ -57,7 +57,7 @@ static bool is_valid_in_attribute_name(char ch)
|
||||
return isalnum(ch) || ch == '_' || ch == '-';
|
||||
}
|
||||
|
||||
static bool is_self_closing_tag(const String& tag_name)
|
||||
static bool is_self_closing_tag(const StringView& tag_name)
|
||||
{
|
||||
return tag_name == "area"
|
||||
|| tag_name == "base"
|
||||
@@ -75,7 +75,7 @@ static bool is_self_closing_tag(const String& tag_name)
|
||||
|| tag_name == "wbr";
|
||||
}
|
||||
|
||||
NonnullRefPtr<Document> parse_html(const String& html, const URL& url)
|
||||
NonnullRefPtr<Document> parse_html(const StringView& html, const URL& url)
|
||||
{
|
||||
NonnullRefPtrVector<ParentNode> node_stack;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user