You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-counter-styles/Overview.bs
+10-12Lines changed: 10 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -109,10 +109,19 @@ Counter Styles</h2>
109
109
Note: the prefix and suffix don't play a part in this algorithm.
110
110
This is intentional;
111
111
the prefix and suffix aren't part of the string returned by the counter() or counters() functions.
112
-
Instead, the prefix and suffix are added by the algorithm that constructs the value of the <a property spec=css-ui-3>content</a> property for the ''::marker'' pseudo-element.
112
+
Instead, the prefix and suffix are added by the algorithm that constructs the value of the <a property spec=css-ui-3>content</a> property
113
+
for the ''::marker'' pseudo-element.
113
114
This also implies that the prefix and suffix always come from the specified counter-style,
114
115
even if the actual representation is constructed by a fallback style.
115
116
117
+
Some values of 'system' (''symbolic'', ''additive'')
118
+
and some descriptors ('pad')
119
+
can generate representations with size linear to the counter value.
120
+
This potentially be abused to generate excessively large representations
121
+
and consume undue amounts of the user's memory or even hang their browser.
122
+
User agents must support representations at least 60 Unicode codepoints long,
123
+
but they may choose to instead use the fallback style for representations that would be longer than 60 codepoints.
124
+
116
125
117
126
<h2 id='the-counter-style-rule'>
118
127
Defining Custom Counter Styles: the ''@counter-style'' rule</h2>
@@ -354,12 +363,6 @@ Repeating Symbols: the ''symbolic'' system</h4>
354
363
355
364
Finally, return <var>S</var>.
356
365
357
-
The ''symbolic'' system will produce representations with sizes that are linear in the magnitude of the counter value.
358
-
This can potentially be abused to generate excessively large representations
359
-
and consume undue amounts of the user's memory or even hang their browser.
360
-
User agents must support representations at least 60 Unicode codepoints long,
361
-
but they may choose to instead use the fallback style for representations that would be longer than 60 codepoints.
362
-
363
366
364
367
<h4 id="alphabetic-system">
365
368
Bijective Numerals: the <a value for=system>alphabetic</a> system</h4>
@@ -559,11 +562,6 @@ Accumulating Numerals: the ''additive'' system</h4>
559
562
<li>If the loop ended because <var>value</var> is 0, return S. Otherwise, the given counter value cannot be represented by this counter style, and must instead be represented by the fallback counter style.
560
563
</ol>
561
564
562
-
The ''additive'' system will produce representations with sizes that are linear in the magnitude of the counter value.
563
-
This can potentially be abused to generate excessively large representations and consume undue amounts of the user's memory or even hang their browser.
564
-
User agents must support representations at least 60 Unicode codepoints long,
565
-
but they may choose to instead use the fallback style for representations that would be longer than 60 codepoints.
566
-
567
565
Note: All of the predefined additive ''@counter-style'' rules in this specification
568
566
produce representations for every value in their range,
569
567
but it's possible to produce values for ''additive-symbols'' that will fail to find a representation
<pclass=note> Note: the prefix and suffix don’t play a part in this algorithm.
264
264
This is intentional;
265
265
the prefix and suffix aren’t part of the string returned by the counter() or counters() functions.
266
-
Instead, the prefix and suffix are added by the algorithm that constructs the value of the <aclass=css-codedata-link-spec=css-ui-3data-link-type=propertyhref=http://dev.w3.org/csswg/css-ui-3/#contenttitle=content>content</a> property for the <aclass=cssdata-link-type=maybehref=http://dev.w3.org/csswg/css-lists-3/#selectordef-markertitle=::marker>::marker</a> pseudo-element.
266
+
Instead, the prefix and suffix are added by the algorithm that constructs the value of the <aclass=css-codedata-link-spec=css-ui-3data-link-type=propertyhref=http://dev.w3.org/csswg/css-ui-3/#contenttitle=content>content</a> property
267
+
for the <aclass=cssdata-link-type=maybehref=http://dev.w3.org/csswg/css-lists-3/#selectordef-markertitle=::marker>::marker</a> pseudo-element.
267
268
This also implies that the prefix and suffix always come from the specified counter-style,
268
269
even if the actual representation is constructed by a fallback style.
269
270
271
+
<p> Some values of <aclass=propertydata-link-type=propdeschref=#descdef-systemtitle=system>system</a> (<aclass=cssdata-link-type=maybehref=#valuedef-symbolictitle=symbolic>symbolic</a>, <aclass=cssdata-link-type=maybehref=#valuedef-additivetitle=additive>additive</a>)
272
+
and some descriptors (<aclass=propertydata-link-type=propdeschref=#descdef-padtitle=pad>pad</a>)
273
+
can generate representations with size linear to the counter value.
274
+
This potentially be abused to generate excessively large representations
275
+
and consume undue amounts of the user’s memory or even hang their browser.
276
+
User agents must support representations at least 60 Unicode codepoints long,
277
+
but they may choose to instead use the fallback style for representations that would be longer than 60 codepoints.
<p> The <aclass=cssdata-link-type=maybehref=#valuedef-symbolictitle=symbolic>symbolic</a> system will produce representations with sizes that are linear in the magnitude of the counter value.
491
-
This can potentially be abused to generate excessively large representations
492
-
and consume undue amounts of the user’s memory or even hang their browser.
493
-
User agents must support representations at least 60 Unicode codepoints long,
494
-
but they may choose to instead use the fallback style for representations that would be longer than 60 codepoints.
Bijective Numerals: the <aclass=css-codedata-link-for=systemdata-link-type=valuehref=#valuedef-alphabetic0title=alphabetic>alphabetic</a> system</span><aclass=self-linkhref=#alphabetic-system></a></h4>
<li>If the loop ended because <var>value</var> is 0, return S. Otherwise, the given counter value cannot be represented by this counter style, and must instead be represented by the fallback counter style.
683
686
</ol>
684
687
685
-
<p> The <aclass=cssdata-link-type=maybehref=#valuedef-additivetitle=additive>additive</a> system will produce representations with sizes that are linear in the magnitude of the counter value.
686
-
This can potentially be abused to generate excessively large representations and consume undue amounts of the user’s memory or even hang their browser.
687
-
User agents must support representations at least 60 Unicode codepoints long,
688
-
but they may choose to instead use the fallback style for representations that would be longer than 60 codepoints.
689
-
690
688
<pclass=note> Note: All of the predefined additive <aclass=cssdata-link-type=maybehref=#at-ruledef-counter-styletitle=@counter-style>@counter-style</a> rules in this specification
691
689
produce representations for every value in their range,
692
690
but it’s possible to produce values for <spanclass=cssdata-link-type=maybetitle=additive-symbols>additive-symbols</span> that will fail to find a representation
0 commit comments