Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Trigger hover pseudo class using javascript?

Reply
Thread Tools

Trigger hover pseudo class using javascript?

 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      04-30-2010
Lasse Reichstein Nielsen wrote:

> Thomas 'PointedEars' Lahn <(E-Mail Removed)> writes:
>> Lasse Reichstein Nielsen wrote:
>>> Thomas 'PointedEars' Lahn <(E-Mail Removed)> writes:
>>>> Garrett Smith wrote:
>>>>> | The Function prototype object is itself a Function object (its
>>>>> | [[Class]] is "Function") that, when invoked, accepts any arguments
>>>>> | [[and
>>>>> | returns undefined.
>>>>
>>>> Again, that does _not_ say what can happen between the moment the
>>>> function is called and the moment it returns. So it does _not_ support
>>>> your assumption that the function would be a "no-op" either way.
>>>
>>> Ofcourse it does. It says what the function does. Just like any other
>>> function specified in the standard, it's not allowed to do observable
>>> things that are not stated.

>> So it could very well do things that are not observable by the caller.

>
> Well, duh. It can do anything that isn't observable - but how would
> you know?


One could read the source code for some implementations. Otherwise, I do
not know. Neither does Garrett. That is why it is a fallacy (of his) to
assume the value of this property qualifies as a "no-op function" that is
"safe everywhere".

>>> You are reading something into this specification that isn't there,
>>> namely that this is some minimal requrirement of what the function must
>>> do, and not, like everywhere else, the exact specification.

>> No and no.

>
> Are you not reading the specification such that a conformant
> implementation may have a Function.prototype that does something
> observable between entering the function and returning undefined?


Mu.

> Otherwise what does "that does _not_ say what can happen between the
> moment the function is called and the moment it returns" mean?
> I say it does say.


Not sufficiently for this function to be assumed a "no-op".

> I cannot see how the String function is *more* definitive than
> Function.prototype.


It specifies how the return value is to be computed to begin with.

>>> This specification is equivalent to using the "algorithm":
>>> 1. Return undefined

>> I concur, but that is not at issue here.

>
> Then I fail to see what the issue is.
> Maybe you can elaborate what your point is?


A "no-op" (no-operation, from the assembly language mnemonic) does nothing
at all.


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$(E-Mail Removed)>
 
Reply With Quote
 
 
 
 
Lasse Reichstein Nielsen
Guest
Posts: n/a
 
      04-30-2010
Thomas 'PointedEars' Lahn <(E-Mail Removed)> writes:

> A "no-op" (no-operation, from the assembly language mnemonic) does nothing
> at all.


But a function must return a value. That means that a "no-op function"
is a contradiction in terms (if one uses your definition of no-op).
I.e., saying "no-op function" is as meaningless as saying "square circle".

I, however, didn't have any problem interpreting the intended meaning
of "no-op function" in this context, e.g., something equivalent to
function(){}
and Function.prototype is such a function.

/L
--
Lasse Reichstein Holst Nielsen
'Javascript frameworks is a disruptive technology'

 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      04-30-2010
Lasse Reichstein Nielsen wrote:

> Thomas 'PointedEars' Lahn <(E-Mail Removed)> writes:
>> A "no-op" (no-operation, from the assembly language mnemonic) does
>> nothing at all.

>
> But a function must return a value. That means that a "no-op function"
> is a contradiction in terms (if one uses your definition of no-op).
> I.e., saying "no-op function" is as meaningless as saying "square circle".
>
> I, however, didn't have any problem interpreting the intended meaning
> of "no-op function" in this context, e.g., something equivalent to
> function(){}
> and Function.prototype is such a function.


The initial value of the property is referring to such a Function object.
However, the property value can be modified in conforming implementations of
ECMAScript Edition 3 (but not in conforming implementations of Edition 5)
without side effects to the normal operation of Function objects (as the
initial value must be used there). Modification may be performed both by a
conforming implementation or the user (for whatever reason).

This puts into doubt the opinion that using

Function.prototype

for that purpose would be "safe everywhere", and that assigning the result
of the evaluation of the expression

function () {}

as a really safe, clear and unambiguous value instead is not to be
preferred.


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$(E-Mail Removed)>
 
Reply With Quote
 
Garrett Smith
Guest
Posts: n/a
 
      04-30-2010
Lasse Reichstein Nielsen wrote:
> Thomas 'PointedEars' Lahn <(E-Mail Removed)> writes:
>
>> A "no-op" (no-operation, from the assembly language mnemonic) does nothing
>> at all.

>
> But a function must return a value. That means that a "no-op function"
> is a contradiction in terms (if one uses your definition of no-op).
> I.e., saying "no-op function" is as meaningless as saying "square circle".
>
> I, however, didn't have any problem interpreting the intended meaning
> of "no-op function" in this context, e.g., something equivalent to
> function(){}
> and Function.prototype is such a function.
>

It's as simple as that. Thanks, BTW. The discussion was wearing me out.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
 
Reply With Quote
 
Garrett Smith
Guest
Posts: n/a
 
      04-30-2010
Thomas 'PointedEars' Lahn wrote:
> Lasse Reichstein Nielsen wrote:
>
>> Thomas 'PointedEars' Lahn <(E-Mail Removed)> writes:


[...]

> initial value must be used there). Modification may be performed both by a
> conforming implementation or the user (for whatever reason).
>


That does not support the argument that using Function.prototype is not
safe.

An implementation may add additional properties to Function.prototype,
such as Function.prototype.prototype, and be conformant.

However, a conforming implementation must also provide all built-in
functions. Function.prototype is a built-in function. As such, a
conforming implementation must provide that, as specified.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      04-30-2010
Garrett Smith wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Lasse Reichstein Nielsen wrote:
>>> Thomas 'PointedEars' Lahn <(E-Mail Removed)> writes:

>
> [...]


You have trimmed the important part again.

>> initial value must be used there). Modification may be performed both by
>> a conforming implementation or the user (for whatever reason).
>>

>
> That does not support the argument that using Function.prototype is not
> safe. [...]


A property that has a value that can be overwritten (maybe accidentally or
by non-conformance, who knows), one that may assume different values
depending on the implementation, is by definition not safe to use.

And what about the developer? Do you not think that a empty anonymous
function expression is going to be a lot more self-descriptive than
`Function.prototype'?


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$(E-Mail Removed)>
 
Reply With Quote
 
Garrett Smith
Guest
Posts: n/a
 
      04-30-2010
Thomas 'PointedEars' Lahn wrote:
> Garrett Smith wrote:
>
>> Thomas 'PointedEars' Lahn wrote:
>>> Lasse Reichstein Nielsen wrote:
>>>> Thomas 'PointedEars' Lahn <(E-Mail Removed)> writes:

>> [...]

>
> You have trimmed the important part again.
>
>>> initial value must be used there). Modification may be performed both by
>>> a conforming implementation or the user (for whatever reason).
>>>

>> That does not support the argument that using Function.prototype is not
>> safe. [...]

>
> A property that has a value that can be overwritten (maybe accidentally or
> by non-conformance, who knows), one that may assume different values
> depending on the implementation, is by definition not safe to use.
>


What is written is too far from broken English be clearly understood.

> And what about the developer? Do you not think that a empty anonymous
> function expression is going to be a lot more self-descriptive than
> `Function.prototype'?
>


What is this? A different argument? Switching the reason for why it is
bad to use Function.prototype? New reason is something as subjective and
trivial.

Function.prototype can be easily understood as being a function that
accepts any number of arguments and returns undefined. That is a fact.

As to what is more descriptive: That, or an anonymous function
expression, I have no comment.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      04-30-2010
Garrett Smith wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Garrett Smith wrote:
>>> Thomas 'PointedEars' Lahn wrote:
>>>> Lasse Reichstein Nielsen wrote:
>>>>> Thomas 'PointedEars' Lahn <(E-Mail Removed)> writes:
>>> [...]

>>
>> You have trimmed the important part again.
>>
>>>> initial value must be used there). Modification may be performed both
>>>> by a conforming implementation or the user (for whatever reason).
>>>>
>>> That does not support the argument that using Function.prototype is not
>>> safe. [...]

>>
>> A property that has a value that can be overwritten (maybe accidentally
>> or by non-conformance, who knows), one that may assume different values
>> depending on the implementation, is by definition not safe to use.

>
> What is written is too far from broken English be clearly understood.

^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You should leave the judgement to people who can actually write proper
(and meaningful) English.

>> And what about the developer? Do you not think that a empty anonymous
>> function expression is going to be a lot more self-descriptive than
>> `Function.prototype'?

>
> What is this? A different argument? Switching the reason for why it is bad
> to use Function.prototype?


No, learn to read.


PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)
 
Reply With Quote
 
Garrett Smith
Guest
Posts: n/a
 
      04-30-2010
Thomas 'PointedEars' Lahn wrote:
> Garrett Smith wrote:
>
>> Thomas 'PointedEars' Lahn wrote:
>>> Garrett Smith wrote:
>>>> Thomas 'PointedEars' Lahn wrote:
>>>>> Lasse Reichstein Nielsen wrote:
>>>>>> Thomas 'PointedEars' Lahn <(E-Mail Removed)> writes:
>>>> [...]
>>> You have trimmed the important part again.
>>>
>>>>> initial value must be used there). Modification may be performed both
>>>>> by a conforming implementation or the user (for whatever reason).
>>>>>
>>>> That does not support the argument that using Function.prototype is not
>>>> safe. [...]
>>> A property that has a value that can be overwritten (maybe accidentally
>>> or by non-conformance, who knows), one that may assume different values
>>> depending on the implementation, is by definition not safe to use.

>> What is written is too far from broken English be clearly understood.


Still stands.

> ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> You should leave the judgement to people who can actually write proper
> (and meaningful) English.
>


If you cannot write understandably, then you will be left having an
unintelligible conversation with only yourself.

>>> And what about the developer? Do you not think that a empty anonymous
>>> function expression is going to be a lot more self-descriptive than
>>> `Function.prototype'?

>> What is this? A different argument? Switching the reason for why it is bad
>> to use Function.prototype?

>
> No, learn to read.


I read a sentence containing a suggestion worded in the form of a
negative question.

Cryptically Pointless, and a Pointlessly question as well, but I
answered the question anyway.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
 
Reply With Quote
 
Garrett Smith
Guest
Posts: n/a
 
      04-30-2010
Garrett Smith wrote:
> Thomas 'PointedEars' Lahn wrote:
>> Garrett Smith wrote:
>>
>>> Thomas 'PointedEars' Lahn wrote:
>>>> Garrett Smith wrote:
>>>>> Thomas 'PointedEars' Lahn wrote:
>>>>>> Lasse Reichstein Nielsen wrote:
>>>>>>> Thomas 'PointedEars' Lahn <(E-Mail Removed)> writes:
>>>>> [...]


[...]
> Cryptically Pointless, and a Pointlessly question as well, but I
> answered the question anyway.


s/Pointlessly question/Pointless question
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vertical padding on first-letter pseudo class /w gecko Jonathan N. Little HTML 1 11-02-2005 01:52 AM
Re: Class selector, ID selectors and link pseudo-classes Luigi Donatello Asero HTML 1 06-04-2005 06:58 PM
Class selector, ID selectors and link pseudo-classes Luigi Donatello Asero HTML 4 06-04-2005 05:02 PM
use javascript onmouseover to trigger hover state of another image Elisa Javascript 2 07-11-2004 12:25 AM
add window.status javascript to a:hover css pseudo-class? Bob P. Javascript 2 06-25-2004 05:51 PM



Advertisments