jijopaulose / gwtquery

Automatically exported from code.google.com/p/gwtquery
MIT License
0 stars 0 forks source link

$("*:not(:has(*))") causes crash #112

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a gQuery object with the selection $("*:not(:has(*))") 

What is the expected output? What do you see instead?
A valid Gquery object containing all elements which do not have descendents. 
This is what I see instead in Eclipse:

Created HasSelector: com.google.gwt.query.client.impl.SelectorEngineCssToXPath
Created SelectorEngineImpl: 
com.google.gwt.query.client.impl.SelectorEngineNative
Created DocumentStyleImpl: com.google.gwt.query.client.impl.DocumentStyleImpl
ERROR SelectorEngineNative (NS_ERROR_DOM_SYNTAX_ERR): An invalid or illegal 
string was specified *:not(:has(*)), falling back to SelectorEngineCssToXPath
ERROR: xpathEvaluate invalid xpath expression:.//*[not(.//:has(*) 
css-selector:*:not(:has(*))

com.google.gwt.core.client.JavaScriptException: 
(NS_ERROR_DOM_INVALID_EXPRESSION_ERR): The expression is not a legal expression.
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.query.client.impl.SelectorEngine.xpathEvaluate(SelectorEngine.java)
    at com.google.gwt.query.client.impl.SelectorEngineCssToXPath.select(SelectorEngineCssToXPath.java:225)
    at com.google.gwt.query.client.impl.SelectorEngineNative.select(SelectorEngineNative.java:70)
    at com.google.gwt.query.client.impl.SelectorEngine.select(SelectorEngine.java:138)
    at com.google.gwt.query.client.GQuery.select(GQuery.java:3708)
    at com.google.gwt.query.client.GQuery.$(GQuery.java:291)
    at com.google.gwt.query.client.GQuery.$(GQuery.java:259)

What version of the product are you using? On what operating system?
gQuery 1.1.0

Please provide any additional information below.
Firefox and GWT 2.4 in Linux.

Original issue reported on code.google.com by dewi.jo...@gmail.com on 3 Nov 2011 at 7:14

GoogleCodeExporter commented 9 years ago

:has selector is not implemented yet in gquery, it is not a valid css selector, 
in jquery it is an extension:
http://api.jquery.com/has-selector/

We will implement it in a future release, in the meanwhile use gquery methods 
as a workaround.
$("*").not($("*").has("*")); 

The gquery implementation will delegate on these methods as jquery does, so 
:has cannot take advance of css native selector performance.

Original comment by manuel.carrasco.m on 3 Nov 2011 at 11:17

GoogleCodeExporter commented 9 years ago
Thanks for reporting. I've migrated this issue to github : 
https://github.com/gwtquery/gwtquery/issues/144
Please follow the issue there.

Original comment by julien.d...@gmail.com on 15 Jul 2013 at 4:44

GoogleCodeExporter commented 9 years ago

Original comment by julien.d...@gmail.com on 15 Jul 2013 at 4:44