servo/tests/ref/counters_nested_a.html
Patrick Walton f9cdd05d58 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-09 17:13:45 -07:00

36 lines
594 B
HTML

<!DOCTYPE html>
<html>
<head>
<!-- Tests that `counters` works with nested counters. -->
<style>
section {
counter-reset: section 0;
}
h1, h2, h3 {
counter-increment: section 1;
font-size: 24px;
}
h1:before, h2:before, h3:before {
content: counters(section, ".") ". ";
}
</style>
</head>
<body>
<section>
<h1>Foo</h1>
<section>
<h2>Boo</h2>
<h2>Quux</h2>
<section>
<h3>Blah</h3>
</section>
</section>
<h1>Bar</h1>
<section></section>
<h2>Boo</h2>
<h2>Quux</h2>
<h1>Baz</h1>
</section>
</body>
</html>