summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Christiansen <tobi@tobyase.de>2021-05-13 13:49:15 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-13 15:43:51 +0200
commitd1ed6bce5dbdf48c9c335018343899e0aeed8255 (patch)
tree310edda263cb4226e85611a5ac143d0c1814f431
parented0e7b53a56ac043cec60da327916f3b2523fa88 (diff)
downloadserenity-d1ed6bce5dbdf48c9c335018343899e0aeed8255.zip
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.
-rw-r--r--Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp4
1 files 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;