diff options
author | Manolo Carrasco <manolo@apache.org> | 2011-07-13 15:11:22 +0000 |
---|---|---|
committer | Manolo Carrasco <manolo@apache.org> | 2011-07-13 15:11:22 +0000 |
commit | bdcbcce6c902af674e49eceb74f5fdb112df3504 (patch) | |
tree | 557ade217c28fff738bad9d38a89e6928036b99c | |
parent | d54cbb0fb783414c5ee9df7501db71771246e93f (diff) | |
download | gwtquery-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.java | 2 | ||||
-rw-r--r-- | gwtquery-core/src/test/java/com/google/gwt/query/rebind/SelectorGeneratorsTest.java | 2 |
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')]", |