Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition.html |
| diff --git a/third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition.html b/third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e2aa68a511d1c8f853848514e431a2821bb716e7 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition.html |
| @@ -0,0 +1,22 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/run-after-layout-and-paint.js"></script> |
| +<svg> |
| + <linearGradient id="f"> |
| + <stop stop-color="green"/> |
| + </linearGradient> |
| + <rect width="100" height="100" fill="url(#f) orange"/> |
| +</svg> |
| +<script> |
| +runAfterLayoutAndPaint(function() { |
| + const svgNs = 'http://www.w3.org/2000/svg'; |
| + let gradient = document.createElementNS(svgNs, 'linearGradient'); |
| + let stop = gradient.appendChild(document.createElementNS(svgNs, 'stop')); |
| + stop.setAttribute('stop-color', 'red'); |
| + gradient.id = 'f'; |
| + |
| + let rect = document.querySelector('rect'); |
| + document.querySelector('svg').insertBefore(gradient, rect); |
|
Stephen Chennney
2017/02/27 16:21:22
Another test could be done, where the added elemen
fs
2017/02/27 17:47:29
Done.
|
| + rect.getBoundingClientRect(); |
| + rect.setAttribute('stroke-width', 0); |
|
Stephen Chennney
2017/02/27 16:21:22
Why do you do this? Invalidation bug?
fs
2017/02/27 17:47:29
This is here to trigger style-recalc. (Needed to m
|
| +}, true); |
| +</script> |