You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The feature detection code in Slick.Finder throws an exception with XHTML documents in Firefox and Chrome. I think this used to work with earlier versions of these browsers, but I'm not sure. Example:
var parser = new DOMParser();
var xml = parser.parseFromString('<html xmlns="http://www.w3.org/1999/xhtml"><body></body></html>', 'text/xml');
xml.documentElement.getElement('body');
Results in TypeError: testNode.style is undefined in Firefox, Uncaught TypeError: Cannot set property 'display' of null in Chrome.
Reason: The test node is created with an empty namespace. Subsequently, the innerHTML and getElementsById tests succeed, the document is detected as HTML, but setting a style on the newly created element fails.
Possible solution: Create the test node using createElementNS:
var testNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');
This works for XHTML documents but it might break other HTML documents.
The text was updated successfully, but these errors were encountered:
The feature detection code in Slick.Finder throws an exception with XHTML documents in Firefox and Chrome. I think this used to work with earlier versions of these browsers, but I'm not sure. Example:
Results in TypeError: testNode.style is undefined in Firefox, Uncaught TypeError: Cannot set property 'display' of null in Chrome.
JSFiddle: http://jsfiddle.net/4UFHV/
The exception is thrown at line 89 in Slick.Finder.js.
Reason: The test node is created with an empty namespace. Subsequently, the innerHTML and getElementsById tests succeed, the document is detected as HTML, but setting a style on the newly created element fails.
Possible solution: Create the test node using createElementNS:
This works for XHTML documents but it might break other HTML documents.
The text was updated successfully, but these errors were encountered: