Re: About dropping the style attribute

On 6/24/07, Anne van Kesteren <annevk@opera.com> wrote:
>
>
> On Sun, 24 Jun 2007 11:15:01 +0200, Håkon Wium Lie <howcome@opera.com>
> wrote:
> > Also sprach Craig Francis:
> > The style element, when scoped to its parent, will be able to do this
> > -- and more -- but it is more verbose.
>
> The problem with the style= attribute, as opposed to the <style> element.
> Is that it encourages media specific style sheets. As the media for the
> style= attribute is automatically "all". It also does not allow for
> alternate style sheets. The <style> element in HTML5 handles both. Having
> said that, I don't really care strongly either way.


In most most cases where @style is used, it's used in a way that the media
doesn't matter... if I wrote <ul style="list-style-image: url(foo)"> I don't
care whether the media is paged, on screen, or printed.  If the media is
aural, that property is irrelevant.  I imagine that most use cases for
"style" are like that.  I'm aware that if I wanted alternate stylesheets, I
would need to take those styles out into a stylesheet.

The other benefit of stylesheets is to separate the content from the
presentation, but if my application is PHP (or even XSLT! where @style has
also come in handy to me!) that separation doesn't benefit me more than it
hurts.  Obviously <style scoped> doesn't separate the content much from
presentation, save for a few lines of code.

I still haven't seen an answer to the fate of the
HTMLElement.styleproperty.  What happens to the serialization when
that property is set?
Removing HTMLElement.style seems pointless to me because it must still be
supported and will still be used.  And I don't see how else to serialize it
except in the @style attribute.

Robert Burns:

I think the CSS3 WG on the style attribute syntax is actually a more
> elegant  approach (and easier to understand for authors) than the
> scoped style element. The scoped style element has a lot of
> opportunities to be misunderstood by implementors and authors alike.
> I don't think it adds anything that the CSS3 style attribute doesn't
> already make possible (and some CSS3 is already being implemented by
> some early-adopter implementations). In contrast, the changes to the
> style attribute will be easy for everyone to understand.
>
> <http://www.w3.org/TR/2002/WD-css-style-attr-20020515>
>

 I agree with this.  That is an old draft.  I wonder what its fate is?  It
solves media concerns just like <style scoped>.  It doesn't address the fate
of HTMLElement.style, but easily could.  Was any rationale ever given why
HTML5 is creating something new to solve the same problem this draft solves?

Also, that draft's new rules for @style are backward compatible, where I
don't see how <div><style scoped></style>...</div> is backward compatible:
today's browsers would apply those styles to the entire document.  Am I
missing something?

Received on Monday, 25 June 2007 19:47:12 UTC