Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <head> | |
| 
 
rune
2014/12/10 13:03:54
Skip <head>
 
 | |
| 3 <style> | |
| 4 #target::before { content: "FAIL (string) "; } | |
| 5 </style> | |
| 6 </head> | |
| 7 <div id="target" my-attr="FAIL (attribute) ">test</div> | |
| 8 <script> | |
| 9 addEventListener("load", function(){ | |
| 
 
rune
2014/12/10 13:03:54
"onload = function(){" is shorter, but no big deal
 
rune
2014/12/10 13:03:55
"onload = function(){" is shorter, but no big deal
 
 | |
| 10 var s = document.createElement("style"); | |
| 11 s.textContent = "#target::before { content: attr(my-attr); }" | |
| 12 var head = document.querySelector("head"); | |
| 13 head.appendChild(s); | |
| 14 target.offsetTop; | |
| 15 target.setAttribute("my-attr", "PASS "); | |
| 16 }); | |
| 17 </script> | |
| OLD | NEW |