Garrett said:
Garrett Smith wrote:
On 5/22/2010 1:25 PM, David Mark wrote:
Ry Nohryb wrote:
On 22/05/10 16:22, Johannes Baagoe wrote:
Dmitry A. Soshnikov :
[...]
You really don't know what you are talking about, do you? Bugs
notwithstanding, all standard attributes of "html-elements" are
reflected in "JS-land" in one way or another.
[...]
You've qualified the term "reflect" with your own "in one way or
another".
Meaning that they are abstracted in some way (e.g. the "style" attribute
is reflected as an object).
Did Jorge use that definition? Or did he communicate in a vague way and
you elaborated on it?
The concept of "reflects" is explained in HTML 5 draft.
There you go again. How are the contents of that draft possibly
relevant to this discussion?
It helps explain what Jorge likely wanted to communicate to you.
We've discussed
this before. A content attribute that "reflects" has its current value
represented by a dom property. Not all content attributes reflect.
Name a (standard) one that doesn't.
'checked' of HTML INPUT.
Is that meant to be a joke? It is reflected in the defaultChecked DOM
property.
How about autocomplete attribute, in Firefox? Or placeholder in older
versions of webkit that supported that attibute?
It was written long after the fact and is not even a standard for the
future yet. See my follow-up.
The point that it was written after the fact does not take any away from
the argument. In fact, it might actually strengthen it. The term is a
codification used to describe existing behavior.
You seem to disagree with the definition, but won't say why. It's not a
standard that is the topic at hand, mind you, but the meaning of a word
that is being used to describe something. That word is "reflects".
They also conflate computed styles and attributes. Yes, I know. We
went over that when it was revealed they had changed their "attr" method
to call their completely broken height/width methods, which in turn
query computed styles.
Thus, in jQuery, the
selector:
*[width=600]
- may (incorrectly) select:
<img class="logo">
- depending on the browser, its version, and the rendering mode (or
document mode).
And its style of course. Yes, as noted, they seem to be lost.
What "style"? The computed style? Or what would be the computed style if
the element, and all of it's ancestors, had display: block?
What about an element that has display: none doesn't have a width?
<img style="display: none" class="logo">
How wide is it now?
Are you asking me or pontificating in general? Obviously there is no
concept of width for an element with display:none. It's not part of the
layout.
Obviously.
But jQuery might be selecting that element, depending on the browser,
its version, the rendering mode, and other css rules. The article says
that jQuery finds the elements whose "width is 600px".
Regardless, the rendered styles is a separate concept from the
attributes in the source code. Totally separate and unrelated concept.
Attributes describe the element, styles describe its appearance.
Recent browsers that implement getComputedStyle will return a computed
style width, based on apparently a nonstandard algorithm. This is
probably as a consequence of developers wanting that value and filing
invalid bugs.
So, if that element is matched in the author's selector query
"img[width=600]" the query would not be doing what he says it does.
Namely, it would not match "all the images whose width is 600px".
That expectation is based on observations of design bug of jQuery and
even at that, the query will fail, matching an element whose display is
"none" in those recent browsers that implement getComputedStyle. In IE8
and below, it will not match the element, and so it will do what the
author says it does.
Then again, that same article throws some javascript errors in Firefox:
"getParameter is not defined"
getParameter is not defined
[Break on this error] loadSkin=function(b,a){var
c=document....lse{jQuery(function(a){loadMagic()})};
getParameter is not defined
http://www.tuttoaster.com/wp-conten...s?d=www.tuttoaster.com&r=5&s=default&onw=true
Line 1
That error was seen in Firefox 3.6 with no modifications, other than the
one extension "Firebug."
The tweeted about it, as explained. Read it for yourself.
http://twitter.com/jquery
[...]
I've long since disproved that claim.
Over and over again.
It is. Though it is an easily observable phenomenon. Anyone who
understands the concepts of attributes and the fundamental problems with
them IE would know right away that attempting to make even a CSS2
compliant selector engine is going to be more trouble than it is worth.
[...]
Hopefully. But they have nothing to compare it to. They just figure
that "nobody is perfect".
It is on its way out. All of them are on their way out.
Yours too?
And that will ultimately be the death of it.
You'd think. The problem is that the professional bar for "web
developer" was never very high to begin with. It used to be that one
could get away with making things work in a few browsers with a little
knowledge of the DOM and CSS.
jQuery lowered that bar. Now, you don't need to know "pure javascript"
or "raw javascript" or "low-level code" -- all of these terms used to
describe the efforts of what should be a requisite basis of
understanding of the pertinent technologies prior to seeking employment
as a professional who uses them.
Look here, jQuery is advertising that it is for designers, in just one
of the many books for jQuery is "jQuery for Designers", as featured on
the homepage.
http://jquery.com/
What would be the motivation for writing that book is what? To spread
understanding of the fundamental technologies so that people can develop
sites?
The developer knows that if he writes a book, it's gonna make him look
like a pro, while having the dual effect of providing an attractive
title, showing developers that they don't really need to know how to
program, jQuery isn't real programming and even a designer can do it.
It's like the dummies books.
He'll be helping out jQuery, by giving credence to the library. In
return, he will likely to be featured on the jQuery website, which can
help get him into a position of being recognized as something of an
expert on jQuery.
Recall earlier where I wrote:
| Where reciprocal favors (in the form of links, praise, networking,
| etc) are offered, then there will be individuals who link to and
| praise jQuery and we can see that all over the web.
Yes, it was ill-advised from the start.
The proliferation of new selector-based libraries, and of existing
libraries that have migrated to being selectors-based seems to validate
the idea. It's a neat idea, conceptually, but not practical. It fails in
the obvious places that anyone with a few years of experience developing
for IE should know of.
They're basically all copying jQuery. The idea actually started with
Dean Edwards' CSSQuery, which predated jQuery by a couple of years. Not
that that much matters.
You too validated the concept by publishing a library yourself, copying
the idea, and proclaiming it to be superior and with no unit tests, too
boot!
[...]
By the way, CSS2.1 states that attribute selectors take a string
(quoted) or identifier, as in img[width="600"], and not img[width=600],
but provided examples showing unquoted values as strings.
That's the least of their worries.
Yep. It's a separate issue and probably going to be more of an issue for
the WG to contend with, as people are used to attribute selectors
working without quotes.
It looks like the CSS2.1 spec had a mistake by providing examples that
don't match the rules stated. For attribute selectors[1], it states:
| Attribute selectors may match in four ways:
| [att]
| Match when the element sets the "att" attribute, whatever the
| value of the attribute.
| [att=val]
| Match when the element's "att" attribute value is exactly "val".
| [...]
|
| Attribute values must be identifiers or strings. The case-sensitivity
| of attribute names and values in selectors depends on the document
| language.
CSS2.1 defines strings[2] as:
| 4.3.7 Strings
|
| Strings can either be written with double quotes or with single
| quotes.
Awful wording. They use of "can" and "written with", in particular. By
that definition, I could, with my pencil, produce a string with with the
following characters, in order:
8""
Better:
| A String is zero or more characters enclosed by either single or
| double quotes.
[1]
http://www.w3.org/TR/CSS2/selector.html#matching-attrs
[2]
http://www.w3.org/TR/CSS2/syndata.html#strings