XXE 3.8.1 seems to behave in a strange manner with respect to the
counter-reset CSS instruction as soon as you try to reset several
counters at once.
Say I have 3 element types A, B and C (whose instances are siblings)
with counters named as "...-num" for each of them, like this:
A:before
{
display: block;
counter-increment: A-num;
content: element-local-name() " " counter(A-num, decimal);
}
B:before
{
display: block;
counter-increment: B-num;
content: element-local-name() " " counter(B-num, decimal);
}
C:before
{
display: block;
counter-increment: C-num;
content: element-local-name() " " counter(C-num, decimal);
}
As the A, B and C instances rather reflect a hierarchy for me (but need
to stay siblings), I want to reset the counter of C in B and the
counters of B and C in A. So I am trying to accomplish that last task using:
A:before
{
display: block;
counter-increment: A-num;
content: element-local-name() " " counter(A-num, decimal);
counter-reset: B-num;
counter-reset: C-num;
}
Strangely enough, it is always only the second of both reset-counter
instructions that will take effect while the other one is ignored
(proved by reversing their order). Same result when the selector reads
just "A".
The only workaround seems to be to spread the two counter-reset
instructions over several CSS rules, as the following achieves the
desired result of resetting both counters (no matter which counter-reset
instruction is placed with which of both rules):
A:before
{
display: block;
counter-increment: A-num;
content: element-local-name() " " counter(A-num, decimal);
counter-reset: B-num;
}
A
{
display: block;
counter-reset: C-num;
}
Strange, isn't it?
Yves