diff --git a/content/buffers.js b/content/buffers.js index b45f234e..85320fff 100644 --- a/content/buffers.js +++ b/content/buffers.js @@ -144,12 +144,14 @@ vimperator.Buffer = function() //{{{ }); // returns an XPathResult object - this.evaluateXPath = function(expression, doc, ordered) + this.evaluateXPath = function(expression, doc, elem, ordered) { if (!doc) doc = window.content.document; + if (!elem) + elem = doc; - var result = doc.evaluate(expression, doc, + var result = doc.evaluate(expression, elem, function lookupNamespaceURI(prefix) { switch (prefix) { case 'xhtml':