aboutsummaryrefslogtreecommitdiffstats
path: root/gwtquery-core
diff options
context:
space:
mode:
authorManolo Carrasco <manolo@apache.org>2010-05-13 09:47:50 +0000
committerManolo Carrasco <manolo@apache.org>2010-05-13 09:47:50 +0000
commit502cf8a7c53b7b2eada9aadea5599b12ce4c1367 (patch)
treed2a1a1ae537fd1c5a3fb0df83c6f4e54b8a70be1 /gwtquery-core
parent1ca2ceef931a98b6efdc21f84f29f7461b3cbb5f (diff)
downloadgwtquery-502cf8a7c53b7b2eada9aadea5599b12ce4c1367.tar.gz
gwtquery-502cf8a7c53b7b2eada9aadea5599b12ce4c1367.zip
applied patch in Issue_13 with fixes a bug when the node is in an iframe
Diffstat (limited to 'gwtquery-core')
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/SelectorEngine.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/SelectorEngine.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/SelectorEngine.java
index 41f9a685..acf2437f 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/client/SelectorEngine.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/SelectorEngine.java
@@ -73,7 +73,9 @@ public class SelectorEngine {
public static native NodeList<Element> xpathEvaluate(String selector,
Node ctx, JSArray r) /*-{
var node;
- var result = $doc.evaluate(selector, ctx, null, 0, null);
+ var ownerDoc = ctx && (ctx.ownerDocument || ctx );
+ var evalDoc = ownerDoc ? ownerDoc : $doc;
+ var result = evalDoc.evaluate(selector, ctx, null, 0, null);
while ((node = result.iterateNext())) {
r.push(node);
}