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

Re: Wiki page for style attribute

From: Eric Daspet <eric.daspet@survol.fr>
Date: Tue, 3 Jul 2007 17:20:23 +0200
Message-ID: <fb3a3ce70707030820l672b55b1w940b6e3576dc536d@mail.gmail.com>
To: public-html@w3.org
On 7/2/07, Anne van Kesteren <annevk@opera.com> wrote:
>
>
> On Mon, 02 Jul 2007 01:52:51 +0200, Sam Ruby <rubys@us.ibm.com> wrote:
> > Anne van Kesteren wrote:
> >>  2. Syndication is also addressed by <style scope>.
> >
> > Fully disagree.
>
> I said "also". Could you please elaborate on why you disagree with that?
>
>
I do not see how "style scoped" could be a solution for syndication. And,
more generaly, I do not see how someone could benefit from "style scoped" to
put some external pieces of HTML into a main document.

In the wiki, the [style scoped][1] is expected to solve the use cases
[external material][2] and [embedding][3]. I do not think this is the case.

[1]: http://esw.w3.org/topic/HTML/StyleAttribute#style-element-scoped
[2]: http://esw.w3.org/topic/HTML/StyleAttribute#external-material
[3]: http://esw.w3.org/topic/HTML/StyleAttribute#embedding

Let's face some concrete code

    <html>
    <head>
      <title>test</title>
      <style title="main"> background-color: blue ; color: white ; </style>
    </head>
    <body>
      <h1>Syndication : articles :</h1>
      <article>
        <style title="external material" scoped> color: blue ; </style>
        <p>My external paragraph integrated in the main document</p>
      </article>
    </body>
    </html>

* Problem :

I own the "main" document, you own the external material. I can't be sure of
the appearence of the integrated material, because you could change the
external styles. You can't be sure of the appearence either, because you do
not control my stylesheet. In my example I define a default "white on blue"
color. The external material expect the usual white background and define a
blue color. The result is blue on blue, noone is "in fault".

A solution could be an agreement between me and the author of the external
content. However if we do so, it would be simplier and better to agree on
common classnames with some style attached. Moreover, this does not solve
the syndication probleme because I do not know all external authors a I
won't be able to ask them to change something.

An other solution is avoiding conflicts. In this case it could be redefine
the background-color in the external stylesheet. However, as the owner I
can't be sure that all the external authors will do it, especially in the
syndication use case. Even if external authors are smart, it is difficult to
avoid conflicts. External authors have to care about selectors priorities
(they don't know mines), fonts (size, color, spacing, indentation), position
(position absolute, relative, floats that could overlap, if a clear breaks
something in my design ...), doctype switching (the external material could
be in html 4 with the quirks mode, and me in html 5 triggering standard
mode) ...


In no way (AFAIK) either me either the external author could be sure that
the external material is even readable. At least I do not see how this is
doable in the syndication use case.

Well, there is *one* way I can see : if I control both stylesheets. But if I
control both, I am able to put them both in the head section with precise
selectors.


-- 
√Čric Daspet
http://eric.daspet.name/
Received on Tuesday, 3 July 2007 15:20:28 GMT

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