Skip to content

Commit 60a2019

Browse files
committed
Removed paragraph about inheritance-blocking in element(); replaced it with two paragraphs in Paint Sources about this case, why it's difficult, and a recommendation.
1 parent 0d2f9a4 commit 60a2019

2 files changed

Lines changed: 26 additions & 16 deletions

File tree

css3-images/Overview.html

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616

1717
<h1>CSS Image Values and Replaced Content Module Level 3</h1>
1818

19-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 27 February
19+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 28 February
2020
2012</h2>
2121

2222
<dl>
2323
<dt>This Version:
2424

2525
<dd><a
2626
href="http://dev.w3.org/csswg/css3-images/">http://dev.w3.org/csswg/css3-images/</a>
27-
<!-- <dd><a href="http://www.w3.org/TR/2012/ED-css3-images-20120227/">http://www.w3.org/TR/2012/WD-css3-images-20120227/</a>-->
27+
<!-- <dd><a href="http://www.w3.org/TR/2012/ED-css3-images-20120228/">http://www.w3.org/TR/2012/WD-css3-images-20120228/</a>-->
2828

2929

3030
<dt>Latest Version:
@@ -722,16 +722,6 @@ <h3 id=element-reference><span class=secno>3.3. </span> Using Elements as
722722
The host language defines the dimensions and appearance of paint
723723
sources.</p>
724724

725-
<p>If any properties on the element would inherit their value from the
726-
element's parent, they must instead be set to their initial value.</p>
727-
728-
<p class=note>Note: even if the property that caused the element to not
729-
be rendered was inherited, and switching off that inheritance would
730-
cause the element to be rendered again, by this point we're not relying
731-
on the rendered appearance of the element, but rather on the paint
732-
source it provides, which is layout-independent. Thus, there is no
733-
circular dependency created.</p>
734-
735725
<div class=example>
736726
<p>For example, the &lsquo;<code class=css>element()</code>&rsquo;
737727
function can reference an SVG &lt;pattern> element in an HTML document:</p>
@@ -905,6 +895,26 @@ <h4 class=no-num id=paint-sources> Paint Sources</h4>
905895
are sized equivalently to the CSS &lsquo;<code class=css>px</code>&rsquo;
906896
unit.
907897
</dl>
898+
899+
<p>Because paint sources have an intrinsic appearance, it's not necessary
900+
for the element providing them to be in a document - for example, one can
901+
simply create an element with JavaScript and directly assign it to the
902+
CSSElementMap in HTML. However, some paint sources (such as an SVG
903+
<code>&lt;pattern></code>) depend on style information for their
904+
appearance, and it's currently largely undefined how styling information
905+
is assigned to an element fragment that's not part of a document. (For
906+
example, does the fragment receive styles from the active document? What
907+
if it has its own <code>&lt;style></code> or <code>&lt;link
908+
rel=stylesheet></code> in it?) This specification explicitly does not
909+
define how such a fragment is styled; it is expected that CSS will define
910+
it in sufficient detail in the future.
911+
912+
<p>For now, it is recommended that such fragments be inserted into a
913+
document before being referenced. For example, a <code>&lt;pattern></code>
914+
element may be placed into a &lsquo;<code
915+
class=css>display:none</code>&rsquo; <code>&lt;svg></code> element's
916+
<code>&lt;defs></code> element within a document; this has no rendering or
917+
layout effects on the document, but the style inheritance is well-defined.</p>
908918
<!-- ====================================================================== -->
909919

910920
<h4 class=no-num id=element-cycles> Cycle Detection</h4>

css3-images/Overview.src.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,6 @@ <h3 id='element-reference'>
349349
<dd>
350350
<p>The function represents an image with the dimensions and appearance of the <i title=paint-source>paint source</i>. The host language defines the dimensions and appearance of paint sources.</p>
351351

352-
<p>If any properties on the element would inherit their value from the element's parent, they must instead be set to their initial value.</p>
353-
354-
<p class='note'>Note: even if the property that caused the element to not be rendered was inherited, and switching off that inheritance would cause the element to be rendered again, by this point we're not relying on the rendered appearance of the element, but rather on the paint source it provides, which is layout-independent. Thus, there is no circular dependency created.</p>
355-
356352
<div class='example'>
357353
<p>For example, the ''element()'' function can reference an SVG &lt;pattern> element in an HTML document:</p>
358354

@@ -475,6 +471,10 @@ <h4 id='paint-sources' class='no-num'>
475471
<dd>The coordinate system has its origin at the top left corner of the <i>concrete object size</i> it's being drawn into, and the same width and height as the <i>concrete object size</i>. <a href="http://www.w3.org/TR/SVG/coords.html#Units">User coordinates</a> are sized equivalently to the CSS ''px'' unit.</dd>
476472
</dl>
477473

474+
<p>Because paint sources have an intrinsic appearance, it's not necessary for the element providing them to be in a document - for example, one can simply create an element with JavaScript and directly assign it to the CSSElementMap in HTML. However, some paint sources (such as an SVG <code>&lt;pattern></code>) depend on style information for their appearance, and it's currently largely undefined how styling information is assigned to an element fragment that's not part of a document. (For example, does the fragment receive styles from the active document? What if it has its own <code>&lt;style></code> or <code>&lt;link rel=stylesheet></code> in it?) This specification explicitly does not define how such a fragment is styled; it is expected that CSS will define it in sufficient detail in the future.</p>
475+
476+
<p>For now, it is recommended that such fragments be inserted into a document before being referenced. For example, a <code>&lt;pattern></code> element may be placed into a ''display:none'' <code>&lt;svg></code> element's <code>&lt;defs></code> element within a document; this has no rendering or layout effects on the document, but the style inheritance is well-defined.</p>
477+
478478
<!-- ====================================================================== -->
479479

480480
<h4 class="no-num" id='element-cycles'>

0 commit comments

Comments
 (0)