Re: [csswg-drafts] [css-display] Should anonymous boxes always inherit through the box tree?

Okay, we think this is the diff we need:

```diff
diff --git a/css-cascade/Overview.bs b/css-cascade/Overview.bs
index c72e6f1c5..f3ba84b99 100644
--- a/css-cascade/Overview.bs
+++ b/css-cascade/Overview.bs
@@ -45,14 +45,22 @@ Introduction</h2>
 <h3 id="placement">
 Module Interactions</h3>
 
+ <em>This section is normative.</em>
+
 <p>This module replaces and extends
  the rules for assigning property values, cascading, and inheritance defined in [[!CSS21]] chapter 6.
 
 <p>Other CSS modules may expand the definitions of some of the syntax and features defined here.
  For example, the Media Queries Level 4 specification,
  when combined with this module, expands the definition of
  the <<media-query>> value type as used in this specification.
 
+ For the purpose of this specification,
+ <a>text nodes</a> are treated as <a>element</a> children of their associated element,
+ and possess the full set of properties;
+ since they cannot be targetted by selectors
+ all of their computed values are assigned by <a href="#defaulting">defaulting</a>.
+
 <h2 id="at-import">
 Importing Style Sheets: the ''@import'' rule</h2>
 
diff --git a/css-display/Overview.bs b/css-display/Overview.bs
index b101c6eeb..661556484 100644
--- a/css-display/Overview.bs
+++ b/css-display/Overview.bs
@@ -34,21 +34,25 @@ Introduction</h2>
 
  <p><em>This section is normative.</em>
 
- CSS takes a source document, organized as a tree of <dfn lt="element|element tree">elements</dfn>,
+ CSS takes a source document, organized as a tree of <dfn lt="element|element tree">elements</dfn> and <dfn>text nodes</dfn>,
  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).
  To do this, it generates an intermediary structure,
  the <dfn export>box tree</dfn>,
  which represents the formatting structure of the rendered document.
- Each <dfn export>box</dfn> represents its corresponding <a>element</a> (or <a>pseudo-element</a>)
- in space and/or time on the canvas.
+ Each <dfn export>box</dfn> in the <a>box tree</a>
+ represents its corresponding <a>element</a> (or <a>pseudo-element</a>)
+ in space and/or time on the canvas,
+ while each <dfn export>text run</dfn> in the <a>box tree</a>
+ likewise represents the contents of its corresponding <a>text nodes</a>.
 
  To create the <a>box tree</a>,
  CSS first uses <a href="https://www.w3.org/TR/css-cascade/">cascading and inheritance</a>,
  to assign a <a>computed value</a> for each CSS property
- to each element in the source tree.
+ to each <a>element</a> and <a>text node</a> in the source tree.
  (See [[!CSS3-CASCADE]].)
 
- Then, for each element, it generates zero or more boxes
+ Then, for each element,
+ CSS generates zero or more boxes
  as specified by that element's 'display' property.
  Typically, an element generates a single <a>box</a>.
  However, some 'display' values
@@ -62,6 +66,9 @@ Introduction</h2>
  They're often referred to by their 'display' type--
  e.g. a <a>box</a> generated by an element with ''display: block'' is called a “block box” or just a “block”.
 
+ Similarly, each contiguous sequence of sibling <a>text nodes</a> generates a <a>text run</a>,
+ which is assigned the same styles as the generating <a>text nodes</a>.
+
  An <dfn lt="anonymous|anonymous box" export>anonymous box</dfn> is is a box that is not associated with any element.
  <a>Anonymous boxes</a> are generated in certain circumstances
  to fix up the <a>box tree</a> when it requires a particular nested structure
@@ -76,10 +83,11 @@ Introduction</h2>
  <a href="https://www.w3.org/TR/css-cascade/#inheriting">inherit</a> through their <a>box tree</a> parentage.
 
  In the course of layout,
- a <a>box</a> may be broken into multiple <a>fragments</a>.
- This happens, for example, when an inline box is broken across lines,
+ <a>boxes</a> and <a>text runs</a> can be broken into multiple <a>fragments</a>.
+ This happens, for example, when an inline box and/or text run is broken across lines,
  or when a block box is broken across pages or columns.
- A <a>box</a> therefore consists of one or more <a>box fragments</a>.
+ A <a>box</a> therefore consists of one or more <a>box fragments</a>,
+ and a <a>text run</a> consists of one or more <a>text fragments</a>.
  See [[CSS3-BREAK]] for more information on <a>fragmentation</a>.
 
  Note: Many of the CSS specs were written before this terminology was ironed out,
@@ -127,16 +135,18 @@ Box Layout Modes: the 'display' property</h2>
  Media: all
  </pre>
 
 The 'display' property defines box's <dfn export>display type</dfn>,
  which consists of the two basic qualities of how an element generates boxes:
 
  * the <dfn export local-lt="inner">inner display type</dfn>,
  which defines (if it a <a href="https://www.w3.org/TR/CSS2/conform.html#replaced-element">non-replaced element</a>) the kind of <a>formatting context</a> it generates,
   dictating how its descendant boxes are laid out.
   (The inner display of a <a href="https://www.w3.org/TR/CSS2/conform.html#replaced-element">replaced element</a> is outside the scope of CSS.)
  * the <dfn export local-lt="outer">outer display type</dfn>,
   which dictates how the box participates in its parent formatting context.
 
+ <a>Text runs</a> have no <a>display type</a>.
+
  Some 'display' values have additional side-effects:
  such as ''list-item'', which also generates a ''::marker'' pseudo-element,
  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>
   <dt><dfn>contents</dfn>
   <dd>
    The element itself does not generate any boxes,
-   but its children and pseudo-elements still generate boxes as normal.
+   but its children and pseudo-elements still generate box-tree nodes as normal.
    For the purposes of box generation and layout,
    the element must be treated as if it had been replaced in the [=element tree=]
    by its contents
@@ -525,7 +535,10 @@ Box Generation: the ''display/none'' and ''display/contents'' keywords</h3>
 
   <dt><dfn>none</dfn>
   <dd>
-   The element and its descendants generate no boxes.
+   The <a>element</a> and its descendants generate no <a>boxes</a> or <a>text runs</a>.
+
+   Similarly, if a <a>text node</a> is defined to behave as ''display: none'',
+   it generates no <a>text runs</a>.
  </dl>
 
  Elements with either of these values do not have <a>inner</a> or <a>outer display types</a>,
diff --git a/css-flexbox/Overview.bs b/css-flexbox/Overview.bs
index 6fabce55e..ec53d00c1 100644
--- a/css-flexbox/Overview.bs
+++ b/css-flexbox/Overview.bs
@@ -561,12 +561,12 @@ Flex Items</h2>
 
  Each in-flow child of a <a>flex container</a>
  becomes a <a>flex item</a>,
- and each contiguous run of text that is directly contained inside a <a>flex container</a>
- is wrapped in an anonymous <a>flex item</a>.
- However, an anonymous flex item that contains only
+ and each contiguous sequence of child <a>text runs</a>
+ is wrapped in an <a>anonymous</a> <a>block container</a> <a>flex item</a>.
+ However, if the entire sequence of child <a>text runs</a> contains only
  <a href="https://www.w3.org/TR/CSS2/text.html#white-space-prop">white space</a>
  (i.e. characters that can be affected by the 'white-space' property)
- is not rendered (just as if it were ''display:none'').
+ it is instead not rendered (just as if its <a>text node</a> were ''display:none'').
 
  <div class="example">
   <p>Examples of flex items:
diff --git a/css-grid/Overview.bs b/css-grid/Overview.bs
index 315f9d9cc..c2851ed59 100644
--- a/css-grid/Overview.bs
+++ b/css-grid/Overview.bs
@@ -963,15 +963,16 @@ Clamping Overly Large Grids</h3>
 Grid Items</h2>
 
  Loosely speaking, the <dfn export id="grid-item" lt="grid item">grid items</dfn> of a <a>grid container</a>
- are boxes representing its in-flow contents:
- each in-flow child of a <a>grid container</a>
- becomes a <a>grid item</a>.
+ are boxes representing its in-flow contents.
 
- Each contiguous run of text that is directly contained inside a <a>grid container</a>
- is wrapped in an anonymous <a>grid item</a>.
- However, an anonymous grid item that contains only
- <a href="https://www.w3.org/TR/css-text/#white-space-processing">white space</a>
- is not rendered, as if it were ''display: none''.
+ Each in-flow child of a <a>grid container</a>
+ becomes a <a>grid item</a>,
+ and each contiguous sequence of child <a>text runs</a>
+ is wrapped in an <a>anonymous</a> <a>block container</a> <a>grid item</a>.
+ However, if the entire sequence of child <a>text runs</a> contains only
+ <a href="https://www.w3.org/TR/CSS2/text.html#white-space-prop">white space</a>
+ (i.e. characters that can be affected by the 'white-space' property)
+ it is instead not rendered (just as if its <a>text node</a> were ''display:none'').
 
  <div class="example">
   <p>Examples of grid items:
```

We reviewed a few other specs that talk about text, particularly Fonts and Writing Modes, and they use "text runs" or "runs of text" in ways that are handwavily-compatible with this "text run" term of art.  They could use some cleaning up eventually, but we don't think their lack of precision is necessary to fix at this moment.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1118#issuecomment-301942276 using your GitHub account

Received on Tuesday, 16 May 2017 23:23:15 UTC