W3C home > Mailing lists > Public > www-style@w3.org > October 2010

Re: [css3-writing-modes] a third option for implementing logical properties

From: David Hyatt <hyatt@apple.com>
Date: Sun, 24 Oct 2010 18:01:44 -0500
Cc: John Daggett <jdaggett@mozilla.com>, "L. David Baron" <dbaron@dbaron.org>, www-style@w3.org
Message-id: <DED199E9-88C2-49FE-B987-119FDCA03AE3@apple.com>
To: Håkon Wium Lie <howcome@opera.com>
On Oct 24, 2010, at 5:32 PM, Håkon Wium Lie wrote:

> Also sprach David Hyatt:
>> What about allowing named sub-blocks within a declaration block?
>> Then everything could cascade properly. Maybe via a new @-rule.
>> @writing-mode p {
>> 	horizontal {
>> 		margin: 1em 0;
>> 	}
>> 	vertical {
>> 		margin: 0 1em;
>> 	}
>> }
> Hmm. So, you're branching based on the computed value of
> 'writing-mode'? In principle, you could use the same syntax for other
> properties, e.g.:
>  @font-style p {
>    italic {
>      color: red;
>    }
>    normal {
>      color: blue;
>    }
>  }
> (Not that I would encourage it.)

Yeah, basically.  Engines already have to collect the rules and then do a first pass to resolve the properties that the other ones depend on (font, direction, writing-mode) and then do a second pass to compute the values for the other properties.  This means the solution above should be easily implementable in any engine.

> I'm not sure we need per-element switches, though. I think the use
> case is more for different document modes. For example, a button on a
> Japanese tablet that toggles between vertical and horizontal layout.

That's one thing I'm wondering as well.  Is there really any desire to be abstract at the element level (other than on the part of the UA, who can always just use internal logical properties that aren't exposed to authors)?  If the switching really is done at a document level, then a media query makes a lot of sense.

It's really a question of whether the logical properties will make authoring significantly easier for those who wish to use them.  I don't know enough about Japanese text layout to say for sure.  I suppose it's a question of how big the stylesheets are for these documents and how many rules you would have to duplicate in order to support both modes.

Received on Sunday, 24 October 2010 23:02:27 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:40 UTC