Skip to content

Commit b9629db

Browse files
committed
[css-counter-styles] Move the 'too large description' warning to a generic spot.
1 parent b09fd72 commit b9629db

2 files changed

Lines changed: 20 additions & 24 deletions

File tree

css-counter-styles/Overview.bs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,19 @@ Counter Styles</h2>
109109
Note: the prefix and suffix don't play a part in this algorithm.
110110
This is intentional;
111111
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.
113114
This also implies that the prefix and suffix always come from the specified counter-style,
114115
even if the actual representation is constructed by a fallback style.
115116

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+
116125

117126
<h2 id='the-counter-style-rule'>
118127
Defining Custom Counter Styles: the ''@counter-style'' rule</h2>
@@ -354,12 +363,6 @@ Repeating Symbols: the ''symbolic'' system</h4>
354363

355364
Finally, return <var>S</var>.
356365

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-
363366

364367
<h4 id="alphabetic-system">
365368
Bijective Numerals: the <a value for=system>alphabetic</a> system</h4>
@@ -559,11 +562,6 @@ Accumulating Numerals: the ''additive'' system</h4>
559562
<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.
560563
</ol>
561564

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-
567565
Note: All of the predefined additive ''@counter-style'' rules in this specification
568566
produce representations for every value in their range,
569567
but it's possible to produce values for ''additive-symbols'' that will fail to find a representation

css-counter-styles/Overview.html

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,19 @@ <h2 class="heading settled heading" data-level=2 id=counter-styles><span class=s
263263
<p class=note> Note: the prefix and suffix don’t play a part in this algorithm.
264264
This is intentional;
265265
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 <a class=css-code data-link-spec=css-ui-3 data-link-type=property href=http://dev.w3.org/csswg/css-ui-3/#content title=content>content</a> property for the <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-lists-3/#selectordef-marker title=::marker>::marker</a> pseudo-element.
266+
Instead, the prefix and suffix are added by the algorithm that constructs the value of the <a class=css-code data-link-spec=css-ui-3 data-link-type=property href=http://dev.w3.org/csswg/css-ui-3/#content title=content>content</a> property
267+
for the <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-lists-3/#selectordef-marker title=::marker>::marker</a> pseudo-element.
267268
This also implies that the prefix and suffix always come from the specified counter-style,
268269
even if the actual representation is constructed by a fallback style.
269270

271+
<p> Some values of <a class=property data-link-type=propdesc href=#descdef-system title=system>system</a> (<a class=css data-link-type=maybe href=#valuedef-symbolic title=symbolic>symbolic</a>, <a class=css data-link-type=maybe href=#valuedef-additive title=additive>additive</a>)
272+
and some descriptors (<a class=property data-link-type=propdesc href=#descdef-pad title=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.
278+
270279

271280
<h2 class="heading settled heading" data-level=3 id=the-counter-style-rule><span class=secno>3 </span><span class=content>
272281
Defining Custom Counter Styles: the <a class=css data-link-type=maybe href=#at-ruledef-counter-style title=@counter-style>@counter-style</a> rule</span><a class=self-link href=#the-counter-style-rule></a></h2>
@@ -487,12 +496,6 @@ <h4 class="heading settled heading" data-level=3.1.3 id=symbolic-system><span cl
487496

488497
<p> Finally, return <var>S</var>.
489498

490-
<p> The <a class=css data-link-type=maybe href=#valuedef-symbolic title=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.
495-
496499

497500
<h4 class="heading settled heading" data-level=3.1.4 id=alphabetic-system><span class=secno>3.1.4 </span><span class=content>
498501
Bijective Numerals: the <a class=css-code data-link-for=system data-link-type=value href=#valuedef-alphabetic0 title=alphabetic>alphabetic</a> system</span><a class=self-link href=#alphabetic-system></a></h4>
@@ -682,11 +685,6 @@ <h4 class="heading settled heading" data-level=3.1.6 id=additive-system><span cl
682685
<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.
683686
</ol>
684687

685-
<p> The <a class=css data-link-type=maybe href=#valuedef-additive title=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-
690688
<p class=note> Note: All of the predefined additive <a class=css data-link-type=maybe href=#at-ruledef-counter-style title=@counter-style>@counter-style</a> rules in this specification
691689
produce representations for every value in their range,
692690
but it’s possible to produce values for <span class=css data-link-type=maybe title=additive-symbols>additive-symbols</span> that will fail to find a representation

0 commit comments

Comments
 (0)