From: David Mark on
On Dec 15, 11:03 am, Matt Kruse <m...(a)thekrusefamily.com> wrote:
> On Dec 14, 2:26 pm, David Mark <dmark.cins...(a)gmail.com> wrote:
>
> > Second try at a successful (and very basic) test failed as well.  Just
> > wanted to know which link in the document had the tabindex specified.
> > Various IE versions and modes think there are two of them (1 != 2).
>
> Hmmm...
>
> Using "My Library" source here:http://www.cinsoft.net/mylib-build.asp?version=1.0&helptopic=setattri...
>
> Sample html:
> <table cellspacing="5" id="x" onlyonce="yes"><tr><td>Data</td></tr></
> table>
>
> Using IE6 and "My Library":
> API.getAttribute(document.getElementById('x'),'onlyonce') => null

Yeah, I told you the new wrappers were slightly improved. Custom (non-
standard) attribute support is one such improvement. :)

> API.getAttribute(document.getElementById('x'),'cellspacing') => null

A workaround for broken "cell span attributes" in IE (as they are
called by the tester) are another. The new Blackberry browser had a
similar problem. I'll transplant the updated version back into My
Library when I get a chance.

>
> Using jQuery:
> $('#x').attr('onlyonce') => "yes"
> $('#x').attr('cellspacing') => 5
>
> Seems like jQuery gives me the right answers, and "My Library" fails.

You don't have a clue what the "right" answers are from jQuery as attr
has no defined behavior. All it did was read the cellSpacing property
(which it would do whether an attribute existed or not). And, as you
know, it would have missed had you used cellPadding. I suggest you
revisit your tests here:-

http://www.cinsoft.net/attributes.html

And realize that jQuery fails for _dozens_ of these tests, no matter
how you attempt to define the behavior. No matter how many times I
tell Resig (or whomever) about the MSHTML attribute problem, it never
seems to sink in.
From: David Mark on
On Dec 15, 11:03 am, Matt Kruse <m...(a)thekrusefamily.com> wrote:

> $('#x').attr('cellspacing') => 5

As this was the only real bug you found, I looked (and I'm sure you
did too). As I expected, the older version is missing attribute
aliases:-

This is from the newer version and it is clear I added the two cell-
related attribute names last. As I mentioned a month ago, I need to
put this newer version into My Library, but it is hardly a priority
for me.

var attributeAliases = {'for':'htmlFor', accesskey:'accessKey',
codebase:'codeBase', frameborder:'frameBorder',
framespacing:'frameSpacing', nowrap:'noWrap', maxlength:'maxLength',
'class':'className', readonly:'readOnly', longdesc:'longDesc',
tabindex:'tabIndex', rowspan:'rowSpan', colspan:'colSpan',
ismap:'isMap', usemap:'useMap', cellpadding:'cellPadding',
cellspacing:'cellSpacing'};

That's a silly omission by one person from two years ago. Now, how do
you correlate that with jQuery's failings in this area? I know they
are batting .500 on the cell* attributes as of today. :) But those
are the _least_ of the mistakes. ;)
From: David Mark on
On Dec 15, 11:03 am, Matt Kruse <m...(a)thekrusefamily.com> wrote:
> On Dec 14, 2:26 pm, David Mark <dmark.cins...(a)gmail.com> wrote:
>
> > Second try at a successful (and very basic) test failed as well.  Just
> > wanted to know which link in the document had the tabindex specified.
> > Various IE versions and modes think there are two of them (1 != 2).
>
> Hmmm...
>
> Using "My Library" source here:http://www.cinsoft.net/mylib-build.asp?version=1.0&helptopic=setattri...
>
> Sample html:
> <table cellspacing="5" id="x" onlyonce="yes"><tr><td>Data</td></tr></
> table>
>
> Using IE6 and "My Library":
> API.getAttribute(document.getElementById('x'),'onlyonce') => null
> API.getAttribute(document.getElementById('x'),'cellspacing') => null
>
> Using jQuery:
> $('#x').attr('onlyonce') => "yes"
> $('#x').attr('cellspacing') => 5
>
> Seems like jQuery gives me the right answers, and "My Library" fails.
>

I updated the alias list to match the one from the sequel. No massive
rewrite necessary (unlike jQuery). Custom attributes are not
supported by that function (you _can_ use the native attribute methods
for those in all browsers).

I'll bet you don't get that sort of support from the jQuery "team".
Special orders don't upset me. :)
From: Matt Kruse on
On Dec 15, 10:14 am, David Mark <dmark.cins...(a)gmail.com> wrote:
> Yeah, I told you the new wrappers were slightly improved.  Custom (non-
> standard) attribute support is one such improvement.  :)

To quote yourself:

|You missed that this is obviously broken logic. If one line is
|broken, how do you trust the next (and the thousands that follow that
|one)?

> > Seems like jQuery gives me the right answers, and "My Library" fails.
> You don't have a clue what the "right" answers are from jQuery as attr
> has no defined behavior.

I looked at your documentation for getAttribute() and found even less
documentation then attr(). So I guess returning null in these cases is
just fine, as your method has no defined behavior either.

Pot, Kettle, etc.

Matt Kruse
From: Matt Kruse on
On Dec 15, 10:23 am, David Mark <dmark.cins...(a)gmail.com> wrote:
> > $('#x').attr('cellspacing') => 5
> As this was the only real bug you found [...]

It took me all of 5 minutes to download your code, look at the code,
and easily identify two problems in the logic. By your own strict
standards of testing, you've had two years to spot these easily-
identified problems, yet they have remained unfixed in the publicly
downloadable version.

I'm sure I could find other problems in your code (seeing as how
easily these were found) if I had the desire to look at it, but I
don't.

Matt Kruse