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

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

From: Brad Kemper <brad.kemper@gmail.com>
Date: Thu, 21 Oct 2010 17:09:29 -0700
Message-Id: <47EF159C-7162-42A8-9458-155944E548C7@gmail.com>
Cc: "L. David Baron" <dbaron@dbaron.org>, "www-style@w3.org" <www-style@w3.org>
To: David Hyatt <hyatt@apple.com>

On Oct 21, 2010, at 1:47 PM, David Hyatt <hyatt@apple.com> wrote:

> On Oct 21, 2010, at 3:17 PM, L. David Baron wrote:
>> On Thursday 2010-10-21 15:12 -0500, David Hyatt wrote:
>>> On Oct 21, 2010, at 3:06 PM, L. David Baron wrote:
>>>> On Thursday 2010-10-21 15:00 -0500, David Hyatt wrote:
>>>>> Can you explain this further?  I don't really understand what
>>>>> you're suggesting.  Examples would help.
>>>>> In WebKit, which implements all of the logical properties, we just
>>>>> resolve direction and writing-mode first (similar to what
>>>>> implementations have to do for font), and then we map the logical
>>>>> property to a physical property.  This is all very simple and
>>>>> takes very little code.  Is there some problem with this approach
>>>>> that I'm missing?
>>>> If you maintain declaration order within your declaration storage,
>>>> and use that declaration order when you're cascading, then it's not
>>>> an issue.
>>> I see.  We do maintain the declaration order in WebKit and use it
>>> when we cascade.  It seems desirable to maintain the order for
>>> stylesheet serialization.
>> Even then, it's still not defined what happens when you do:
>> <div id="d" style="margin-left: 1em; margin-start: 2em"></div>
>> var d = document.getElementById("d");
>> d.style.marginLeft = '3em';
>> Does the d.style.marginLeft setter remove the existing declaration
>> and append a new one, or does it replace the existing value?  The
>> CSSOM spec doesn't define this, and except for serialization it's
>> currently not detectable.  But if we rely purely on order and not on
>> a notion of these properties being shorthands, then it needs to be
>> defined.
> Yeah good point.  As far as WebKit is concerned, there are two distinct properties in the back end declaration storage.  They can be manipulated and set independently and are not considered the same property.  What happens when you set margin-left is pretty implementation-dependent, since when setting a property like this we remove the old one and tack the new one on to the end.  If we just updated the existing one, we'd get a different result obviously.
> This seems like a CSS OM problem to me, though, even though it happens to be exposed by the logical properties.  It doesn't seem like a big deal to me if the above has different results in various implementations for now (until we define that more precisely in the CSS OM).

Is there any particular downside to treating them like the same property, as though margin-start was just a 1-component shorthand for margin-left?

I had kind of assumed that the effect on margin-left in the example would the same whether you used 'margin-start' or just 'margin' (ignoring, for the moment the effect of  'margin' on 'margin-right', etc.). 
Received on Friday, 22 October 2010 00:10:21 UTC

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