mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-21 15:14:13 +00: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:
@@ -301,16 +301,16 @@ private:
|
||||
|
||||
int index = 0;
|
||||
|
||||
String css;
|
||||
StringView css;
|
||||
};
|
||||
|
||||
NonnullRefPtr<StyleSheet> parse_css(const String& css)
|
||||
NonnullRefPtr<StyleSheet> parse_css(const StringView& css)
|
||||
{
|
||||
CSSParser parser(css);
|
||||
return parser.parse_sheet();
|
||||
}
|
||||
|
||||
NonnullRefPtr<StyleDeclaration> parse_css_declaration(const String& css)
|
||||
NonnullRefPtr<StyleDeclaration> parse_css_declaration(const StringView& css)
|
||||
{
|
||||
CSSParser parser(css);
|
||||
return parser.parse_standalone_declaration();
|
||||
|
||||
Reference in New Issue
Block a user