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

Re: [css-round-display] Add 'auto' to 'polar-anchor' and make it as initial value

From: Brad Kemper <brad.kemper@gmail.com>
Date: Tue, 19 Apr 2016 11:18:52 -0700
Cc: www-style list <www-style@w3.org>, Hyojin Song <hyojin22.song@lge.com>
Message-Id: <EEDA4FE0-838F-4667-B50C-91D1AE30A143@gmail.com>
To: Jihye Hong <jh.hong@lge.com>


> On Apr 19, 2016, at 12:46 AM, Jihye Hong <jh.hong@lge.com> wrote:
> 
> Hi,
> I think we need 'auto' value for 'polar-anchor' [1].

I agree. 

> Even where a property is not specifically set on an element, the element will often have a default value for that property.
> In the specification, default values are referred to as initial values.
> In CSS Round Display, the initial value for 'polar-anchor' is 'center'.

I don't think it should be. Assuming I am not confusing 'polar-anchor' with 'polar-origin', as I often do, 'polar-anchor: center' should be what lines up the center of the element with the center of the containing block. Since positioned items are not centered by default, the initial value should be 'polar-anchor: auto'. 

> Then, if an element is positioned without specifying 'polar-anchor', where would the representative point of the element be?
> 
> When I suggested 'polar-anchor' for CSS Round Display, it could be used only in polar coordinates.
> After the CSSWG F2F at Sydney, it becomes to be used also in Cartesian coordinates.
> 
> Therefore the representative point of an element will be the center point of it even if 'polar-anchor' is not specified to the element.
> And it should be the same whether the element is in Cartesian coordinates or in polar coordinates.

I agree. 

> But that's against the rules of the box positioning.
> 
> This problem can be solved when 'polar-anchor' can have 'auto' and the initial value of 'polar-anchor' is 'auto'.

That's how I've been imagining it for a long time. As 'auto', it would just be ignored, and with [top/right/bottom/left]:auto values. 

> 'auto' works as:
>   - 'auto' becomes 'top left' if an element is positioned in Cartesian coordinates (specifying Top/Right/Bottom/Left).

I don't know what you mean. top/right/bottom/left properties position items by their top/right/bottom/left edges, while  'polar-anchor' positions items by their centers (which is why I would change the name from 'polar-anchor' to 'center'). 

>   - 'auto' becomes 'center' if an element is positioned in polar coordinates (specifying 'polar-distance' or 'polar-angle').

You aren't really changing the coordinate system of either the element or its containing block. '50% 50%' still refers to halfway across and down from the zero point on the left top. And all other properties continue to use Cartesian coordinates too. 'Polar-distance' and 'polar-angle' are simply an additional transformation from where 'polar-anchor' puts it. 

Polar-anchor:0 0 would put the element's center into the top left corner of the containing block. 

> For example, if there is an element, #item like below: 
> 
> #item {
>   position: absolute;
>   polar-origin: center;
>   width: 50px;
>   height: 50px;
>   background-color: red;
> }
> 
> #item is positioned in the Cartesian coordinate system, so the representative point for positioning #item is at the top left corner.
> The top left corner of #item is positioned at the center of the containing block.

That makes no sense to me. 'polar-origin: center' should mean move the item so that's it's center aligns with the 50% 50% ('center' value) of the containing block.

> And when 'polar-distance' is specified on #item, 
> 
> #item {
>   polar-origin: center;
>   polar-distance: 0px;
>   width: 50px;
>   height: 50px;
>   background-color: red;
> }

Ah, you are making polar-distance into a switch. That's seems unintuitive. 

It makes a lot more sense to me to make 'polar-anchor' the thing that aligns the center of the element with the specified value in the containing block. This would make 'polar-anchor' much more like how top/right/bottom/left work, and polar-distance determines how much to move it at an angle from there (initial value of zero).

Thus with position:relative or polar-anchor:auto, you only have to deal with polar-distance and polar-angle to move it (at a distance along an angle) from its non-positioned location. 

I still feel that using 'polar-' prefix and asking people to think about coordinate systems is adding an unnecessary complication. It brings to mind polar map projections and cartography, and geometry, instead of just saying "this property moves an object so that its center aligns with the specified value, as a point within the containing block." Just as the 'left' property means "move (and/or resize) an object so that its left edge aligns with the specified value, as a distance from the left edge of the containing block."
Received on Tuesday, 19 April 2016 18:19:24 UTC

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