Skip to content

Commit 6f8b5bc

Browse files
committed
[css-counter-styles] Add a note about the additive algorithm not always finding possible representations.
1 parent 6d7a4f1 commit 6f8b5bc

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

css-counter-styles/Overview.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,17 @@ <h4 id="additive-system" data-level="3.1.6"><span class="secno">3.1.6 </span>
638638
User agents must support representations at least 20 characters long,
639639
but they may choose to instead use the fallback style for representations that would be longer than 20 characters.
640640

641+
</p><p class="note"> Note: All of the predefined additive <a data-autolink="maybe" class="css" href="#at-counter-style">@counter-style</a> rules in this specification
642+
produce representations for every value in their range,
643+
but it's possible to produce values for <a data-autolink="maybe" class="css" href="#additive-symbols">additive-symbols</a> that will fail to find a representation
644+
with the algorithm defined above,
645+
even though theoretically a representation could be found.
646+
For example, if a <a data-autolink="maybe" class="css" href="#at-counter-style">@counter-style</a> was defined with <span data-autolink="maybe" class="css">additive-symbols: 3 "a", 2 "b";</span>,
647+
the algorithm defined above will fail to find a representation for a counter value of 4,
648+
even though theoretically a "bb" representation would work.
649+
While unfortunate, this is required to maintain the property that the algorithm runs in linear time
650+
relative to the size of the counter value.
651+
641652

642653
</p><h4 id="override-system" data-level="3.1.7"><span class="secno">3.1.7 </span>
643654
Tweaking Existing Counter Styles: the <a data-autolink="maybe" class="css" href="#override">override</a> system</h4>
@@ -1688,7 +1699,7 @@ <h5 class="no-num no-toc" id="limited-chinese">
16881699
counter value.
16891700
</li></ol>
16901701

1691-
<p> For all of these counter styles, the <a data-autolink="property" class="property" title="suffix" href="#suffix">suffix</a>is "&#12289;" U+3001,
1702+
<p> For all of these counter styles, the <a data-autolink="property" class="property" title="suffix" href="#suffix">suffix</a> is "&#12289;" U+3001,
16921703
the <a data-autolink="property" class="property" title="fallback" href="#fallback">fallback</a> is <a data-autolink="maybe" class="css" href="#cjk-decimal">cjk-decimal</a>,
16931704
the <a data-autolink="property" class="property" title="range" href="#range">range</a> is <span data-autolink="maybe" class="css">-9999 9999</span>,
16941705
and the <a data-autolink="property" class="property" title="negative" href="#negative">negative</a> value is given in the table of symbols for each style.
@@ -2459,6 +2470,7 @@ <h2 id="acknowledgments" class="no-num">
24592470
http://people.netscape.com/smontagu/writings/HebrewNumbers.html
24602471
http://www.ethiopic.org/Collation/OrderedLists.html
24612472
http://bugzilla.mozilla.org/show_bug.cgi?id=102252 -->
2473+
24622474
</p><h2 class="no-ref no-num" id="conformance">
24632475
Conformance</h2>
24642476

css-counter-styles/Overview.src.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,17 @@ <h4 id="additive-system">
564564
User agents must support representations at least 20 characters long,
565565
but they may choose to instead use the fallback style for representations that would be longer than 20 characters.
566566

567+
Note: All of the predefined additive ''@counter-style'' rules in this specification
568+
produce representations for every value in their range,
569+
but it's possible to produce values for ''additive-symbols'' that will fail to find a representation
570+
with the algorithm defined above,
571+
even though theoretically a representation could be found.
572+
For example, if a ''@counter-style'' was defined with ''additive-symbols: 3 "a", 2 "b";'',
573+
the algorithm defined above will fail to find a representation for a counter value of 4,
574+
even though theoretically a "bb" representation would work.
575+
While unfortunate, this is required to maintain the property that the algorithm runs in linear time
576+
relative to the size of the counter value.
577+
567578

568579
<h4 id="override-system">
569580
Tweaking Existing Counter Styles: the ''override'' system</h4>

0 commit comments

Comments
 (0)