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

Re: [css-round-display] Summary of a discussion about polar positioning in every positioning schemes

From: Florian Rivoal <florian@rivoal.net>
Date: Thu, 21 Jan 2016 14:39:32 +0900
Cc: Jihye Hong <jh.hong@lge.com>, fantasai <fantasai.lists@inkedblade.net>, www-style list <www-style@w3.org>
Message-Id: <FE4D67A5-0F62-4E47-AD3A-D07015325987@rivoal.net>
To: Brad Kemper <brad.kemper@gmail.com>

> On Jan 21, 2016, at 08:33, Brad Kemper <brad.kemper@gmail.com> wrote:
> 
>> On Jan 20, 2016, at 8:48 AM, Florian Rivoal <florian@rivoal.net> wrote:
>> 
>>> On Jan 20, 2016, at 16:39, Jihye Hong <jh.hong@lge.com> wrote:
>>> 
>>> * polar-origin and polar-anchor can be used independently from the polar
>>> positioning.
>> 
>> I am not necessarily opposed, but I am not fully convinced. Did the rest of the WG agree to that,
>> or were you describing consensus between Brad, you (and maybe me)?
> 
> So far, we three are the only ones to discuss it much. 

Well, Fantasai (at least) had commented on that, and then I missed a call, so I was wondering if there'd be additional agreement when I wasn't around.

> Once you start pulling it apart, polar-origin is little more than a way to center an item prior to moving it at an angle with polar-distance and polar-angle. So you can call it 'center' instead of 'polar-origin', and it would be almost the same as what I proposed. That is what at least two of us agreed on. 
> 
> But fantasai pointed out that the alignment spec already gives a way to center positioned items, and probably handles my other use cases for 'center' (and already uses top, right, bottom, and left for adjusting where the center of the positioning area will be). If that's the case, then I don't think we actually need polar-origin. polar-distance and polar-angle can simply handle the moving-it-at-an-angle part, while other position and alignment properties handle the centering (or off-centering).

That's justify-self: center and align-self: center, right?

I'm not sure it's the right way to go. It seems the mental models are completely disjoined. If you want a polar coordinate system, justification, alignment, margins and offsets from the alignment container isn't what you have in mind. Modulo the fact that percentages on polar-anchor and percentages on margin are calculate of something different, it looks like you should be able to translate anything you might want to do with polar-origin and polar-anchor into that system, but I don't find it intuitive at all (Examples might convince me otherwise).

How much should we value avoiding redundant mechanisms to achive similar things vs having a system that authors actually understand?

#foo {
  position: absolute;
  polar-origin: center center;
  polar-anchor: top center;
  polar-distance: 100px;
  polar-angle: 45deg;
}

The only thing you need a spec for to understand what this does is to know where angles start form.

Contrast with:

#foo {
  position: absolute;
  align-self:center;
  justify-self: center;
  /*??? how do you replace polar anchor ???*/
  polar-distance: 100px;
  polar-angle: 45deg;
}

Actually, I'm not even sure how to do it without either some *-anchor property that lets me say top center (which doesn't feel like a great fit with align-self and justify-self), or some property that would let me express a translation as a percentage of the positioned element's size.

> This would also affect polar-anchor. With centering handled by alignment, you no longer need to care where the center of the element is. You don't need an anchor point. You just move the whole thing. The real effect of polar-anchor was to add an additional horizontal or vertical adjustment, where percentages are of the element's width and height. There is no reason for that utility to depend upon polar-distance.

Especially if you consider percentages, margins seem to be a poor substitute for polar-anchor. Maybe the machinery should be attached to justify-self/align-self rather than polar positioning, but I don't think we have it today.


>>> * auto values for polar-origin and polar-anchor to resolve differently when
>>> polar-distance is auto or non-auto
>>>  - when polar-distance is auto, 
>>>    - polar-origin: auto becomes polar-anchor: 0 0
>>>    - polar-anchor: auto becomes polar-anchor: 0 0
>>>  - when polar-distance is non auto, 
>>>    - polar-origin: auto becomes polar-anchor: center center
>>>    - polar-anchor: auto becomes polar-anchor: 0 0
>> 
>> Assuming we agree polar-origin does anything when polar-distance is auto, then I agree with what you said about polar-origin, but I don't see why polar-anchor needs an auto value. Shouldn't its initial value just be center center (not 0 0)?
> 
> The other way around makes more sense to me. I no longer think about this property as having anything to do with a center point. If we use alignment properties to do the centering, then the center point is irrelevant. No, at the end of the day, polar-anchor is just something to adjust the position. So 0 0 would in all cases mean that you are not adjusting the position. 

If we ditch polar-anchor altogether, then it doesn't matter. If we keep it, for the initial value to be 0 0, then it would need to be described as a translation vector applied before you do the polar positioning, not as an anchor. But if polar-origin and polar-anchor (even if remained) are about which point you align with which point, then they both need to be center center for the thing to work at all.

>>> Please tell me if there is something that I miss.
>> 
>> * If we allow polar positioning to apply to relative positioning, we need to define what percentages in "polar-distance: ???%" refer to, and how contain works in "polar-distance: ???% contain" in relative positioning.
> 
> I'd make them refer to the same thing as top, right, bottom, and left in relative positioning (percentage of containing block). I don't think percentages are super useful on any of these with relative positioning, but it should be consistent, unless there is strong reason otherwise. 

Right. Do people use percentages in top, right, bottom, and left with relative positioning? I agree it probably doesn't matter much, and we can define anything we'd like, in which case consistency is good.

 - Florian
Received on Thursday, 21 January 2016 05:40:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:34 UTC