before-after-dynamic-attr-001.xht (1015B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait"><head> 2 <title>CSS Test: generated content</title> 3 <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" /> 4 <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" /> 5 <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#content" /> 6 <link rel="match" href="before-after-dynamic-attr-001-ref.xht"/> 7 <meta name="flags" content="dom" /> 8 <style type="text/css"> 9 body { 10 font-family:sans-serif; 11 } 12 body:before { 13 content:attr(my-attr); 14 } 15 body:after { 16 content:attr(my-attr-2); 17 } 18 </style> 19 <script type="text/javascript"> 20 function fixupDOM() { 21 document.body.setAttribute("my-attr", "before"); 22 document.body.setAttribute("my-attr-2", "after!"); 23 document.documentElement.className = ""; 24 } 25 </script> 26 </head> 27 <body onload="fixupDOM()" my-attr-2="xyz"> 28 29 30 </body></html>