Skip to content

Commit

Permalink
[Issue WICG#128, WICG#289] Clean up distribution section.
Browse files Browse the repository at this point in the history
  • Loading branch information
hayatoito authored and kojiishi committed Sep 7, 2015
1 parent 4850b1d commit 0454690
Showing 1 changed file with 0 additions and 158 deletions.
158 changes: 0 additions & 158 deletions spec/shadow/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -301,145 +301,7 @@ <h3>Slots</h3>

</section>

<section>
<h3>Distribution Results</h3>

<p>Each <a>tree of trees</a> has the <dfn>distribution result</dfn> which describes the result of distributions.
The <a>distribution result</a> <strong>must</strong> be <a lt="processing equivalence">equivalent</a> of the following:</p>
<ol>
<li>Each <a>slot</a> has an ordered list, called <dfn>distributed nodes</dfn>, which consists of nodes which are distributed into the <a>insertion point</a>.</li>
<li>Each <a>node</a> that is not a <a>slpt</a> has an ordered list, called <dfn>destination insertion points</dfn>, which consists of <a lt="insertion point">insertion points</a> to where the <a>node</a> is distributed</li>
</ol>

<p>An <a>insertion point</a> <var>A</var> is the <dfn>final destination</dfn> of a <a>node</a> <var>B</var> if <var>A</var> is the last item of the <a>destination insertion points</a> of <var>B</var>.</p>

<p>When a <a>node</a> <var>A</var> is <dfn lt="distributes">distributed</dfn> into an <a>insertion point</a> <var>B</var>, the following steps <strong>must</strong> happen:</p>
<ul>
<li>Add <var>A</var> to the <a>distributed nodes</a> of <var>B</var></li>
<li>Add <var>B</var> to the <a>destination insertion points</a> of <var>A</var></li>
</ul>

<div class="note">
<p>One case that deserves special consideration is the situation when an <a>insertion point</a> is a child <a>node</a> of another <a>shadow host</a>. In such situations, the <a lt="node">nodes</a> <a lt="distributes">distributed</a> into that <a>insertion point</a> appear as if they were child <a lt="node">nodes</a> of the <a>shadow host</a> in the context of <a>distribution</a>. Thus, the <a lt="node">nodes</a> <a lt="distributes">distributed</a> to a <a>shadow tree</a> could have already been <a lt="distributes">distributed</a> from its parent tree.</p>

<p>Despite being distributed to more than one insertion point, a node still only appears once in the composed tree at the final destination.</p>
</div>

<figure>
<object data="../../assets/images/re-distributions.svg" width="693" height="822"></object>
<figcaption>A re-distribution.
In the figure, a node <em>child 1</em> is distributed into <em>insertion point 1</em>. Then <em>child1</em> is re-distributed into <em>insertion point 3</em>.
The destination insertion points of <em>child 1</em> is [<em>insertion point 1</em>, <em>insertion point 3</em>] and <em>insertion point 3</em> is the final destination of <em>child 1</em>.
The distributed nodes of <em>insertion point 1</em> and <em>insertion point 3</em> is [<em>child 1</em>] and [<em>child 1</em>, <em>child 3</em>], respectively.
</figcaption>
</figure>

</section>

<section>
<h3>Distribution Algorithms</h3>

<p>The <dfn>distribution algorithm</dfn> <strong>must</strong> be used to determine the <a>distribution result</a> for a <a>tree of trees</a> and <strong>must</strong> be <a lt="processing equivalence">equivalent</a> to processing the following steps:</p>

<div class="algorithm">
<dl>
<dt>Input</dt>
<dd><var>TREE-OF-TREES</var>, a <a>tree of trees</a></dd>
<dt>Output</dt>
<dd>The <a>distribution result</a> of <var>TREE-OF-TREES</var> is updated</dd>
</dl>
<ol>
<li>Let all <a>distributed nodes</a> and <a>destination insertion points</a> owned by <a lt="node">nodes</a> in <var>TREE-OF-TREES</var> be empty</li>
<li>Let <var>ROOT-TREE</var> be the <a>root tree</a> of <var>TREE-OF-TREES</var></li>
<li>Run the <a>distribution resolution algorithm</a> with <var>ROOT-TREE</var> as input</li>
</ol>
</div>

<p>The <dfn>distribution resolution algorithm</dfn> <strong>must</strong> be used to determine the <a>distribution result</a> for a given <a>node tree</a> and its <a lt="descendant tree">descendant trees</a>, and <strong>must</strong> be <a lt="processing equivalence">equivalent</a> to processing the following steps:</p>

<div class="algorithm">
<dl>
<dt>Input</dt>
<dd><var>NODE-TREE</var>, a <a>node tree</a></dd>
<dt>Output</dt>
<dd>The <a>distribution result</a> is updated for the <a lt="inclusive descendant tree">inclusive descendant trees</a> of <var>NODE-TREE</var></dd>
</dl>

<ol>
<li>For each <a>shadow host</a>, <var>SHADOW-HOST</var>, which participates in <var>NODE-TREE</var>, in <a>tree order</a>:
<ol>
<li>Let <var>POOL</var> be the result of the <a>pool population algorithm</a> with <var>SHADOW-HOST</var> as input</li>
<li>Let <var>SHADOW-TREE</var> be the <a>shadow tree</a> which <var>SHADOW_HOST</var> hosts</li>
<li>Run the <a>pool distribution algorithm</a> with <var>SHADOW-TREE</var> and <var>POOL</var> as input</li>
<li>Run the <a>distribution resolution algorithm</a>, recursively, with <var>SHADOW-TREE</var> as input</li>
</ol>
</ol>
</div>

<p>The <dfn>pool population algorithm</dfn> <strong>must</strong> be used to populate <a lt="node">nodes</a> from the child <a lt="node">nodes</a> of a given <a>node</a> and <strong>must</strong> be <a lt="processing equivalence">equivalent</a> to processing the following steps:</p>

<div class="algorithm">
<dl>
<dt>Input</dt>
<dd><var>NODE</var>, a node</dd>
<dt>Output</dt>
<dd><var>POOL</var>, an ordered list of nodes</dd>
</dl>

<ol>
<li>Let <var>POOL</var> be an empty ordered list.</li>
<li>For each child <a>node</a>, <var>CHILD</var>, of <var>NODE</var>:
<ol>
<li>If <var>CHILD</var> is an <a>insertion point</a>:
<ol>
<li>Add all <a lt="node">nodes</a> in the <a>distributed nodes</a> of <var>CHILD</var> to <var>POOL</var></li>
</ol></li>
<li>Otherwise:
<ol>
<li>Add <var>CHILD</var> to <var>POOL</var></li>
</ol></li>
</ol></li>
</ol>
</div>

<p>The <dfn>pool distribution algorithm</dfn> <strong>must</strong> be used to distribute <a lt="node">nodes</a> in a pool into the <a lt="content insertion point">content insertion points</a> in a <a>shadow tree</a> and <strong>must</strong> be <a lt="processing equivalence">equivalent</a> to processing the following steps:</p>

<div class="algorithm">
<dl>
<dt>Input</dt>
<dd><var>SHADOW-TREE</var>, a shadow tree</dd>
<dd><var>POOL</var>, an ordered list of nodes</dd>
<dt>Output</dt>
<dd>Nodes in POOL are distributed into the content insertion points in the tree.</dd>
</dl>

<ol>
<li>For each <a>content insertion point</a>, <var>CONTENT</var>, which participates in <var>SHADOW-TREE</var>, in tree order:
<ol>
<li>For each <a>node</a>, <var>NODE</var>, in <var>POOL</var>
<ol>
<li>If <var>NODE</var> satisfies <var>CONTENT</var>'s matching criteria:
<ol>
<li><a lt="distributes">Distribute</a> <var>NODE</var> into <var>CONTENT</var></li>
<li>Remove <var>NODE</var> from <var>POOL</var></li>
</ol></li>
</ol></li>
<li>If no <a lt="node">nodes</a> are distributed to <var>CONTENT</var>:
<ol>
<li>For each child, <var>CHILD</var>, of <var>CONTENT</var>
<ol>
<li><a lt="distributes">Distribute</a> <var>CHILD</var> into <var>CONTENT</var></li>
</ol></li>
</ol></li>
</ol></li>
</ol>

</div>

<p class="note">If no nodes are distributed into a <a>content insertion point</a> <var>CONTENT</var>, the child <a lt="node">nodes</a> of <var>CONTENT</var> are distributed into <var>CONTENT</var> as fallback nodes.</p>

<p>If any condition which affects the <a>distribution result</a> changes, the <a>distribution result</a> <strong>must</strong> be updated before any use of the <a>distribution result</a>.</p>

<p>
The <dfn>slottings algorithm</dfn> <strong>must</strong> be used to determine an assigned slot for a node and <strong>must</strong> be <a lt="processing equivalence">equivalent</a> to processing the following steps:
</p>
Expand Down Expand Up @@ -524,26 +386,6 @@ <h3>Distribution Algorithms</h3>

</section>

<section>
<h3>Satisfying Matching Criteria</h3>

<p>The <dfn>matching criteria</dfn> for an <a>insertion point</a> is a set of <a lt="compound selector">compound selectors</a> [[!SELECTORS4]]. These <a lt="compound selector">compound selectors</a> are restricted to contain only these <a lt="simple selector">simple selectors</a>:</p>

<ul>
<li>A <a>type selector</a> or a <a>universal selector</a></li>
<li><a lt="class selector">class selector(s)</a></li>
<li>An <a>ID selector</a></li>
<li><a lt="attribute selector">attribute selector(s)</a></li>
<li>A <a>negation pseudo-class</a>, <code>:not()</code></li>
</ul>

<p>A <a>node</a> <dfn lt="satisfies-matching-criteria">satisfies</dfn> a <a>matching criteria</a> only if:</p>
<ol>
<li>all <a lt="compound selector">compound selectors</a> in the set, contain only the <a lt="simple selector">simple selectors</a> specified above; and</li>
<li>a <a>node</a> matches at least one <a lt="compound selector">compound selectors</a> in the set or the set is empty.</li>
</ol>
</section>

</section>

<section>
Expand Down

0 comments on commit 0454690

Please sign in to comment.