File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -1142,7 +1142,29 @@ Instantiating Counters</h4>
1142
1142
1143
1143
When a [=counter=] is [=instantiated=] without an initial value,
1144
1144
the user agent must dynamically calculate the initial value at layout-time
1145
- to be the number of elements and pseudo-elements that [=instantiate=] the same counter in the same [=scope=] , plus 1.
1145
+ to be the value returned by the following algorithm:
1146
+
1147
+ 1. Let |num| be 0.
1148
+
1149
+ 2. Let |first| be true.
1150
+
1151
+ 3. For each element or pseudo-element |el| that increments or
1152
+ sets the same counter in the same [=scope=] :
1153
+
1154
+ 1. Let |incrementNegated| be |el|'s ' counter-increment' integer value for this counter,
1155
+ multiplied by -1.
1156
+
1157
+ 2. If |first| is true,
1158
+ then add |incrementNegated| to |num| and
1159
+ set |first| to false.
1160
+
1161
+ 3. If |el| sets this counter with 'counter-set' ,
1162
+ then add that integer value to |num| and
1163
+ break this loop.
1164
+
1165
+ 4. Add |incrementNegated| to |num|.
1166
+
1167
+ 4. Return |num|.
1146
1168
1147
1169
Note: Only [=reversed=] counters can be instantiated without an initial value.
1148
1170
You can’t perform that action at this time.
0 commit comments