Re: Wiki page for style attribute

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 UTC