LibWeb: Migrate ListItemMarkerBox's text from ByteString to String

This commit is contained in:
Sam Atkins 2025-02-10 11:48:12 +00:00 committed by Andreas Kling
commit b987d53926
Notes: github-actions[bot] 2025-02-11 09:40:28 +00:00
5 changed files with 16 additions and 15 deletions

View file

@ -1210,12 +1210,12 @@ void BlockFormattingContext::ensure_sizes_correct_for_left_offset_calculation(Li
auto default_marker_width = max(4, marker.first_available_font().pixel_size_rounded_up() - 4);
auto marker_text = marker.text().value_or("");
auto marker_text = marker.text().value_or({});
if (marker_text.is_empty()) {
marker_state.set_content_width(image_width + default_marker_width);
} else {
// FIXME: Use per-code-point fonts to measure text.
auto text_width = marker.first_available_font().width(marker_text);
auto text_width = marker.first_available_font().width(marker_text.code_points());
marker_state.set_content_width(image_width + CSSPixels::nearest_value_for(text_width));
}