Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement selector contextualization for keyframe rules #953

Merged
merged 1 commit into from
Mar 30, 2015

Conversation

mgreter
Copy link
Contributor

@mgreter mgreter commented Mar 16, 2015

Fixes #947

@am11
Copy link
Contributor

am11 commented Mar 16, 2015

👍 🎉

@xzyfer
Copy link
Contributor

xzyfer commented Mar 16, 2015

I don't think this is correct. @keyframes do not have selectors, they have a value/label that is a string.

We should just resolve the interpolate value.

@am11
Copy link
Contributor

am11 commented Mar 16, 2015

@xzyfer, nice catch. But the keyframes-selector can be from and to as well? Would it make sense to keep a whitelist to qualify for the keyframes-selector (in case CSS brings more terms to the mix in future)? ["{numeric_value}%", "from", "to"]
Ref: http://www.w3schools.com/cssref/css3_pr_animation-keyframes.asp

@mechanicalduck
Copy link

Specs: sass/sass-spec#279

@mgreter
Copy link
Contributor Author

mgreter commented Mar 17, 2015

@xzyfer seems odd, since IMO the only place where this value is set is in Expand(Ruleset*):

Statement* Expand::operator()(Ruleset* r) {
...
  Keyframe_Rule* k = new (ctx.mem) Keyframe_Rule ...
  k->selector(r->selector()->perform(contextualize->with(0, env, backtrace)))

So the initial value seems to be a ruleset selector? But maybe you're right. It just looked like an oversight to me, and I thought that this would actually always be a selector ...

@xzyfer
Copy link
Contributor

xzyfer commented Mar 17, 2015

@mgreter it's because the parse is rather dumb about keyframes. It's on my todo list to improve.

@am11 I'd rather not for now because there's a lot of combinators to account for and it may change in the future.

@mgreter
Copy link
Contributor Author

mgreter commented Mar 17, 2015

@xzyfer What do you think about this PR in the meantime? Just wonder if it's better than nothing, regarding that it doesn't seem to break any existing spec tests? Or should I close it then?

@xzyfer
Copy link
Contributor

xzyfer commented Mar 17, 2015

@mgreter I say leave it for now. I'll take a pass doing naive interpolation expanding. If it works as expected I'll use that otherwise I'll ship this.

@xzyfer
Copy link
Contributor

xzyfer commented Mar 28, 2015

I'll take a look at this over the weekend. I think it's rather straight forward.

@mgreter mgreter force-pushed the bugfix/issue_947 branch 5 times, most recently from fc7ab9e to 621f1e7 Compare March 29, 2015 10:48
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 80.42% when pulling 621f1e7 on mgreter:bugfix/issue_947 into 8e7a294 on sass:master.

@mgreter mgreter added this to the 3.2 milestone Mar 29, 2015
@mgreter
Copy link
Contributor Author

mgreter commented Mar 29, 2015

@xzyfer do you think you can come up with a better solution in a reasonable timeframe for the 3.2.0 release? IMO I'd rather include this PR as is than not including a fix for the reported issue. Would really like to include this fix in the next beta! Or do you see any obvious regressions in the changes?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 80.07% when pulling 47dffc5 on mgreter:bugfix/issue_947 into efeace5 on sass:master.

mgreter added a commit that referenced this pull request Mar 30, 2015
Implement selector contextualization for keyframe rules
@mgreter mgreter merged commit b87f4c7 into sass:master Mar 30, 2015
@mgreter
Copy link
Contributor Author

mgreter commented Mar 30, 2015

Merged it beside the concerns given by @xzyfer. IMO this seems to be an improvement and we can add a more precise implementation later. Just want to have this included in the next release!

@mgreter mgreter deleted the bugfix/issue_947 branch April 6, 2015 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interpolate variables in keyframe selector name
5 participants