On Dec 14, 12:31 am, John Resig <jere...@gmail.com> wrote:
> For example, documenting that disabled/selected/etc. are expected to
> return boolean values. Documenting the expected value returned from
> zIndex. Documenting what happens with relative URL resolution across
> browsers.
> THEN we can go back and fill in the test suite as appropriate.
> [...]
> To start I've created a page that's a rough dump of the contents in
> the HTML 4 spec:http://www.w3.org/TR/html4/index/attributes.html
> Into the following page:http://docs.jquery.com/How_Attributes_Work

I think this is a great approach, and I hope it goes somewhere. How
exactly can I help with it?

Also, to further illustrate why I think calling jQuery methods when
calling attr() is a bad idea, take a look at the example page our
great friend David Mark has set up (ignore the insulting url):
http://www.cinsoft.net/jquerysucks.html

Because height() tries to do so much magic, it ends up that this:

$o.attr('height',$o.attr('height'));

actually gives wrong results. IMO, attr() should be reflexive in that
calling attr() to set a property with a value retrieved from attr()
should always maintain the same value. I just really think the whole
idea of calling methods when getting/setting attributes is bad. What
is the real basis for it?

Two other points:

1) I cannot find the rationale for this. Or even where this "bug" is
discussed. Can anyone point me to it? I am curious.

        // Safari mis-reports the default selected property of a hidden
option
        // Accessing the parent's selectedIndex property fixes it
        if ( name == "selected" && elem.parentNode ) {
                elem.parentNode.selectedIndex;
        }

2) This seems like over-kill, still. Passing the second parameter will
never break things, so why not just pass it in every case?

        var attr = !jQuery.support.hrefNormalized && notxml && special
                        // Some attributes require a special call on IE
                        ? elem.getAttribute( name, 2 )
                        : elem.getAttribute( name );

could be simplified to:

        var attr = elem.getAttribute(name,2);


Matt Kruse

--

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


Reply via email to