mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +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
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