From 03e8407e405761e68549f5b2b61f27d096817441 Mon Sep 17 00:00:00 2001 From: Minseong Kim Date: Wed, 18 Feb 2026 22:36:17 +0900 Subject: [PATCH] [css-lists-3] Update algorithm for initial counter value in reversed list --- css-lists-3/Overview.bs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/css-lists-3/Overview.bs b/css-lists-3/Overview.bs index 4c51068fcf35..d360e743d91a 100644 --- a/css-lists-3/Overview.bs +++ b/css-lists-3/Overview.bs @@ -1148,7 +1148,7 @@ Instantiating Counters 1. Let |num| be 0. - 2. Let |first| be true. + 2. Let |lastNonZeroIncrementNegated| be 0. 3. For each element or pseudo-element |el| that increments or sets the same counter in the same [=scope=]: @@ -1156,9 +1156,8 @@ Instantiating Counters 1. Let |incrementNegated| be |el|'s 'counter-increment' integer value for this counter, multiplied by -1. - 2. If |first| is true, - then add |incrementNegated| to |num| and - set |first| to false. + 2. If |incrementNegated| is not zero, + then set |lastNonZeroIncrementNegated| to |incrementNegated|. 3. If |el| sets this counter with 'counter-set', then add that integer value to |num| and @@ -1166,7 +1165,9 @@ Instantiating Counters 4. Add |incrementNegated| to |num|. - 4. Return |num|. + 4. Add |lastNonZeroIncrementNegated| to |num|. + + 5. Return |num|. Note: Only [=reversed=] counters can be instantiated without an initial value.