Why is that a bug?

If 1.3 matches only elements that have the specified attribute,
shouldn't the second radio remain as "name?" due to its lack of name?

On Thu, Jan 15, 2009 at 7:30 PM, John Resig <[email protected]> wrote:
>
> Bug filed here: http://dev.jquery.com/ticket/3884
>
> --John
>
>
>
> On Thu, Jan 15, 2009 at 7:29 PM, John Resig <[email protected]> wrote:
>> Erm. Good point. Time to fix it!
>>
>> --John
>>
>>
>>
>> On Thu, Jan 15, 2009 at 5:40 PM, Nano. <[email protected]> wrote:
>>>
>>> Hi,
>>>
>>> If v1.3 has changed, why the demo on 
>>> http://docs.jquery.com/Selectors/attributeNotEqual
>>> has the 2nd input not changed to " is not newsletter " (2nd input has
>>> no name attribute).
>>>
>>> Output:
>>> name?
>>> name?
>>> is not newsletter
>>>
>>> Source code:
>>> =========
>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>>>                    "http://www.w3.org/TR/html4/loose.dtd";>
>>> <html>
>>> <head>
>>>  <script src="http://code.jquery.com/jquery-latest.js";></script>
>>>
>>>  <script>
>>>  $(document).ready(function(){
>>>    $("input[name!='newsletter']").next().text(" is not newsletter");
>>>  });
>>>  </script>
>>>
>>> </head>
>>> <body>
>>>  <div>
>>>    <input type="radio" name="newsletter" value="Hot Fuzz" />
>>>    <span>name?</span>
>>>  </div>
>>>  <div>
>>>    <input type="radio" value="Cold Fusion" />
>>>    <span>name?</span>
>>>  </div>
>>>  <div>
>>>    <input type="radio" name="accept" value="Evil Plans" />
>>>    <span>name?</span>
>>>  </div>
>>> </body>
>>> </html>
>>> =========
>>>
>>> Thanks,
>>>
>>> Nano.
>>>
>>> On Jan 15, 1:58 pm, John Resig <[email protected]> wrote:
>>>> Good call - just updated the 
>>>> docs:http://docs.jquery.com/Selectors/attributeNotEqual
>>>>
>>>> --John
>>>>
>>>> On Thu, Jan 15, 2009 at 4:49 PM, prefect <[email protected]> wrote:
>>>>
>>>> > Ah, I see. That seems like a good decision. Then my only minor point
>>>> > would be to update the documentation of the [attr!=value] filter. As I
>>>> > said I just recently started experimenting with jQuery and thus use
>>>> > the documentation a lot to find my way around jQuery. But I'd bet
>>>> > you're probably busy revising it after the recent 1.3 update anyway.
>>>>
>>>> > — Frode
>>>>
>>>> > On Jan 15, 5:11 pm, John Resig <[email protected]> wrote:
>>>> >> On this point I disagree.
>>>>
>>>> >> The previous version was equal to:
>>>> >> li:not([class=zoom])
>>>>
>>>> >> The current version is equal to:
>>>> >> li[class]:not([class=zoom])
>>>>
>>>> >> This change came about after discussing it over with the MochiKit team
>>>> >> (since they use the same selector engine as us) and I have to agree
>>>> >> with their implementation: Every single attribute selector at least
>>>> >> tests for the presence of the attribute - everything after that is
>>>> >> just filtering.
>>>>
>>>> >> Considering how easy it is to get "every element that does not have an
>>>> >> attribute equal to this value - and does not have the attribute
>>>> >> itself": li:not([class=zoom]) it seems like an acceptable change.
>>>>
>>>> >> --John
>>>>
>>>> >> On Thu, Jan 15, 2009 at 8:50 AM, prefect <[email protected]> 
>>>> >> wrote:
>>>>
>>>> >> > The documentation for the [attr!=value] filter reads: "Matches
>>>> >> > elements that either don't have the specified attribute or do have the
>>>> >> > specified attribute but not with a certain value."
>>>>
>>>> >> > In 1.2.6 $("li[class!='zoom']") would give me both LI elements without
>>>> >> > a class attribute and those with a class attribute not equal to
>>>> >> > 'zoom'. In 1.3 I only get LI elements with a class attribute defined
>>>> >> > (and not equal to 'zoom'). To me this seems like a bug, and not the
>>>> >> > best behaviour. It's also in conflict with the expected behaviour
>>>> >> > described in the documentation.
>>>>
>>>> >> > I'm a bit new to jQuery development, so if I have wrong expectations
>>>> >> > or there's a better way for this, please enlighten me. But I thought
>>>> >> > I'd report this in case it really is a bug in Sizzle or jQuery 1.3.
>>>
>>> >>
>>>
>>
>
> >
>



-- 
---
David Zhou
[email protected]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to