D
David Mark
Garrett said:David said:Garrett said:David Mark wrote:
Garrett Smith wrote:
David Mark wrote:
Garrett Smith wrote:
Thomas 'PointedEars' Lahn wrote:
David Mark wrote:
If you build a new library, it will now "work" for all but IE8
standards mode. But I don't want it to work like that, so
soon it
will fail for all. Always set the type attribute/property
_first_
(or
use a wrapper that does that for you).
And that wrapper is API.createElementWithAttributes:-
You can't be serious. What's wrong with `API.createElement', the
`API' aside (see below)?
[...]
There is a similar issue with the name attribute/property in
that it
must be set after appending the element if it is to show up in the
appropriate DOM collection (e.g. document.forms, document.images,
window.frames). That is an issue best handled with a wrapper that
creates _and_ appends an element. Call it
createAndAppendElementWithAttributes perhaps?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
No, thanks.
Generalized element builders.
There are too many edge cases support.
That's meaningless.
There are problems with nodes
that can't accept other nodes, special handling for certain
attributes
(cellPadding, name).
There are no issues if you have competently written wrappers. Of
course, that lets out... virtually everyone. As for problems of
nodes
not accepting other nodes, that's inherent to the underlying DOM
interface, so is irrelevant for a wrapper (unless it claims to
support
non-standard behavior).
What about appending to a SELECT?
What about it?!
It is obviously inconsistent. The appended option's `selected` may be
null, string, or boolean (true OR false).
Oh, forget that bullshit. That property doesn't matter until you append
the thing to a document. Host objects 101. Don't try to do stupid
things.
DOn't try stupid things? Like what? Append an OPTION to a SELECT and
then append the SELECT to the DOM, but expect something related to the
option being selected? Nope, I have a different approach for SELECTs.
Here's another stupid idea: A wrapper for DOM attributes.
I don't follow that, even if you mean adding an option to a select. The
way to address the "issue" is in a function that finds the selected
option.
A function createAndAppendElementWithAttributes would seem to be capable
of creating and appending an element with attributes. It should also be
reasonably expected to be consistent across browsers.
You don't even need to know about the problems with adding an OPTION toYes, that's true.
a SELECT to recognize the obviousness of that.
The solution I am familiar with is using MS createElement nonstandardSo? You don't know how to fix that? See the wrapper posted in this
thread.
extension.
That's the stupid solution. Did you read this thread?
That approach is specified to throw errors, and so if it is used, then
it must be feature tested and the feature test would involve try-catch.
Which sucks.
No, that too, though. I commented on the long section of statements you
refer to as a "unit test" in your viewport function.
There you go again with semantics. I _hate_ that fucking shit. Yes, I
know I pointed out my "assertions" in that page as examples of simple
tests and you've been harping on the "those are not unit tests" bullshit
for weeks since. No wonder nothing ever gets settled in here. Where
are we on the new Viewport FAQ entry?
I do not keep tabs on when you write things.
You could hardly miss most of it (and haven't IIRC).
Creating nodes can work for specific tasks such as above, but for
general purpose, it is unneeded.
What the hell does that mean?
Speculate on a need that does not exist? Never.
Whatever.
Work the other way.
This isn't working (in any sense of the word).
Create abstractions as they're needed. Organize the abstractions to
allow for effective reuse.
Well, parsers, editors, queries, etc. have been around forever. It's
not some new need I have identified. It's an old need that was never
filled because nobody bothered to figure it out. It's beyond belief,
but there it is.
Test the abstractions. When something doesn't work, the test can be
added to the suite. When the abstration gets refactored, then the tests
can reflect that.
You are rambling.
Adding OPTION to a SELECT is very generic, but probably can work in
almost any normal context.
Creating a specific widget (UserPanel) is going to be more specific. In
a specific case, for a higher level widget, the nodes/html for the
widget can be generated in a self-contained function.
Whatever.
Nope.
Nope what? My point was that though nobody needs one, seemingly
everybody wants one.
Feel free to enlighten me.
Never mind. Look at it if you want to. It parses fucking documents.
Get the picture? Same as queries query documents. It's all based on
getting an accurate view of the document (something that all of these
stupid projects neglected).
My experiences with Dojo based applications is that they tend to be slow
to load. Well I've only worked on two applications that used Dojo.
Not a big enough sample, but "slow to load" was the first thing out of
my mouth when I was first tapped to assess it. I sped it up quite a bit
(to say the least), but, of course...
Other applications that use dojo that I interviewed for, they complained
about slow performance.
I'm hardly surprised.
[...]
Dammit. Your quoting is fucking up here again. No way this is my
fault. I used GG for years and never hard this problem.
?
I wasn't.
Why would you have to remember the name of that method?
I don't follow and don't really care at this point.
YOu wrote "You return early if the element is not in the document." That
is wrong. Please do look at that one line of code.
It is not a tree.
Oh really? It is "bullshit" to return early? Who taught you that? Or
better yet, why did you believe it?
Restructure the design so that the caller
What caller and what circumstance?
Calling the function wer are talking about with whatever the hell would
make it exit early (returning undefined apparently). What were we
talking about?
The caller of that method calls it so that the calendar can be created.
If the calendar is already created, then the method exits.
And that's _stupid_. Doesn't the caller know if it has called it yet or
not? It certainly should.
Apparently the code comment did *not* help. So it is down to an English
problem. What meaning do you get from: "If the element is not null, exit."
I have no clue what you are talking about at this point.
Apparently it was.
Heh, apparently not.
The job of the API is to define a public interface. More options means
more complexity, more bloat, longer methods, harder to read, more bugs,
more maintenance time.
All a bunch of nothingness. There's just no meaning there at all.
I asked you to explain yourself.
You misinterpreted that one line of code.
I did not misinterpret anything. What sort of idiot would think that an
early return statement could be misinterpreted? Or perhaps this is just
more baiting?
It seems likely that you're
misunderstanding other things about that code.
Not a chance. It seems more likely that you don't understand the
subtleties I am describing and that's not a new experience.
Don't blame me for your misunderstanding. Don't call bullshit and say
that I'm not thinking.
Sorry, I don't take orders.
What you repeated is correct, but there seems to
What I repeated was what you stated, but in question form. I can't make
sense of what you're saying here, or why.
It's mutual at this point. The thread is another lost cause.
A Calendar widget is not limited to learning about browser quirks.
Neither are wrappers for accurately reading and mutating documents. And
how did this become calendar vs. attributes? I truly hate these detours.
Nope. Because sometimes, innerHTML might be a better option.
Ugh. How does matter?
Sometimes
Array.prototype.join or Array.prototype.push would be good options for
that.
Good options for what?
In some cases, not all cases, the code might have a browser quirk
to deal with. In other cases, another browser quirk might appear.
I don't know what you are talking about. The wrappers deal with the
browser quirks behind the scenes. That's part of their utility (as well
as educational for those laboring under misconceptions about properties
and attributes).
What sorts of quirks? Creating a table with cellPadding, creating a
named anchor.
There's no issue with creating a table with cellpadding. And the anchor
issue is in another layer (createAndAppend...)
It depends on the author(s),
If the attribute wrapper is needed for an Editor then limit it to that.
What does that mean? An editor must deal with virtually every attribute
and element type. That's what makes it such an excellent (and
ubiquitous) example.