OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/run-after-layout-and-paint.js"></script> |
| 3 <svg> |
| 4 <linearGradient id="f"> |
| 5 <stop stop-color="red"/> |
| 6 </linearGradient> |
| 7 <rect width="100" height="100" fill="url(#f) orange"/> |
| 8 </svg> |
| 9 <script> |
| 10 runAfterLayoutAndPaint(function() { |
| 11 const svgNs = 'http://www.w3.org/2000/svg'; |
| 12 let gradient = document.createElementNS(svgNs, 'linearGradient'); |
| 13 let stop = gradient.appendChild(document.createElementNS(svgNs, 'stop')); |
| 14 stop.setAttribute('stop-color', 'green'); |
| 15 gradient.id = 'f'; |
| 16 |
| 17 let existingGradient = document.getElementById('f'); |
| 18 document.querySelector('svg').insertBefore(gradient, existingGradient); |
| 19 }, true); |
| 20 </script> |
OLD | NEW |