W3C home > Mailing lists > Public > www-style@w3.org > April 2014

[css-backgrounds] background-position-x/-y, logical positions, and initial value failure

From: fantasai <fantasai.lists@inkedblade.net>
Date: Thu, 17 Apr 2014 17:50:45 -0700
Message-ID: <535076E5.2020307@inkedblade.net>
To: "www-style@w3.org" <www-style@w3.org>, MURAKAMI Shinyu <murakami@antenna.co.jp>
On 04/16/2014 05:41 PM, Dael Jackson wrote:>
> Add -x/-y longhands to background-* properties
> ----------------------------------------------
>
>    - RESOLVED: background-position-x/-y, background-repeat-x/-y
>          approved for level 4 of backgrounds and borders.

Okay, so this is problematic and here's why:

Let's say we have background-position-x/-y.
We also need logical equivalents, background-position-inline/-block.

So far so good. Similar to margin, which expands out to
   margin-left/right/top/bottom
and
   margin-block-start/block-end/inline-start/inline-end

Now, what's the initial value of these properties?
With margin it's 0. No problem. Everybody is zero, we get
zero margins. No conflicts.
   margin-left: 0;
   margin-right: 0;
   margin-top: 0;
   margin-bottom: 0;
is exactly equivalent to
   margin-inline-start: 0;
   margin-inline-end: 0;
   margin-block-start: 0;
   margin-block-end: 0;
no matter the writing mode. If you tweak any values, the
cascade then says which wins.

But with background-position, the initial values are
   background-position-x: left /* defined by CSS1 */;
   background-position-y: top /* defined by CSS1 */;
There is no way to express an equivalent in logical terms:
   background-position-inline: start;
   background-position-block:  start;
is only equivalent when writing-mode is LTR-TB. Initial values
don't have a cascading order, so when the writing mode is not
LTR-TB, what wins?

I'd like to have background-position-x/y, but we're missing a
solution to make it actually work.

~fantasai
Received on Friday, 18 April 2014 00:51:13 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:21 UTC