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
Two things I noted while working on a 2.0 version. The first defined function I could not find any usage.
The second function, selectSingleNode is only used twice and does not appear to be doing what was expected.
For example it is called as node.selectSingleNode('ancestor::pre')) where node is a node inside of a specific post. However node is used as a backup in document.evaluate(xpath, this.ownerDocument || this, resolver || null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
this will resolve as document.evaluate(xpath, this.ownerDocument, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; where this.ownerDocument is likely the entire document and not the real area of interest.
You could reverse the logic as this || this.ownerDocument but I chose to drop the entire wrapper and just make the native call in the two places used.
The text was updated successfully, but these errors were encountered:
elk-quick-quote/quickQuote.js
Lines 4 to 20 in 5ebda25
Two things I noted while working on a 2.0 version. The first defined function I could not find any usage.
The second function,
selectSingleNode
is only used twice and does not appear to be doing what was expected.For example it is called as
node.selectSingleNode('ancestor::pre'))
where node is a node inside of a specific post. However node is used as a backup indocument.evaluate(xpath, this.ownerDocument || this, resolver || null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
this will resolve as
document.evaluate(xpath, this.ownerDocument, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
wherethis.ownerDocument
is likely the entire document and not the real area of interest.You could reverse the logic as
this || this.ownerDocument
but I chose to drop the entire wrapper and just make the native call in the two places used.The text was updated successfully, but these errors were encountered: