You found a bug! We've classified it as
a bug in our system.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
[CLOSED] Ext.query("*[class!=bar]") returns all nodes even with no "class" attribute
In DomQuery documentation, it's told that:
E[foo!=bar] has an attribute "foo" that does not equal "bar",
but Ext.query("*[class!=bar]") returns ALL DOM elements having not class="bar", even those that
do not have any "class" attribute.
Result also contains <html>, <head>, <title>, <meta>, <link>, <style>, <script> elements,
and all dom elements with no class attribute.
It is also true for all E[foo!=bar] combinations (E not only '*', foo all correct and incorrect
attribute names and any bar value).
Technically the behavior is correct, though it may not be what you're expecting. The biggest problem is that changing this behavior may break existing applications which rely on it.
Then if it's correct behaviour, the correction has to be made to DomQuery API documentation.
It would also be good to add DomQuery attribute selector that'll be appropriate to now's documenation (has an attribute "foo" that does not equal "bar")
I have updated that documentation to make it clearer. As far as adding a new selector, we really want to follow the QSA standards that are out there.
I second that - the behavior (not the doc) matches what other libraries do. For example in jquery
Originally Posted by Jamie Avins
$('*:not(".foo")') // returns ALL elements that don't have class=foo