aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManolo Carrasco <manolo@apache.org>2011-07-13 15:11:22 +0000
committerManolo Carrasco <manolo@apache.org>2011-07-13 15:11:22 +0000
commitbdcbcce6c902af674e49eceb74f5fdb112df3504 (patch)
tree557ade217c28fff738bad9d38a89e6928036b99c
parentd54cbb0fb783414c5ee9df7501db71771246e93f (diff)
downloadgwtquery-bdcbcce6c902af674e49eceb74f5fdb112df3504.tar.gz
gwtquery-bdcbcce6c902af674e49eceb74f5fdb112df3504.zip
fix xpath when tag is omitted
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineCssToXPath.java2
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/rebind/SelectorGeneratorsTest.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineCssToXPath.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineCssToXPath.java
index cca6f751..4ed673f6 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineCssToXPath.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineCssToXPath.java
@@ -153,7 +153,7 @@ public class SelectorEngineCssToXPath extends SelectorEngineImpl {
":(first)", "[1]",
":(last)", "[last()]",
// put '*' when tag is omitted
- "(^|\\|)(\\[)", "$1*$2",
+ "(^|\\|[\\./]*)(\\[)", "$1*$2",
// Replace escaped dots and spaces
"%S%"," ",
"%P%",".",
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/rebind/SelectorGeneratorsTest.java b/gwtquery-core/src/test/java/com/google/gwt/query/rebind/SelectorGeneratorsTest.java
index d336cd76..a66f328b 100644
--- a/gwtquery-core/src/test/java/com/google/gwt/query/rebind/SelectorGeneratorsTest.java
+++ b/gwtquery-core/src/test/java/com/google/gwt/query/rebind/SelectorGeneratorsTest.java
@@ -89,7 +89,7 @@ public class SelectorGeneratorsTest extends GWTTestCase {
assertEquals(".//a[@href and (@lang) and (@class)]",
sel.css2Xpath("a[href][lang][class]"));
- assertEquals(".//*[@checked='checked']|*[not(@disabled)]|*[@disabled]",
+ assertEquals(".//*[@checked='checked']|.//*[not(@disabled)]|.//*[@disabled]",
sel.css2Xpath(":checked, :enabled, :disabled"));
assertEquals(".//table[contains(string(.),'String With | @ ~= Space Points.s and Hash#es')]",