Re: [css-counter-styles] length of prefix, suffix, and negative should be limited

On Sun, Mar 9, 2014 at 3:02 AM, Xidorn Quan <quanxunzhen@gmail.com> wrote:
> Since the string in such descriptors will be multipled by the number
> of ordinals to be displayed, it could be easy to consume a large
> amount of memory and time even when the total page size is not too
> large. For example, if prefix is a string of 100,000 characters, and
> there is 25,000 numbers to be displayed. The size of page is just
> several hundred kilobytes, but could consume 2GB memory to compute it.
>
> Hence I propose that the length of all these fields should be limited.
> A too long string for them could be dropped directly in parsing stage.

This is equivalent to "*::before { content: '[100k characters here]';
}", and so it's not something we should need to address specially in
Counter Styles.  It can produce outsize documents, but it's still only
linear with the document size, and so doesn't need special care.  The
purpose of the restrictions so far is mostly to protect authors
against accidental misuse, not users; authors can always blow up or
lock up a page with a trivial JS loop.

~TJ

Received on Monday, 10 March 2014 21:19:02 UTC