Performance: Ordered lists
LOW IMPACT
Ordered lists affect the browser's rendering speed by adding structured list elements that require layout and paint operations.
<ol><li>Item 1</li><li>Item 2</li></ol>
<ol style="list-style: none; counter-reset: item 0;"><li style="counter-increment: item;">Item 1</li><li style="counter-increment: item;">Item 2</li></ol>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Native <ol> with <li> | Minimal DOM nodes | Single reflow for list | Low paint cost | [OK] Good |
| <ol> with CSS counters on each <li> | More style recalculations | Multiple reflows per item | Higher paint cost | [X] Bad |