mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Implement more CSS serializers and make them more ergonomic
This implements these algorithms from the CSSOM-1 spec: - serialize a string - serialize a URL Also, we now have two versions of each of the serialization functions: One that returns a String as before, and the other that takes a StringBuilder to write into. This saves creating extra StringBuilders when they are not needed. :^)
This commit is contained in:
parent
5c1427f3e0
commit
75c9313d7d
Notes:
sideshowbarker
2024-07-18 02:18:27 +09:00
Author: https://github.com/AtkinsSJ
Commit: 75c9313d7d
Pull-request: https://github.com/SerenityOS/serenity/pull/10484
Reviewed-by: https://github.com/linusg ✅
2 changed files with 94 additions and 13 deletions
|
@ -7,13 +7,21 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/StringView.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
void escape_a_character(StringBuilder, u32 character);
|
||||
void escape_a_character_as_code_point(StringBuilder, u32 character);
|
||||
void serialize_an_identifier(StringBuilder, StringView const& ident);
|
||||
void serialize_a_string(StringBuilder, StringView const& string);
|
||||
void serialize_a_url(StringBuilder, StringView const& url);
|
||||
|
||||
String escape_a_character(u32 character);
|
||||
String escape_a_character_as_code_point(u32 character);
|
||||
|
||||
String serialize_an_identifier(StringView const& ident);
|
||||
String serialize_a_string(StringView const& string);
|
||||
String serialize_a_url(StringView const& url);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue