Skip to content

Commit 00a1e12

Browse files
committed
Reworded the description of the dependency graph for element() to make it more obvious that it's declarative. Added a clause about host-language elements that depend on other things.
1 parent dd73ace commit 00a1e12

2 files changed

Lines changed: 32 additions & 17 deletions

File tree

css3-images/Overview.html

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
209209
<ul class=toc>
210210
<li class=no-num><a href="#paint-sources"> Paint Sources</a>
211211

212-
<li class=no-num><a href="#element-cycles"> Circular References</a>
212+
<li class=no-num><a href="#element-cycles"> Cycle Detection</a>
213213
</ul>
214214
</ul>
215215

@@ -847,22 +847,32 @@ <h4 class=no-num id=paint-sources> Paint Sources</h4>
847847
</dl>
848848
<!-- ====================================================================== -->
849849

850-
<h4 class=no-num id=element-cycles> Circular References</h4>
850+
<h4 class=no-num id=element-cycles> Cycle Detection</h4>
851851

852852
<p>The &lsquo;<code class=css>element()</code>&rsquo; function can produce
853853
nonsensical circular relationships, such as an element using itself as its
854854
own background. These relationships can be easily and reliably detected
855855
and resolved, however, by keeping track of a dependency graph and using
856856
common cycle-detection algorithms.
857857

858-
<p>Populate the dependency graph initially by having every element depend
859-
on each of its children. Then, whenever a property on an element A uses
860-
the &lsquo;<code class=css>element()</code>&rsquo; function to refer to an
861-
element B, add an edge to the graph by having A depend on B. If a
862-
dependency cycle is detected, any &lsquo;<code
863-
class=css>element()</code>&rsquo; functions that produced a dependency in
864-
the cycle must represent a fully transparent image with no intrinsic
865-
dimensions.
858+
<p>The dependency graph consists of edges such that:
859+
860+
<ul>
861+
<li>every element depends on its children
862+
863+
<li>for any element A with a property using the &lsquo;<code
864+
class=css>element()</code>&rsquo; function pointing to an element B, A
865+
depends on B
866+
867+
<li>if a host language defines a way for elements to refer to the
868+
rendering of other elements, the referencing element depends on the
869+
referenced element. For example, in SVG, a &lt;use> element depends on
870+
the element it referenced.
871+
</ul>
872+
873+
<p>If the graph contains a cycle, any &lsquo;<code
874+
class=css>element()</code>&rsquo; functions participating in the cycle
875+
must represent a fully transparent image with no intrinsic dimensions.
866876

867877
<p class=issue>Someone else needs to review this and make sure that I'm not
868878
missing any cycles.

css3-images/Overview.src.html

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,19 +461,24 @@ <h4 id='paint-sources' class='no-num'>
461461
<!-- ====================================================================== -->
462462

463463
<h4 class="no-num" id='element-cycles'>
464-
Circular References</h4>
464+
Cycle Detection</h4>
465465

466466
<p>The ''element()'' function can produce nonsensical circular relationships,
467467
such as an element using itself as its own background. These relationships
468468
can be easily and reliably detected and resolved, however, by keeping
469469
track of a dependency graph and using common cycle-detection algorithms.</p>
470470

471-
<p>Populate the dependency graph initially by having every element depend
472-
on each of its children. Then, whenever a property on an element A uses
473-
the ''element()'' function to refer to an element B, add an edge to the
474-
graph by having A depend on B. If a dependency cycle is detected, any
475-
''element()'' functions that produced a dependency in the cycle must represent
476-
a fully transparent image with no intrinsic dimensions.</p>
471+
<p>The dependency graph consists of edges such that:</p>
472+
473+
<ul>
474+
<li>every element depends on its children</li>
475+
476+
<li>for any element A with a property using the ''element()'' function pointing to an element B, A depends on B</li>
477+
478+
<li>if a host language defines a way for elements to refer to the rendering of other elements, the referencing element depends on the referenced element. For example, in SVG, a &lt;use> element depends on the element it referenced.</li>
479+
</ul>
480+
481+
<p>If the graph contains a cycle, any ''element()'' functions participating in the cycle must represent a fully transparent image with no intrinsic dimensions.</p>
477482

478483
<p class=issue>Someone else needs to review this and make sure that I'm
479484
not missing any cycles.</p>

0 commit comments

Comments
 (0)