target-counter implementation is wrong when using the target "page" and counter-increment
As far as I understand, the current implementation will iterate over the page (more specifically over the elements with the class pagedjs_page
) and increment a zero-based counter while using getComputedStyle
to check if counter-reset
is defined (to reset the counter accordingly).
I believe that this implementation is not efficient? but more importantly it ignores counter-increment
.
For instance, if I declare the following CSS, the counter will be wrong:
@page cover {
counter-increment: page 0;
}
I could also decide to increment the page by 2 or -1.