Closed regseb closed 1 year ago
I can confirm upgrading from jsdom 16 to jsdom 19 broke our test suites due to this bug
Eh actually, this is probably fixed by https://github.com/dperini/nwsapi/commit/87fbfa9e3974571edc192689b0712d9536839246 which has not been released yet, right?
@tinco you can now check release 2.2.2 and see if this fixed it. Thank you !
I still have the difference between browsers and nwsapi.
Firefox 103.0.2 / Chromium 105.0.5195.52:
4. Expected [bar] NodeList [ bar ]
13. Expected [] NodeList []
14. Expected [] NodeList []
nwsapi 2.2.1:
4. Expected [bar] Array []
13. Expected [] Array [ bar ]
14. Expected [] Array [ bar ]
nwsapi 2.2.2:
4. Expected [bar] Array []
13. Expected [] Array [ bar ]
14. Expected [] Array [ bar ]
@regseb please try the following on your environment ... replace the complete "tag" resolver case block at line 828 with the following:
// tag name resolver
case (/[_a-z]/i.test(symbol) ? symbol : undefined):
match = selector.match(Patterns.tagName);
source = 'if(' + N + '(e.localName' + '=="' + match[1] + '"' +
')){' + source + '}';
break;
this seems to solve the problem you are reporting, however it removes the change I did for cases were the document contains "MIXED_CASE" syntax, due to presence of "svg" or other "xhtml" lowercase elements.
I would like to avoid that but if this is the only possible fix, I am going to release 2.2.3 and see if the recent changes to "localName" in place of "nodeName" is already covering the same fixes and do not introduce new regressions.
@dperini It works with your modification of the tag name resolver (on version 2.2.2). All results are equal to the browsers.
I found a difference between nwsapi and browsers (Firefox and Chromium). For an XML document with a capitalized element, the
querySelector()
method doesn't work when searching by putting two elements in the selector.