From 7811e78162e5a5f1d10a2f3f0de2043db74dc289 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Wed, 20 Apr 2011 18:15:58 +0000 Subject: [PATCH] this is experimental code committed by mistake --- gwtquery-core/pom.xml | 8 ++++-- .../client/impl/SelectorEngineNative.java | 28 ++++--------------- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/gwtquery-core/pom.xml b/gwtquery-core/pom.xml index 9abfe9e0..5fe5f0ac 100644 --- a/gwtquery-core/pom.xml +++ b/gwtquery-core/pom.xml @@ -16,7 +16,7 @@ junit junit - 3.8.1 + 4.7 jar test @@ -76,10 +76,14 @@ always + both + 6 gwt.args - -out target/www + -out target/www-junit + gwt.noserver + true diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineNative.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineNative.java index f8d2cd6c..c068bb22 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineNative.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineNative.java @@ -26,44 +26,26 @@ import com.google.gwt.dom.client.NodeList; * querySelectorAll support. */ public class SelectorEngineNative extends SelectorEngineImpl { - + public static String NATIVE_EXCEPTIONS_REGEXP = ".*(:contains|!=).*"; private static HasSelector impl; - NodeList result = null; - public SelectorEngineNative() { - } - - RunAsyncCallback callBack = new RunAsyncCallback() { - public void onSuccess() { - if (impl == null) { - impl=GWT.create(HasSelector.class); - } - } - public void onFailure(Throwable reason) { - } - }; - - private NodeList jsFallbackSelect (String selector, Node ctx) { if (impl == null) { - GWT.runAsync(callBack); - while (impl == null); - } - return impl.select(selector, ctx); + impl = GWT.create(HasSelector.class); + } } public NodeList select(String selector, Node ctx) { if (!SelectorEngine.hasQuerySelector || selector.matches(NATIVE_EXCEPTIONS_REGEXP)) { - return jsFallbackSelect(selector, ctx); + return impl.select(selector, ctx); } else { try { return SelectorEngine.querySelectorAllImpl(selector, ctx); } catch (Exception e) { - return jsFallbackSelect(selector, ctx); + return impl.select(selector, ctx); } } } - } -- 2.39.5