mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
LibWeb: Port CharacterData from DeprecatedString to String
The existing implementation has some pre-existing issues where it is incorrectly assumes that byte offsets are given through the IDL instead of UTF-16 code units. While making these changes, leave some FIXMEs for that.
This commit is contained in:
parent
3b12a13f17
commit
b603e860af
18 changed files with 87 additions and 81 deletions
|
@ -755,16 +755,16 @@ static WebIDL::ExceptionOr<DeprecatedString> serialize_text(DOM::Text const& tex
|
|||
// then throw an exception; the serialization of this node's data would not be well-formed.
|
||||
|
||||
// 2. Let markup be the value of node's data.
|
||||
DeprecatedString markup = text.data();
|
||||
auto markup = text.data();
|
||||
|
||||
// 3. Replace any occurrences of "&" in markup by "&".
|
||||
markup = markup.replace("&"sv, "&"sv, ReplaceMode::All);
|
||||
markup = MUST(markup.replace("&"sv, "&"sv, ReplaceMode::All));
|
||||
|
||||
// 4. Replace any occurrences of "<" in markup by "<".
|
||||
markup = markup.replace("<"sv, "<"sv, ReplaceMode::All);
|
||||
markup = MUST(markup.replace("<"sv, "<"sv, ReplaceMode::All));
|
||||
|
||||
// 5. Replace any occurrences of ">" in markup by ">".
|
||||
markup = markup.replace(">"sv, ">"sv, ReplaceMode::All);
|
||||
markup = MUST(markup.replace(">"sv, ">"sv, ReplaceMode::All));
|
||||
|
||||
// 6. Return the value of markup.
|
||||
return markup;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue