mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-22 16:09:23 +00:00
LibWeb: Port SVGFormattingContext to UTF-16
This commit is contained in:
parent
d893d3234d
commit
04d32deb52
Notes:
github-actions[bot]
2025-08-05 13:14:54 +00:00
Author: https://github.com/trflynn89
Commit: 04d32deb52
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5720
Reviewed-by: https://github.com/gmta ✅
3 changed files with 7 additions and 10 deletions
|
@ -40,16 +40,15 @@ Optional<TextAnchor> SVGTextContentElement::text_anchor() const
|
|||
}
|
||||
}
|
||||
|
||||
ByteString SVGTextContentElement::text_contents() const
|
||||
Utf16String SVGTextContentElement::text_contents() const
|
||||
{
|
||||
return child_text_content().to_byte_string().trim_whitespace();
|
||||
return child_text_content().trim_ascii_whitespace();
|
||||
}
|
||||
|
||||
// https://svgwg.org/svg2-draft/text.html#__svg__SVGTextContentElement__getNumberOfChars
|
||||
WebIDL::ExceptionOr<WebIDL::Long> SVGTextContentElement::get_number_of_chars() const
|
||||
{
|
||||
auto length_in_code_units = AK::utf16_code_unit_length_from_utf8(text_contents());
|
||||
return static_cast<WebIDL::Long>(length_in_code_units);
|
||||
return static_cast<WebIDL::Long>(text_contents().length_in_code_units());
|
||||
}
|
||||
|
||||
GC::Ref<Geometry::DOMPoint> SVGTextContentElement::get_start_position_of_char(WebIDL::UnsignedLong charnum)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue