Skip to content

Commit 60ce3dc

Browse files
committed
Improved the processing model example section
1 parent a58d0d6 commit 60ce3dc

2 files changed

Lines changed: 76 additions & 93 deletions

File tree

css3-exclusions/Exclusions.src.html

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ <h2 id="intro">Introduction</h2>
187187

188188
<h2 id="definitions">Definitions</h2>
189189

190-
<dfn>Exclusion element</dfn>
190+
<dfn>Exclusion box</dfn>
191191

192192
<p>
193-
An element that defines an <span>exclusion area</span> for other elements. The 'wrap-flow'
194-
property is used to make an element an exclusion element. An exclusion element contributes
193+
An box that defines an <span>exclusion area</span> for other boxes. The 'wrap-flow'
194+
property is used to make an element's generated box an exclusion box. An exclusion box contributes
195195
its <span>exclusion area</span> to its <a href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">
196196
containing block's</a> <span>wrapping context</span>
197197
</p>
@@ -222,22 +222,22 @@ <h2 id="definitions">Definitions</h2>
222222
</div>
223223

224224
<p>
225-
The wrapping context of an element is a collection of 'exclusion areas'. The wrapping
226-
context is used to wrap around inline flow content during layout. An element will
225+
The wrapping context of an box is a collection of 'exclusion areas'. The wrapping
226+
context is used to wrap around inline flow content during layout. A box will
227227
wrap its inline flow content in the area that corresponds to the subtraction of
228228
its wrapping context from its own <span>content area</span>.
229229
</p>
230230

231231
<p>
232-
An element inherits its
232+
A box inherits its
233233
<a href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">containing block's</a>
234234
wrapping context unless it specifically
235235
resets it using the 'wrap-through' property.
236236
</p>
237237

238238
<dfn>Content area</dfn>
239239
<p>
240-
The area used for layout of the inline flow content of an element. By default the
240+
The area used for layout of the inline flow content of a box. By default the
241241
area is equivalent to the <a href="http://www.w3.org/TR/CSS2/box.html#box-dimensions">content box</a>.
242242
This specification's 'shape-inside' property can define arbitrary, non-rectangular content areas.
243243
</p>
@@ -786,7 +786,7 @@ <h4 id="exclusions-processing-model-example">Example</h4>
786786

787787

788788
<p>The code snippet in the following example has two exclusions affecting
789-
the document's in-line content.</p>
789+
the document's inline content.</p>
790790

791791
<div class="example">
792792
<pre class="code idl">
@@ -810,23 +810,17 @@ <h4 id="exclusions-processing-model-example">Example</h4>
810810

811811
<ul>
812812
<li>the document's DOM tree</li>
813-
<li>the boxes generated by block elements in the tree</li>
814-
<li>the layout tree for block boxes</p>
813+
<li>the layout tree of generated block boxes</p>
815814
</ul>
816815

817816
<div class="figure">
818817
<img src="images/processing-model-example-dom.svg" width="200" />
819818
<p class="caption">DOM tree</p>
820819
</div>
821820

822-
<div class="figure">
823-
<img src="images/processing-model-example-block-boxes.svg" width="400" />
824-
<p class="caption">Boxes of block elements</p>
825-
</div>
826-
827821
<div class="figure">
828822
<img src="images/processing-model-example-layout-tree.svg" width="250" />
829-
<p class="caption">Layout tree for block boxes</p>
823+
<p class="caption">Layout tree of generated block boxes</p>
830824
</div>
831825

832826
<p>The figures illustrate how the boxes corresponding to the element sometimes
@@ -841,7 +835,7 @@ <h4 id="exclusions-processing-model-example">Example</h4>
841835
<h5>Step 1: resolve exclusion boxes belonging to each wrapping context</h5>
842836

843837
<p>As a result of the computation of containing blocks for the tree, the boxes belonging
844-
to the wrapping contexts of all the elements can be computed:</p>
838+
to the wrapping contexts of all the elements can be determined:</p>
845839

846840
<ul>
847841
<li>The wrapping context for the html element contains the <code class="idl">e2</code> box: WC-1 (Wrapping Context 1)</li>
@@ -865,8 +859,7 @@ <h5>Step 2: resolve wrapping contexts and layout containing blocks</h5>
865859

866860
<p>In our example, this breaks down to:</p>
867861
<ol>
868-
<li>resolve the position and size of the exclusions belonging to the wrapping context. We call this
869-
step 'resolve the wrapping context'. Let's call the initial containing block's wrapping context RWC-1 (Resolved Wrapping Context 1).</li>
862+
<li>resolve the position and size of the exclusions belonging to WC-1: RWC-1 (Resolved Wrapping Context 1).</li>
870863
<li>layout the initial containing block (i.e., layout its content):
871864
<ol>
872865
<li>resolve the html element's wrapping context: RWC-1</li>
@@ -887,35 +880,35 @@ <h5>Step 2: resolve wrapping contexts and layout containing blocks</h5>
887880
</li>
888881
</ol>
889882

890-
<h6>Computing RWC-1</h6>
883+
<h6>Resolving RWC-1</h6>
891884

892-
<p>The top most wrapping context, in the layout tree, contains the <code class="idl">e2</code>
893-
exclusion. Its position and size needs to be computed. In general, computing an
885+
<p>The top-most wrapping context in the layout tree contains the <code class="idl">e2</code>
886+
exclusion. Its position and size needs to be resolved. In general, computing an
894887
exclusion's position and size may or may not require laying out other content.
895-
In our example, no content needs to be laid out to compute the <code class="idl">e2</code>
896-
exclusion's position because it is absolutely positioned and its size can be computed
897-
without layout either. At this point, RWC-1 is resolved and can be used during
898-
layout of inline content.</p>
888+
In our example, no content needs to be laid out to resolve the <code class="idl">e2</code>
889+
exclusion's position because it is absolutely positioned and its size can be resolved
890+
without layout either. At this point, RWC-1 is resolved and can be used when
891+
laying inline content out.</p>
899892

900-
<h6>Computing RWC-2</h6>
893+
<h6>Resolving RWC-2</h6>
901894

902895
<p>The process is similar: the position of the
903-
<code class="idl">e1</code>exclusion needs to be computed. Again, computing the exclusion's
896+
<code class="idl">e1</code>exclusion needs to be resolved. Again, resolving the exclusion's
904897
position and size may require processing the containing block (d1 here).
905898
It is the case here because the size and position of
906899
<code class="idl">e1</code> depend on resolving the percentage lengths. The percentages are relative
907900
to the size of
908-
<code class="idl">d1</code>'s box. As a result, in order to compute
901+
<code class="idl">d1</code>'s box. As a result, in order to resolve
909902
a size for <code class="idl">d1</code>'s box, a first layout of <code class="idl">d1</code>
910-
is done with an empty wrapping context. The layout yields a
903+
is done without any wrapping context (i.e., no exclusions applied). The layout yields a
911904
position and size for <code class="idl">e1</code>'s box.
912905
</p>
913906
<p>At this point, RWC-2 is resolved because the position and size of both
914-
e1 and e2 and computed.</p>
907+
e1 and e2 are resolved.</p>
915908

916909
<p class="note">The important aspect of the above processing example is that once an element's wrapping context
917-
is resolved (by computing its exclusions' position and size), the position and size of the
918-
exclusions are not recomputed if the element's size changes between the layout that may be done with
910+
is resolved (by resolving its exclusions' position and size), the position and size of the
911+
exclusions are not re-processed if the element's size changes between the layout that may be done with
919912
an empty wrapping context (as for RWC-2) and the layout done with the resolved wrapping context.
920913
This is what breaks the possible circular dependency between the resolution of wrapping contexts
921914
and the layout of containing blocks.</p>

0 commit comments

Comments
 (0)