[Javascript] style.offsetTop/Left Firefox

Troy III Ajnej trojani2000 at hotmail.com
Sun Jun 22 16:30:38 CDT 2008


Thank's for your reply Diego.
Of course that in theory pos-top doesn't exist in CSS,
but neither does offset-top, yet there it is. 
 
We are able to get offsetTop which is very convenient - by the way - for scripting purpopses on any element. 
And what really makes it flexible and useful is the fact that it returns a numeric value, that
makes it priceless for scripting, but only in casse it has its own analog -the numeric Setter!
Especially in combination with properties like event.cilentX/Y that yeld a nondimensional numerical value too.
Otherwise it is useles or at least uneficient for practical use. Because style.Top will force you
to convert your integer into a string while same time forcing you to declare its physical unit, which by the way might well not be what you expect in some other browser.
 
One would argue that: because the offset property is nondimensional it would cause problems
in say browsers that decided to return a value stripped from percents, points, picas or other physicall
dimensions, -but it shouldn't. Since there is - I believe -no programer that would make such a damn
mistake of treating the dimensionless value of the Setter as of different dimensional unit from its Getter causing unneccessary and dumb discrepancy errors. 
 
That is, -if one browser decided to extract the Getter value from pixels while some other decided
to get it from percentage, while preserving the obvious logic that the Setter integer value should be treated same as the value given by the getter, will logically nullify the browser differences no matter what unit it was based on, 'cause they'll be giving exactly the same result, -leaving that argument as false as it is.
 
While on the other hand,  it is unfair or completely evil (from some browser part who decided not to support the posTop/Left deliberately), to not rise an error, or at least a warning to the coder who is expectedly unaware that - particularily this nonstandard instruction (among thousands of others being supported including Firefox with no complain once or ever)  has been chosen not to.
There are a myriad of "nonstandard" properties currently supported by firefox and being added day bay day but not this one. Yet atop it all plays def and refuses to report it to the coder. 
 
I very much agree with the part when you say that: "Firefox is probably just dropping the declaration" because it is droping it, but I can't agree much with the seccond part that: "it shouldn't rise a warning". -Because it does rise every other god damn possible irrelevant warning except for this and some other very important ones not mentioned here. This inconsistency, with selfgeneric "standards" that do not require some written agreement for us to be acceptable and/or understandable is what makes firefox a hypocrite, because it will rise a warnig for statements like valign, not to mention thousands of proprietary and nonstandard features it does support while claiming to be the only standards compliant browser available, confusing a standards geeks to think that every proprietary feature supported by firefox is a standard one but that's an obvious lie.
 
I asked this question because during my coding on a Strict HTML 4.01 DTD I simply got confused. What is going on?! Say element.innerHTML alert has just displayed its content to me, while elemet.style.posTop is treated as a simple wellformed comment. Should it? -Well it shouldn't!
 
This way;
We now have gained a browser who while in strict mode will even refuse opacity. -Obviously, because its a nonstandard feature! That way if you demand to have opacity on your page, you will have to go back to real standards, that is: a "nonstandard mode". So you either follow stadards all the way (when in strict mode), or you don't, -because the halfway means "no way", no way you can get anywhere. 
And this is no good.
 
Regards
 
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
                                      Troy III
                           progressive art enterprise 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 



> Date: Sat, 21 Jun 2008 16:59:40 -0300> From: dnunes at gmail.com> To: javascript at lists.evolt.org> Subject: Re: [Javascript] style.offsetTop/Left Firefox> > On Sat, Jun 21, 2008 at 12:29 AM, Troy III Ajnej> <trojani2000 at hotmail.com> wrote:> > Why is Firefox neglecting "el.style.posTop="..., instruction?> > Well, in theory "pos-top" doesn't exist in CSS specification.> Firefox probably is just dropping the declaration, and it shouldn't> rise a warning.> If you use the correct "top" property, things should work fine.> > -- > diego nunes> dnunes.com> _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript
_________________________________________________________________
Introducing Live Search cashback .  It's search that pays you back!
http://search.live.com/cashback/?&pkw=form=MIJAAF/publ=HMTGL/crea=introsrchcashback


More information about the Javascript mailing list