ad8ed38dbe410f3d008a09caf77f232b8f15c4b1e1faf95c8ac4367d222c0071898705d8108095bcd7cedbfd9bf6ea6769fc13db3796a194521e39da86345a 682 B

12345678910111213141516171819202122
  1. import arrayFrom from './array-from';
  2. /**
  3. * IE doesn't evaluate <style> tags in SVGs that are dynamically added to the page.
  4. * This trick will trigger IE to read and use any existing SVG <style> tags.
  5. * @see https://github.com/iconic/SVGInjector/issues/23
  6. * @see https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10898469/
  7. *
  8. * @param {Element} node DOM Element to search <style> tags in
  9. * @return {Array<HTMLStyleElement>}
  10. */
  11. export default function (node) {
  12. const updatedNodes = [];
  13. arrayFrom(node.querySelectorAll('style'))
  14. .forEach((style) => {
  15. style.textContent += '';
  16. updatedNodes.push(style);
  17. });
  18. return updatedNodes;
  19. }