- From: Simon Fraser <smfr@me.com>
- Date: Sun, 21 Feb 2016 13:01:36 -0800
- To: "L. David Baron" <dbaron@dbaron.org>
- Cc: www-style list <www-style@w3.org>
> On Feb 19, 2016, at 6:39 pm, L. David Baron <dbaron@dbaron.org> wrote: > > On Friday 2016-02-19 18:28 -0800, Simon Fraser wrote: >> There is some trickiness with interpolation of side-relative <position> values. Consider: >> >> @keyframes shifty { >> from { background-position: 20px; } >> to { background-position: right 20px; } >> } >> >> Should that work? To make it work you’d have to know the box size when doing interpolation, or I suppose the UA could turn it into a calc() expression? > > In Gecko it works because we internally represent computed values of > background-position as calc() of a length and a percent, since the > three-value and four-value variants can all be reduced to that. > > This is consistent with the "Computed value:" line in > https://drafts.csswg.org/css-backgrounds/#the-background-position , > so I believe it's correct, and that because of that "Computed > value:" line, this should work per spec. It’s not clear to me that the spec allows that calc() to leak out in computed style, yet in Firefox and Chrome, for object-position which also uses a <position>, it does: "object-position: bottom 10px right 20px;" turns into "calc(-20px + 100%) calc(-10px + 100%)” in computed style. Is this expected? Simon
Received on Sunday, 21 February 2016 21:02:08 UTC