Re: CSS 2.1 WD and non-CSS presentational hints

"L. David Baron" wrote:
> 
> On Tuesday 2002-08-13 09:50 +0200, Håkon Wium Lie wrote:
> > Also sprach Coises:
> >  > This change might also present difficulties for user agents which could
> >  > otherwise implement user-selected presentational defaults as a (real or
> >  > virtual) user style sheet; it would instead be necessary to modify the
> >  > (real or virtual) user agent default style sheet to set these defaults.
> 
> I don't see any reason the "virtual" UA stylesheet would need to be
> merged with the existing one in any way, since (1) users can't actually
> see the specificity of the selectors in the UA stylesheets and the
> presentational hints that aren't implemented as CSS rules don't even
> have a clearly defined specificity and (2) the things that are
> considered presentational hints (largely, if not entirely, attributes)
> are things that should override everything else in the UA stylesheet.
> In other words, I think the presentational hints could be implemented as
> their own level of the cascade between the UA and user level without
> sorting rules based on specificity and order.

I think you're missing the point. Coises has given a very specific example
of what he means by the "difficulties for user agents" in implementing
"user-selected presenational defaults".

Consider the following user settings:
  default page background      - [white]
  default page text color      - [black]
  default unvisited link color - [blue]
  default visited link color   - [indigo]

  [ ] Allow pages to override my colors.

and the following HTML snippet:

  <body color=red bgcolor=black link=lime visited=green>

Current and legacy practice is to let the author's colors override the
user's defaults. This behavior is expressed in CSS1 and CSS2 through the
cascade --
   - HTML presentational hints such as the author's color attributes
     have the lowest possible specificity and exist at the beginning
     of the author cascade level.
   - The user settings, since they aren't in override mode, behave as
     if they were translated into CSS rules at the user non-!important
     level.
   - The author cascade level overrides the user non-!important level.

    -> Therefore the page is red text with green links on a black canvas.


Now, if a software team were to create a UA with the proposed cascade,
the cascade would fall thus --
   - HTML presentational hints such as the author's color attributes
     have an unknown specificity and exist in the user agent cascade
     level.
   - The user settings, since they aren't in override mode, behave as
     if they were translated into CSS rules at the user non-!important
     level.
   - The user non-!important level overrides the user agent level.

    -> Therefore the page is black text with blue links on a white canvas.

The body color attributes *never* work. They're always overridden by the
user's choice, even if that choice is the software-shipped default.

                      *            *           *

Less than a dozen of page authors report that the body attributes don't
seem to be working since last Tuesday, and more than six users complain
about their favorite sites being unreadable because the color constrast
gets messed up when the <font> tag's color gets applied without the
<body>-specified background.

So, the developers of our imaginary CSS2.1LCWD-compliant browser, being
very pragmatic people, decide that putting the user settings at the
user non-!important level is really not going to work. They hack the
user settings into the cascade as part of a special UA-level style
sheet (a process similar to backing out 103594), and everything seems
fine.

Of course, also being conscientious standards people, the developers
carefully re-interpret the definition of the User level in section
6.4 to be consistent with their changes. "The user settings panel is
not considered 'an interface that generates a user style sheet (or
behave as if it did)' because it never gets encoded as CSS syntax,"
they explain in the bug report. "The user style sheet specified in
the user stylesheet file picker is still loaded at the user level."
Everyone assumes that the 0.001% of the user base who actually *use*
user stylesheets are probably geeks enough to find a workaround for
their own problems. QA verifies that everything is OK, and life
                                                               moves
                                                                    on.

Chapter 2
Wherein Someone gets a Bright Idea to ship a set of well-designed
User Style Sheets and a clever GUI panel with the browser, thus
making this formerly arcane feature Accessible To All (and thereby
causing many headaches).

Asleep?
[no response]
*lights off*
[exit stage left]

~fantasai

Received on Monday, 19 August 2002 16:34:17 UTC