gss / engine

GSS engine
http://gss.github.io
MIT License
2.86k stars 105 forks source link

Using intrinsic-left & intrinsic-top throws an error #166

Open cbchouinard opened 9 years ago

cbchouinard commented 9 years ago

When using:

top: == &[intrinsic-top];
left: == &[intrinsic-left];

I get the following error: Uncaught Bad initializer to c.Equation

Using x, y works fine:

x: == &[intrinsic-x];
y: == &[intrinsic-y];

I look in the parser and everything seems ok.

Inviz commented 9 years ago

Fixed on 2.1.x branch. Though it doesn't de-duplicate intrinsic-top and intrinsic-y, so binding to intrinsic-y may not reset "left" property. It would be a good time to drop x/y properties and move to left/top by default.

Inviz commented 9 years ago

Per discussion with @d4tocchini we will remove x/y properties and make things be left/top instead. This way only computed-top/intrinsic-top will work and follow logic of computed-height/intrinsic-height.

I also added computed-bottom/computed-height, but computed-size won't work this way. I didnt add intrinsic-bottom/right though, as it's a very dangerous sugar. Do you think we should apply 2d unpacking for size: == intrinsic-size or top-left: == #anchor[computed-right-bottom] to work? Probably there's nothing wrong in hijacking -position, -size, -bottom and -right property suffixes (especially since background-size & background-position work in a similar fashion)

Inviz commented 9 years ago

Another issue was that using intrinsic-top & intrinsic-left still assigned position: absolute. I fixed that, but I better write more tests