diff options
author | Manolo Carrasco <manolo@apache.org> | 2010-05-13 09:47:50 +0000 |
---|---|---|
committer | Manolo Carrasco <manolo@apache.org> | 2010-05-13 09:47:50 +0000 |
commit | 502cf8a7c53b7b2eada9aadea5599b12ce4c1367 (patch) | |
tree | d2a1a1ae537fd1c5a3fb0df83c6f4e54b8a70be1 /gwtquery-core | |
parent | 1ca2ceef931a98b6efdc21f84f29f7461b3cbb5f (diff) | |
download | gwtquery-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.java | 4 |
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);
}
|