From d1ed6bce5dbdf48c9c335018343899e0aeed8255 Mon Sep 17 00:00:00 2001 From: Tobias Christiansen Date: Thu, 13 May 2021 13:49:15 +0200 Subject: [PATCH] LibWeb: Fix off-by-one for alphabetical markers in
    s The ListItemMarker gets its index 1-based while the String::bijective_base_from expects its index to be 0-based. This patch adjusts the index passed around accordingly. --- Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp b/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp index e04e5a7b9f..3833755dad 100644 --- a/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp @@ -30,11 +30,11 @@ ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType break; case CSS::ListStyleType::LowerAlpha: case CSS::ListStyleType::LowerLatin: - m_text = String::bijective_base_from(m_index).to_lowercase(); + m_text = String::bijective_base_from(m_index - 1).to_lowercase(); break; case CSS::ListStyleType::UpperAlpha: case CSS::ListStyleType::UpperLatin: - m_text = String::bijective_base_from(m_index); + m_text = String::bijective_base_from(m_index - 1); break; case CSS::ListStyleType::None: break;