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
{{ message }}
This repository was archived by the owner on Sep 20, 2019. It is now read-only.
IE 11 requires the last argument to document.createTreeWalker() even though it's being removed. If it's not provided we get an error stating "Argument not optional".
In fixing that, you must also provide the third argument. In IE 11 you can pass null, however, I believe this fails in IE9 and 10 because they require a you specify a function for acceptNode. Are we supporting these (assuming not due to the usage of classes)? If so it requires something like:
functioncreateTreeWalker(root){// Accept all currently filtered elements.functionacceptNode(){returnNodeFilter.FILTER_ACCEPT;}// Work around Internet Explorer wanting a function instead of an object.// IE also *requires* this argument where other browsers don't.constsafeFilter=acceptNode;safeFilter.acceptNode=acceptNode;returndoc.createTreeWalker(root,NodeFilter.SHOW_ELEMENT,safeFilter,false);}
Once you provide IE11 with the correct arguments, it complains with "Unexpected call to method or property access." when calling walker.nextNode(). The fix for this is to only walk trees for nodes that are Node.ELEMENT_NODE.