@@ -14,11 +14,6 @@ class BrowserQRCodeSvgWriter {
14
14
15
15
private static readonly QUIET_ZONE_SIZE = 4 ;
16
16
17
- /**
18
- * SVG markup NameSpace
19
- */
20
- private static readonly SVG_NS = 'http://www.w3.org/2000/svg' ;
21
-
22
17
/**
23
18
* Writes and renders a QRCode SVG element.
24
19
*
@@ -146,10 +141,10 @@ class BrowserQRCodeSvgWriter {
146
141
*/
147
142
private createSVGElement ( w : number , h : number ) : SVGSVGElement {
148
143
149
- const svgElement = document . createElementNS ( BrowserQRCodeSvgWriter . SVG_NS , 'svg' ) ;
144
+ const svgElement = document . createElementNS ( svgNs , 'svg' ) ;
150
145
151
- svgElement . setAttributeNS ( svgNs , 'height' , w . toString ( ) ) ;
152
- svgElement . setAttributeNS ( svgNs , 'width' , h . toString ( ) ) ;
146
+ svgElement . setAttribute ( 'height' , w . toString ( ) ) ;
147
+ svgElement . setAttribute ( 'width' , h . toString ( ) ) ;
153
148
154
149
return svgElement ;
155
150
}
@@ -164,13 +159,13 @@ class BrowserQRCodeSvgWriter {
164
159
*/
165
160
private createSvgRectElement ( x : number , y : number , w : number , h : number ) : SVGRectElement {
166
161
167
- const rect = document . createElementNS ( BrowserQRCodeSvgWriter . SVG_NS , 'rect' ) ;
162
+ const rect = document . createElementNS ( svgNs , 'rect' ) ;
168
163
169
- rect . setAttributeNS ( svgNs , 'x' , x . toString ( ) ) ;
170
- rect . setAttributeNS ( svgNs , 'y' , y . toString ( ) ) ;
171
- rect . setAttributeNS ( svgNs , 'height' , w . toString ( ) ) ;
172
- rect . setAttributeNS ( svgNs , 'width' , h . toString ( ) ) ;
173
- rect . setAttributeNS ( svgNs , 'fill' , '#000000' ) ;
164
+ rect . setAttribute ( 'x' , x . toString ( ) ) ;
165
+ rect . setAttribute ( 'y' , y . toString ( ) ) ;
166
+ rect . setAttribute ( 'height' , w . toString ( ) ) ;
167
+ rect . setAttribute ( 'width' , h . toString ( ) ) ;
168
+ rect . setAttribute ( 'fill' , '#000000' ) ;
174
169
175
170
return rect ;
176
171
}
0 commit comments