1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

LibWeb: Fix off-by-one for alphabetical markers in <ol>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.
This commit is contained in:
Tobias Christiansen 2021-05-13 13:49:15 +02:00 committed by Andreas Kling
parent ed0e7b53a5
commit d1ed6bce5d

View file

@ -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;