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.
  1. #1
    Sencha User
    Join Date
    Jul 2010
    Posts
    41
    Vote Rating
    0
    nosferatum is on a distinguished road

      0  

    Exclamation [CLOSED] Ext.query("*[class!=bar]") returns all nodes even with no "class" attribute

    [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).

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Jul 2010
    Posts
    41
    Vote Rating
    0
    nosferatum is on a distinguished road

      0  

    Default


    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")

  4. #4
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    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.

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    Quote Originally Posted by Jamie Avins View Post
    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
    Code:
    $('*:not(".foo")') // returns ALL elements that don't have class=foo

Similar Threads

  1. data query within my groovy class
    By mustanglover in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 18 Mar 2009, 8:16 AM
  2. GXT overwrites body class attribute
    By korebantic in forum Ext GWT: Bugs (1.x)
    Replies: 0
    Last Post: 16 Jan 2009, 7:52 AM
  3. DOM query on :visited pseudo-class
    By steve.kerrison in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 24 Aug 2008, 11:04 AM
  4. Replies: 1
    Last Post: 18 Jun 2008, 1:15 PM

Thread Participants: 2

Tags for this Thread