From 9e632ee323e109997dfd329d4887a5ffd4b5528e Mon Sep 17 00:00:00 2001
From: Jonas Jenwald <jonas.jenwald@gmail.com>
Date: Mon, 7 Jun 2021 10:07:19 +0200
Subject: [PATCH] Use the `DOMSVGFactory`, rather than manually creating the
 SVG-element, in `createMatrix` (PR 13361 follow-up)

Generally, in the `src/display/` folder, we utilize `DOMSVGFactory` rather than manually creating an SVG-element; hence let's do the same thing in `src/display/pattern_helper.js` as well.
---
 src/display/pattern_helper.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/display/pattern_helper.js b/src/display/pattern_helper.js
index d06846bc1..7545a7408 100644
--- a/src/display/pattern_helper.js
+++ b/src/display/pattern_helper.js
@@ -20,6 +20,7 @@ import {
   unreachable,
   Util,
 } from "../shared/util.js";
+import { DOMSVGFactory } from "./display_utils.js";
 
 let svgElement;
 
@@ -29,7 +30,8 @@ function createMatrix(matrix) {
     return new DOMMatrix(matrix);
   }
   if (!svgElement) {
-    svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
+    const svgFactory = new DOMSVGFactory();
+    svgElement = svgFactory.createElement("svg");
   }
   return svgElement.createSVGMatrix(matrix);
 }