Re: About dropping the style attribute

On 6/26/07, James Craig <> wrote:
> Jens Meiert wrote:
> >> I've realized now that the current spec drops the style attribute for
> >> all elements except for the <font>, but I can't understand the
> >> reasoning behind those decisions.
> >
> > And neither do I, and according to my experience as well as the
> > discussion on that subject there are several cases why we need to
> > keep the "style" attribute.
> Some of the common JavaScript libraries use this for performance and
> consistency reasons, too. Prototype, for example, uses the [style] to
> toggle style values for a couple reasons. 1) So it doesn't have to
> override !important styles, and 2) because when checking the
> displayed state, performance of getAttribute is much faster than
> getComputedStyle.
> James

>From a strictly pragmatic point of view, dropping the style attribute
will break a lot of apps on the web. In particular applications that
use the attribute in conjunction with server side injected CSS for
dynamic background images, color coding, etc... (whether it's correct
to do so or not).

Likewise, the as stated by James, a lot of JS libraries (and homegrown
JS code) depend on the style attribute from anything like simple
show/hide functionality to more complex color fading and position

Just my 2 cents,

Ara Pehlivanian

Email & GTalk:

Received on Wednesday, 27 June 2007 18:07:12 UTC