Skip to content

Commit 2dd25fb

Browse files
committed
[css-display] Add a section defining element/box/fragment.
1 parent 5f76c2b commit 2dd25fb

1 file changed

Lines changed: 58 additions & 3 deletions

File tree

css-display/Overview.bs

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ Previous Version: http://www.w3.org/TR/2014/WD-css-display-3-20140220/
1212
Editor: Tab Atkins Jr., Google, http://xanthir.com/contact/
1313
Editor: fantasai, Invited Expert, http://fantasai.inkedblade.net/contact
1414
Abstract: This module describes how the CSS formatting box tree is generated from the document element tree and defines the 'display' and 'box-suppress' properties that control it.
15-
Ignored Terms: display-model, display-role, table row group box, ruby container
16-
Link Defaults: css-lists-3 (property) counter-increment
15+
Ignored Terms: display-model, display-role, table row group box
1716
</pre>
1817

1918
<h2 id="intro">
@@ -506,8 +505,64 @@ Run-In Layout</h2>
506505

507506
Note: This run-in model is slightly different from the one proposed in earlier revisions of [[!CSS21]].
508507

508+
<h2 id='element-box-fragment'>
509+
Appendix A: Elements, Boxes, and Fragments</h2>
510+
511+
CSS operates on several different types of objects,
512+
depending on the stage of processing and what is being done:
513+
the <a>element</a>, the <a>box</a>, and the <a>fragment</a>.
514+
515+
Note: Many of the CSS specs were written before this terminology was ironed out,
516+
or refer to things incorrectly,
517+
so view older specs with caution when they're using these terms.
518+
It should be possible to infer from context which term they really mean.
519+
Please report errors in specs when you find them,
520+
so they can be corrected.
521+
522+
An <dfn>element</dfn> is an object in the DOM tree returned by the host element.
523+
The purpose of an <a>element</a> is to receive styling,
524+
so the multiple declarations from the document's style sheets
525+
are converted into values for each property on each element.
526+
(The DOM tree also contains text,
527+
which is identical to <a>elements</a>
528+
except that it can't be styled directly,
529+
only through inheritance.)
530+
531+
<a>Elements</a> generate <a>boxes</a>.
532+
Typically, an <a>element</a> generates a single <a>box</a>.
533+
Some properties (such as ''display:none'') cause an <a>element</a> and/or its descendants to not generate any <a>boxes</a> at all.
534+
Some properties (such as ''columns: 2'') cause an <a>element</a> to generate multiple <a>boxes</a>s.
535+
Some combinations of properties (such as an element with ''display:table-cell'' and a parent element with anything but ''display:table-row'')
536+
trigger the creation of <a>anonymous boxes</a> to keep the <a>box tree</a> reasonable.
537+
538+
A <dfn>box</dfn> is an object generated from an <a>element</a> according to the 'display' property
539+
and other layout-affecting properties,
540+
organized into a <dfn>box tree</dfn>.
541+
The purpose of a <a>box</a> is to organize the document into a structure that is suitable for layout.
542+
<a>Boxes</a> have the same styles as their generating <a>element</a>, unless otherwise indicated.
543+
They're referred by their type, typically determined by the 'display' value--
544+
a <a>box</a> generated by an element with ''display: block'' is called a “block box” or just a “block”.
545+
546+
An <dfn>anonymous box</dfn> is generated in certain circumstances
547+
where a type of <a>box</a> (such as a table cell box)
548+
requires a particular type of parent box (such as a table row box)
549+
but the document structure is not written to produce that--
550+
<a>anonymous boxes</a> are then generated between the parent and child to provide the required structures.
551+
Anonymous boxes are styled as if they inherited from their nearest non-anonymous parent <a>box</a>,
552+
unless otherwise specified.
553+
554+
The process of layout generates <a>fragments</a> from <a>boxes</a>.
555+
556+
A <dfn>fragment</dfn> is an object representing the result of layout,
557+
organized into a <dfn>fragment tree</dfn>.
558+
<a>Fragments</a> have a size and position,
559+
and the same styles as their generating <a>boxes</a>
560+
unless otherwise specified.
561+
562+
563+
509564
<h2 id='glossary'>
510-
Glossary</h2>
565+
Appendix B: Glossary</h2>
511566

512567
The following terms are defined here for convenience:
513568

0 commit comments

Comments
 (0)