You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Giving an element <dfn export>style containment</dfn> has the following effect:
270
273
271
-
1. The 'counter-increment', 'counter-set', and <a property spec=css2>content</a> (for the purpose of ''content/open-quote''/etc values) properties
274
+
1. The 'counter-increment' and 'counter-set' properties
275
+
must be <a for=property>scoped</a> to the element's sub-tree
276
+
and create a new counter.
277
+
278
+
2. The effects of the 'content' property's
279
+
''content/open-quote'', ''content/close-quote'', ''content/no-open-quote'' and ''content/no-close-quote''
272
280
must be <a for=property>scoped</a> to the element's sub-tree.
273
281
282
+
Note: This implies that the depth of quote nesting in the subtree
283
+
is unchanged and starts at the value that its context normally implies,
284
+
but that changes to the depth of quote nesting by these values inside the subtree
285
+
do not affect the depth of quote nesting outside the subtree.
286
+
274
287
Note: [[CSS-REGIONS-1]] has normative requirements on how <a>style containment</a> affects regions.
275
288
276
289
A <dfn export for=property lt="scoped | scoped property | scoped properties">scoped property</dfn> has its effects scoped to a particular element or subtree.
@@ -289,22 +302,26 @@ Style Containment</h3>
289
302
When scoped, the 'counter-set' and 'counter-increment'<a spec=css-lists-3>create a new counter</a>.
290
303
291
304
<div class=example>
292
-
If'counter-increment' is scoped to an element's subtree,
305
+
As'counter-increment' is scoped to an element's subtree,
293
306
the first use of it within the subtree acts as if the named counter were set to 0 at the scoping element,
294
307
regardless of whether the counter had been used outside the scoping element.
295
308
Any increments made within the subtree have no effect on counters of the same name outside the scoping element.
296
-
Therefore, the following code results in <code>1.2</code> being displayed:
309
+
However, the ''content/counter()'' and ''content/counters()'' value of the 'content' property is not itself scoped,
310
+
and can refer to counters established outside of the subtree.
311
+
Therefore, the following code results in <q><samp>1 1.2</samp></q> being displayed:
297
312
<pre><code highlight=markup>
298
313
<div></div>
299
314
</code></pre>
300
315
<pre><code highlight=css>
301
316
div {
302
317
contain: style;
303
-
counter-increment: n;
318
+
counter-increment: n;
319
+
}
320
+
div::before, div::after {
321
+
content: counters(n, '.') " ";
304
322
}
305
-
div::before {
323
+
div::after {
306
324
counter-increment: n 2;
307
-
content: counters(n, '.');
308
325
}
309
326
</code></pre>
310
327
</div>
@@ -457,6 +474,7 @@ This appendix is <em>informative</em>.
457
474
<li>Elements with size containment are monolithic
458
475
<li>Forced breaks area allowed in elements with layout containments, but do not propagate
0 commit comments