File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export default class SelectorItem {
65
65
66
66
// Tag name match
67
67
if ( this . tagName ) {
68
- if ( this . tagName !== '*' && this . tagName !== element [ PropertySymbol . tagName ] ) {
68
+ if ( this . tagName !== '*' && this . tagName !== element [ PropertySymbol . tagName ] . toUpperCase ( ) ) {
69
69
return null ;
70
70
}
71
71
priorityWeight += 1 ;
Original file line number Diff line number Diff line change @@ -1143,6 +1143,27 @@ describe('QuerySelector', () => {
1143
1143
expect ( element2 === div . children [ 0 ] ) . toBe ( true ) ;
1144
1144
} ) ;
1145
1145
1146
+ it ( 'Returns SVG elements' , ( ) => {
1147
+ document . body . innerHTML = `<svg width="3955.829" height="880" viewBox="0 0 3955.829 880" xmlns="http://www.w3.org/2000/svg" id="id_svg_model">
1148
+ <g id="svgGroup" stroke-linecap="round" fill-rule="evenodd" font-size="9pt"
1149
+ stroke="#000" stroke-width="0.25mm" fill="none" style="stroke:#000;stroke-width:0.25mm;fill:none"
1150
+ >
1151
+ <path d="M 0 0 L 0 880 L 1272.697 880 A 80 80 0 0 0 1350.647 817.996 L 1416.442 533.006 A 120 120 0 0 1 1533.367 440 L 1977.914 440 L 2422.462 440 A 120 120 0 0 1 2539.386 533.006
1152
+ L 2605.182 817.996 A 80 80 0 0 0 2683.131 880 L 3955.829 880 L 3955.829 0"
1153
+ vector-effect="non-scaling-stroke">
1154
+ </path>
1155
+ </g>
1156
+ </svg>` ;
1157
+
1158
+ const svg = document . querySelector ( 'svg' ) ;
1159
+ const path = document . querySelector ( 'path' ) ;
1160
+
1161
+ expect ( svg ?. constructor . name ) . toBe ( 'SVGSVGElement' ) ;
1162
+
1163
+ // TODO: Should be SVGPathElement, but it is not supported yet
1164
+ expect ( path ?. constructor . name ) . toBe ( 'SVGElement' ) ;
1165
+ } ) ;
1166
+
1146
1167
it ( 'Throws an error when providing an invalid selector' , ( ) => {
1147
1168
const div = document . createElement ( 'div' ) ;
1148
1169
expect ( ( ) => div . querySelector ( '1' ) ) . toThrowError (
You can’t perform that action at this time.
0 commit comments