- From: Tab Atkins Jr.. via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 11 Nov 2011 03:29:08 +0000
- To: public-css-commits@w3.org
Update of /sources/public/csswg/css3-images In directory hutz:/tmp/cvs-serv16079 Modified Files: Overview.html Overview.src.html Log Message: Added an element() example for the non-rendered or replaced-descendant case. Index: Overview.html =================================================================== RCS file: /sources/public/csswg/css3-images/Overview.html,v retrieving revision 1.208 retrieving revision 1.209 diff -u -d -r1.208 -r1.209 --- Overview.html 11 Nov 2011 03:20:19 -0000 1.208 +++ Overview.html 11 Nov 2011 03:29:06 -0000 1.209 @@ -676,8 +676,41 @@ <dt>The function references an element that is a descendant of a replaced element - <dd>The function represents a solid-color transparent-black image with no - intrinsic dimensions. + <dd> + <p>The function represents a solid-color transparent-black image with no + intrinsic dimensions.</p> + + <div class=example> + <p>For example, all of the following ‘<code + class=css>element()</code>’ uses will result in a transparent + background:</p> + + <pre> +<!DOCTYPE html> +<script> +var p = document.createElement('p'); +p.textContent = "one"; +document.CSSElementMap.one = p; +</script> +<p id='two' style="display:none;">two</p> +<iframe src="http://example.com"> + <p id='three'>I'm fallback content!</p> +</iframe> +<ul> + <li style="background: element(one);"> + A P element doesn't represent a paint source, + and it's not rendered unless it's in a document. + </li> + <li style="background: element(#two);"> + Similarly, a display:none element isn't rendered, and + P still doesn't represent a paint source. + </li> + <li style="background: element(#three);"> + The descendants of a replaced element like an IFRAME + can't be used in ''element()'' either. + </li> +</ul></pre> + </div> <dt>Otherwise Index: Overview.src.html =================================================================== RCS file: /sources/public/csswg/css3-images/Overview.src.html,v retrieving revision 1.216 retrieving revision 1.217 diff -u -d -r1.216 -r1.217 --- Overview.src.html 11 Nov 2011 03:20:20 -0000 1.216 +++ Overview.src.html 11 Nov 2011 03:29:06 -0000 1.217 @@ -351,7 +351,39 @@ <dt>The function references an element that is not rendered</dt> <dt>The function references an element that is a descendant of a replaced element</dt> - <dd>The function represents a solid-color transparent-black image with no intrinsic dimensions.</dd> + <dd> + <p>The function represents a solid-color transparent-black image with no intrinsic dimensions.</p> + + <div class='example'> + <p>For example, all of the following ''element()'' uses will result in a transparent background:</p> + + <pre> +<!DOCTYPE html> +<script> +var p = document.createElement('p'); +p.textContent = "one"; +document.CSSElementMap.one = p; +</script> +<p id='two' style="display:none;">two</p> +<iframe src="http://example.com"> + <p id='three'>I'm fallback content!</p> +</iframe> +<ul> + <li style="background: element(one);"> + A P element doesn't represent a paint source, + and it's not rendered unless it's in a document. + </li> + <li style="background: element(#two);"> + Similarly, a display:none element isn't rendered, and + P still doesn't represent a paint source. + </li> + <li style="background: element(#three);"> + The descendants of a replaced element like an IFRAME + can't be used in ''element()'' either. + </li> +</ul></pre> + </div> + </dd> <dt>Otherwise</dt> <dd>
Received on Friday, 11 November 2011 03:29:15 UTC