Skip to content

Commit 0bd642c

Browse files
committed
Addressing bug 15131
1 parent 14c5d91 commit 0bd642c

2 files changed

Lines changed: 145 additions & 20 deletions

File tree

css3-regions/Overview.html

Lines changed: 78 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -533,20 +533,54 @@ <h3 id=named-flows-and-regions><span class=secno>1.1. </span>Named flows
533533

534534
</pre>
535535

536-
<p>And the following snippet shows an example of elements that will be used
537-
as regions.
536+
<p>And the following snippet shows an example using grid cells to define
537+
the region areas:
538538

539539
<pre>
540-
&lt;div id="region1"&gt;&lt;/div&gt;
541-
&lt;div id="region2"&gt;&lt;/div&gt;
542-
&lt;div id="region3"&gt;&lt;/div&gt;
543-
&lt;div id="region4"&gt;&lt;/div&gt;
540+
&lt;style&gt;
541+
#page {
542+
width: 800px;
543+
height: 600px;
544+
grid-template: "aaa.e"
545+
"....e"
546+
"bbb.e"
547+
"....e"
548+
"c.d.e";
549+
grid-rows: 52% 4% 20% 4% 20%;
550+
grid-columns: 30% 5% 30% 5% 30%;
551+
}
552+
#regionA { grid-cell: a; }
553+
#region1 { grid-cell: b; }
554+
#region2 { grid-cell: c; }
555+
#region3 { grid-cell: d; }
556+
#region4 { grid-cell: e; }
557+
&lt;/style&gt;
558+
559+
&lt;div id="page"&gt;
560+
&lt;div id="region1"&gt;&lt;/div&gt;
561+
&lt;div id="region2"&gt;&lt;/div&gt;
562+
&lt;div id="region3"&gt;&lt;/div&gt;
563+
&lt;div id="region4"&gt;&lt;/div&gt;
564+
&lt;/div&gt;
544565
</pre>
545566

546-
<p>CSS layout facilities can position and size regions as needed. However,
547-
there is no existing mechanism to associate the content with the regions
548-
so that content flows as intended. Figure 2 shows an example of the
549-
intended visual rendering of the content.
567+
<p>Any of the CSS layout facilities can be used to create, position and
568+
size regions as needed.
569+
570+
<div class=note>
571+
<p>Using a grid layout (see <a href="#CSS3-GRID-LAYOUT"
572+
rel=biblioentry>[CSS3-GRID-LAYOUT]<!--{{CSS3-GRID-LAYOUT}}--></a> is just
573+
an example. The example could use a flexible box layout as well, see <a
574+
href="#CSS3-FLEXBOX"
575+
rel=biblioentry>[CSS3-FLEXBOX]<!--{{CSS3-FLEXBOX}}--></a>.</p>
576+
577+
<p>The CSS regions specification does not define a layout mechanism and is
578+
meant to integrate with existing and future CSS layout facilities.</p>
579+
</div>
580+
581+
<p>However, there is no existing mechanism to associate the content with
582+
the regions so that content flows as intended. Figure 2 shows an example
583+
of the intended visual rendering of the content.
550584

551585
<div class=figure> <img
552586
alt="Sample rendering showing a single thread of text flowing through a chain of regions"
@@ -555,8 +589,18 @@ <h3 id=named-flows-and-regions><span class=secno>1.1. </span>Named flows
555589
</div>
556590

557591
<p>The CSS regions module is independent of the layout of regions and the
558-
mechanism used to create them. However, for simplicity, our example uses
559-
elements as regions as shown in the previous code snippet.
592+
mechanism used to create them. For simplicity, our example uses elements
593+
as regions as shown in the previous code snippet.
594+
595+
<div class=note>
596+
<p>While the example uses elements as regions, it is important to note
597+
that this is not required for regions. Regions can be pseudo-elements,
598+
such as &lsquo;<code class=css>::before</code>&rsquo; and &lsquo;<code
599+
class=css>::after</code>&rsquo;. The only requirement for an element or
600+
pseudo-element to become a region is that it needs to be subject to CSS
601+
styling to receive the &lsquo;<a href="#flow-from"><code
602+
class=property>flow-from</code></a>&rsquo; property.</p>
603+
</div>
560604

561605
<p>The following code example illustrates how the content of the
562606
<code>article</code> element becomes a flow and how the areas &lsquo;<code
@@ -641,6 +685,16 @@ <h3 id=region-styling><span class=secno>1.2. </span>Regions styling</h3>
641685
padding: 0px;
642686
}
643687
<strong>}</strong>
688+
689+
690+
/*
691+
* Style that would apply to region1's normal content but
692+
* will not apply to its named flow content.
693+
*/
694+
#region1 p {
695+
color: red;
696+
}
697+
644698
&lt;/style&gt;
645699
</pre>
646700
</div>
@@ -658,6 +712,15 @@ <h3 id=region-styling><span class=secno>1.2. </span>Regions styling</h3>
658712
<p class=caption>Different rendering with a different region styling</p>
659713
</div>
660714

715+
<p>Finally, note how the &lsquo;<code class=property>red</code>&rsquo;
716+
color specified for <code>&lt;p&gt;</code> elements under
717+
<code>#region1</code> does not apply to content that flows into the
718+
region. This specified style does not apply to the named flow content
719+
because the <code>&lt;p&gt;</code> elements in the &lsquo;<code
720+
class=property>article</code>&rsquo; named flow are not descendants of the
721+
<code>#region1</code> element and, consequently, the <code>"#region1
722+
p"</code> selector does not apply to these elements.
723+
661724
<h2 id=css-regions-concepts><span class=secno>2. </span>CSS regions
662725
concepts</h2>
663726

@@ -2161,6 +2224,9 @@ <h3 id="changes_from_June_09_2011"><span class=secno>10.1. </span>Changes
21612224

21622225
<li>Modified wording about containing block resolution for absolutely
21632226
positioned elements in a named flow.
2227+
2228+
<li>Modified initial examples as per <a
2229+
href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15131">Bug 15131</a>
21642230
</ul>
21652231

21662232
<h3 id="changes_from_June_09_2011"><span class=secno>10.2. </span>Changes

css3-regions/Overview.src.html

Lines changed: 67 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,16 +392,47 @@ <h3 id="named-flows-and-regions">Named flows and regions</h3>
392392

393393
</pre>
394394

395-
<p>And the following snippet shows an example of elements that will be used
396-
as regions.</p>
395+
<p>And the following snippet shows an example using grid cells to
396+
define the region areas:</p>
397397
<pre>
398-
&lt;div id="region1"&gt;&lt;/div&gt;
399-
&lt;div id="region2"&gt;&lt;/div&gt;
400-
&lt;div id="region3"&gt;&lt;/div&gt;
401-
&lt;div id="region4"&gt;&lt;/div&gt;
398+
&lt;style&gt;
399+
#page {
400+
width: 800px;
401+
height: 600px;
402+
grid-template: "aaa.e"
403+
"....e"
404+
"bbb.e"
405+
"....e"
406+
"c.d.e";
407+
grid-rows: 52% 4% 20% 4% 20%;
408+
grid-columns: 30% 5% 30% 5% 30%;
409+
}
410+
#regionA { grid-cell: a; }
411+
#region1 { grid-cell: b; }
412+
#region2 { grid-cell: c; }
413+
#region3 { grid-cell: d; }
414+
#region4 { grid-cell: e; }
415+
&lt;/style&gt;
416+
417+
&lt;div id="page"&gt;
418+
&lt;div id="region1"&gt;&lt;/div&gt;
419+
&lt;div id="region2"&gt;&lt;/div&gt;
420+
&lt;div id="region3"&gt;&lt;/div&gt;
421+
&lt;div id="region4"&gt;&lt;/div&gt;
422+
&lt;/div&gt;
402423
</pre>
403424

404-
<p>CSS layout facilities can position and size regions as needed. However,
425+
<p>Any of the CSS layout facilities can be used to create, position and size regions
426+
as needed.</p>
427+
428+
<div class="note">
429+
<p>Using a grid layout (see [[CSS3-GRID-LAYOUT]] is just an example.
430+
The example could use a flexible box layout as well, see [[CSS3-FLEXBOX]].</p>
431+
<p>The CSS regions specification does not define a layout mechanism and is meant
432+
to integrate with existing and future CSS layout facilities.</p>
433+
</div>
434+
435+
<p>However,
405436
there is no existing mechanism to associate the content with the regions so
406437
that content flows as intended. Figure 2 shows an example of the intended
407438
visual rendering of the content.</p>
@@ -414,9 +445,18 @@ <h3 id="named-flows-and-regions">Named flows and regions</h3>
414445
</div>
415446

416447
<p>The CSS regions module is independent of the layout of regions and
417-
the mechanism used to create them. However, for simplicity, our example
448+
the mechanism used to create them. For simplicity, our example
418449
uses elements as regions as shown in the previous code snippet.</p>
419450

451+
452+
<div class="note">
453+
<p>While the example uses elements as regions, it is important to note that
454+
this is not required for regions. Regions can be pseudo-elements,
455+
such as '::before' and '::after'. The only requirement for an element
456+
or pseudo-element to become a region is that it needs to be subject to
457+
CSS styling to receive the 'flow-from' property.</p>
458+
</div>
459+
420460
<p>The following code example illustrates how the content of the <code>article</code>
421461
element becomes a flow and how the areas 'region1', 'region2', 'region3'
422462
and 'region4' become regions that consume the 'article_flow' content.</p>
@@ -491,6 +531,16 @@ <h3 id="region-styling">Regions styling</h3>
491531
padding: 0px;
492532
}
493533
<strong>}</strong>
534+
535+
536+
/*
537+
* Style that would apply to region1's normal content but
538+
* will not apply to its named flow content.
539+
*/
540+
#region1 p {
541+
color: red;
542+
}
543+
494544
&lt;/style&gt;
495545
</pre>
496546
</div>
@@ -508,6 +558,14 @@ <h3 id="region-styling">Regions styling</h3>
508558
<p class="caption">Different rendering with a different region
509559
styling</p>
510560
</div>
561+
562+
<p>Finally, note how the 'red' color specified for <code>&lt;p&gt;</code>
563+
elements under <code>#region1</code> does not apply to content that
564+
flows into the region. This specified style does not apply to
565+
the named flow content because the <code>&lt;p&gt;</code> elements
566+
in the 'article' named flow are not descendants of the <code>#region1</code>
567+
element and, consequently, the <code>"#region1 p"</code> selector does
568+
not apply to these elements.</p>
511569

512570
<h2 id="css-regions-concepts">CSS regions concepts</h2>
513571

@@ -1846,6 +1904,7 @@ <h3 id="changes_from_June_09_2011">Changes from <a href="http://www.w3.org/TR/20
18461904
per <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15828">Bug 15828</a>.</li>
18471905
<li>Modified wording about containing block resolution for absolutely positioned elements in a
18481906
named flow.</li>
1907+
<li>Modified initial examples as per <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15131">Bug 15131</a></li>
18491908
</ul>
18501909

18511910

0 commit comments

Comments
 (0)