function overrideCreateElementNS(window) {
  const d = window.document;
  const f = window.document.createElementNS;

  window.document.createElementNS = function (namespaceURI, qualifiedName) {
    if (namespaceURI === "http://www.w3.org/2000/svg") {
      const result = f.call(d, namespaceURI, qualifiedName);
      if (result.style == undefined) {
        result.style = {};
        return result;
      }
    }
  };
}
The override is only done if there is no 2D context already present.
This allows for normal running in a browser, and for node.js the usage of 'style'
property on a newly created svg element.
@param {object} window - current global window object. This can possibly come from module 'jsdom',
                when running under node.js.
@private