@@ -34,21 +34,25 @@ Introduction</h2>
34
34
35
35
<p><em> This section is normative.</em>
36
36
37
- CSS takes a source document, organized as a tree of <dfn lt="element|element tree">elements</dfn> ,
37
+ CSS takes a source document, organized as a <dfn lt="element tree">tree</dfn> of <dfn> elements</dfn> and <dfn>text nodes </dfn> ,
38
38
and renders it onto a <a href="https://www.w3.org/TR/CSS2/intro.html#canvas">canvas</a> (such as your screen, a piece of paper, or an audio stream).
39
39
To do this, it generates an intermediary structure,
40
40
the <dfn export>box tree</dfn> ,
41
41
which represents the formatting structure of the rendered document.
42
- Each <dfn export>box</dfn> represents its corresponding <a>element</a> (or <a>pseudo-element</a> )
43
- in space and/or time on the canvas.
42
+ Each <dfn export>box</dfn> in the <a>box tree</a>
43
+ represents its corresponding <a>element</a> (or <a>pseudo-element</a> )
44
+ in space and/or time on the canvas,
45
+ while each <dfn export>text run</dfn> in the <a>box tree</a>
46
+ likewise represents the contents of its corresponding <a>text nodes</a> .
44
47
45
48
To create the <a>box tree</a> ,
46
49
CSS first uses <a href="https://www.w3.org/TR/css-cascade/">cascading and inheritance</a> ,
47
50
to assign a <a>computed value</a> for each CSS property
48
- to each element in the source tree.
51
+ to each <a> element</a> and <a>text node</a> in the source tree.
49
52
(See [[!CSS3-CASCADE]] .)
50
53
51
- Then, for each element, it generates zero or more boxes
54
+ Then, for each <a>element</a> ,
55
+ CSS generates zero or more <a>boxes</a>
52
56
as specified by that element's 'display' property.
53
57
Typically, an element generates a single <a>box</a> .
54
58
However, some 'display' values
@@ -62,6 +66,9 @@ Introduction</h2>
62
66
They're often referred to by their 'display' type--
63
67
e.g. a <a>box</a> generated by an element with ''display: block'' is called a “block box” or just a “block”.
64
68
69
+ Similarly, each contiguous sequence of sibling <a>text nodes</a> generates a <a>text run</a> ,
70
+ which is assigned the same styles as the generating <a>text nodes</a> .
71
+
65
72
An <dfn lt="anonymous|anonymous box" export>anonymous box</dfn> is is a box that is not associated with any element.
66
73
<a>Anonymous boxes</a> are generated in certain circumstances
67
74
to fix up the <a>box tree</a> when it requires a particular nested structure
@@ -76,10 +83,11 @@ Introduction</h2>
76
83
<a href="https://www.w3.org/TR/css-cascade/#inheriting">inherit</a> through their <a>box tree</a> parentage.
77
84
78
85
In the course of layout,
79
- a <a>box </a> may be broken into multiple <a>fragments</a> .
80
- This happens, for example, when an inline box is broken across lines,
86
+ <a>boxes</a> and <a>text runs </a> can be broken into multiple <a>fragments</a> .
87
+ This happens, for example, when an inline box and/or text run is broken across lines,
81
88
or when a block box is broken across pages or columns.
82
- A <a>box</a> therefore consists of one or more <a>box fragments</a> .
89
+ A <a>box</a> therefore consists of one or more <a>box fragments</a> ,
90
+ and a <a>text run</a> consists of one or more <a>text fragments</a> .
83
91
See [[CSS3-BREAK]] for more information on <a>fragmentation</a> .
84
92
85
93
Note: Many of the CSS specs were written before this terminology was ironed out,
@@ -137,6 +145,8 @@ Box Layout Modes: the 'display' property</h2>
137
145
* the <dfn export local-lt="outer">outer display type</dfn> ,
138
146
which dictates how the box participates in its parent formatting context.
139
147
148
+ <a>Text runs</a> have no <a>display type</a> .
149
+
140
150
Some 'display' values have additional side-effects:
141
151
such as ''list-item'' , which also generates a ''::marker'' pseudo-element,
142
152
and ''display/none'' , which causes the element's entire subtree to be left out of the box tree.
@@ -498,7 +508,7 @@ Box Generation: the ''display/none'' and ''display/contents'' keywords</h3>
498
508
<dt> <dfn>contents</dfn>
499
509
<dd>
500
510
The element itself does not generate any boxes,
501
- but its children and pseudo-elements still generate boxes as normal.
511
+ but its children and pseudo-elements still generate <a> boxes</a> and <a>text runs</a> as normal.
502
512
For the purposes of box generation and layout,
503
513
the element must be treated as if it had been replaced in the [=element tree=]
504
514
by its contents
@@ -525,7 +535,10 @@ Box Generation: the ''display/none'' and ''display/contents'' keywords</h3>
525
535
526
536
<dt> <dfn>none</dfn>
527
537
<dd>
528
- The element and its descendants generate no boxes.
538
+ The <a>element</a> and its descendants generate no <a>boxes</a> or <a>text runs</a> .
539
+
540
+ Similarly, if a <a>text node</a> is defined to behave as ''display: none'' ,
541
+ it generates no <a>text runs</a> .
529
542
</dl>
530
543
531
544
Elements with either of these values do not have <a>inner</a> or <a>outer display types</a> ,
0 commit comments