Scott J. Miles <email@example.com>
sjmiles at primitiveitch.com
Sat Sep 17 10:02:00 CDT 2005
I did a lot of work on "style.js". And then I talked to Paul and I went and
did a lot *more* work.
I don't want to commit it yet, because there are still some unresolved
issues. In particular, I won't do anything until Paul says it's ok (or not).
The bottom line is that there are certain values that (afaik) cannot be
calculated on some browsers. In particular, the margins resulting from
margin: auto cannot be calculated on IE (and Safari in OSX 10.3). Also, in
some browsers and some styles, values not specified in 'px' cannot be
resolved. In these cases, the getXXX functions return "NaN", and the
setOuterWidth|Height functions return "false".
There are other limitations too. I believe these functions are incredibly
useful, but they must be used only under controlled conditions. This is a
point of tension.
You may want to inspect these two (maybe ridiculous) unit tests:
Tests setOuterWidth against a variety of DIV stylings:
Displays get[Content|Inner|Outer][Width|Height] against a variety of DIV
Be advised that these tests can take awhile to load (I didn't bother trying
to optimize them).
Unfortunately, there are still many more permutations. In particular, the
tests only run against DIVs. Various other elements have other quirks.
My proposed style.js is available here:
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 9/16/2005
More information about the NG-DHTML