AK+LibJS+LibWeb+LibRegex: Replace AK::Utf16Data with AK::Utf16String

This commit is contained in:
Timothy Flynn 2025-07-09 14:13:38 -04:00 committed by Tim Flynn
commit 9582895759
Notes: github-actions[bot] 2025-07-18 16:46:53 +00:00
22 changed files with 101 additions and 222 deletions

View file

@ -48,8 +48,8 @@ ByteString SVGTextContentElement::text_contents() const
// https://svgwg.org/svg2-draft/text.html#__svg__SVGTextContentElement__getNumberOfChars
WebIDL::ExceptionOr<WebIDL::Long> SVGTextContentElement::get_number_of_chars() const
{
auto chars = TRY_OR_THROW_OOM(vm(), utf8_to_utf16(text_contents())).data;
return static_cast<WebIDL::Long>(chars.size());
auto length_in_code_units = AK::utf16_code_unit_length_from_utf8(text_contents());
return static_cast<WebIDL::Long>(length_in_code_units);
}
GC::Ref<Geometry::DOMPoint> SVGTextContentElement::get_start_position_of_char(WebIDL::UnsignedLong charnum)