W3C home > Mailing lists > Public > public-html@w3.org > June 2007

Re: About dropping the style attribute

From: Alfonso Martínez de Lizarrondo <amla70@gmail.com>
Date: Wed, 27 Jun 2007 22:13:44 +0200
Message-ID: <af2a8eab0706271313g3b5779e1te492ee5c1f914a12@mail.gmail.com>
To: gonchuki <gonchuki@gmail.com>
Cc: public-html@w3.org

2007/6/27, gonchuki <gonchuki@gmail.com>:
>
> On 6/26/07, Ara Pehlivanian <ara.pehlivanian@gmail.com> wrote:
> >
> > On 6/26/07, James Craig <jcraig@apple.com> 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
> > animation.
> >
> > Just my 2 cents,
> > A.
>
> could you explain how is exactly that web apps will be broken? as far
> as i can see it, UAs should *only* drop the style attribute IF under
> HTML5 rendering mode. Keep your app in HTML4/XHTML1 if you wan't to
> continue using old tags/attributes. That's the way actual UAs work,
> switching between quirks and standards compliant mode depending on the
> doctype, and rendering/dropping specific attributes. [1]
>
> Moreover, UAs will definitely need a diferent parsing/rendering path
> to treat the new tags, and *only* render them as they are supposed
> under HTML5 mode... the same should be applied to dropped and
> deprecated tags/attributes.
> And I don't know where in the specs does this belong, but we should be
> discouraging UAs developers from "trying to fix tag soups" and treat
> the DOM in a strict mode, where any invalid tag/attribute is just
> dropped instead of being pseudo-fixed and rendered.
>
>
> [1] a clear example of this is IE6, that when under standards
> compliant mode it uses a different box model and prohibits coloring of
> scrollbars (you can specify it, but it gets dropped)
>
> PS: I know i may be "asking too much" but there are so many wrong
> things in the current status of the web, that fixing just one is
> impossible as you must fix lots others first.
>
> --
> /gonchuki
>
>

>From my understanding, at least some part of the browser developers (I
think that at least the Mozilla and Safari people expressed it) won't
have a different parsing mode for documents according to the doctype,
there might be some differences in the parsing and/or rendering, but
nothing too drastic as that would mean more tests that have to be done
in each mode.

You ask how web apps will be broken, and instead of putting the burden
on the people that wants some change as drastic as this one to prove
that it will be harmless because there are better options that should
be pushed, it's the people that say that too many pages rely on that
behavior the one that must count them?

I would ask you or anyone else that argues for this removal to show a
JS library that does manipulate the elements on a page changing the
position, color, etc... without using the style attribute. The only
way that I can think of is using runtimeStyle, but that's not standard
so it shouldn't count. The other option would be to manipulate the
stylesheet and create/modify rules for each element, but that's too
hard when you just want to make a simple slide out.

If people is forced to insert scoped stylesheets everywhere that they
need some specific style or to wrap the elements with font tags I
think that it will make more difficult the adoption of html5.
Received on Wednesday, 27 June 2007 20:13:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:01 GMT