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

Libsass errors on IE expression syntax #1102

Closed
xzyfer opened this issue Apr 14, 2015 · 3 comments · Fixed by #1194
Closed

Libsass errors on IE expression syntax #1102

xzyfer opened this issue Apr 14, 2015 · 3 comments · Fixed by #1194

Comments

@xzyfer
Copy link
Contributor

xzyfer commented Apr 14, 2015

foo {
  display:expression("inline",
    (this.innerHTML += (this.innerHTML.indexOf(",") == -1 ? ", " : "")),
    this.runtimeStyle.display = "inline");
}

Ruby Sass

foo {
  display: expression("inline", (this.innerHTML += (this.innerHTML.indexOf(",") == -1 ? ", " : "")), this.runtimeStyle.display = "inline"); }

Libsass 3.0.0-beta.5

Error: error reading values after 1
        on line 3 of test.scss
>> HTML += (this.innerHTML.indexOf(",") == -1 ? ", " : "")),
   ------------------------------------------^
@xzyfer
Copy link
Contributor Author

xzyfer commented Apr 14, 2015

Related to #690

@xzyfer
Copy link
Contributor Author

xzyfer commented Apr 25, 2015

Specs added sass/sass-spec#344

@am11
Copy link
Contributor

am11 commented May 10, 2015

👍


[Spoiler: Given we have custom functions, it might not be possible. On flip-side, it may be possible since it appears to me that the AST has all the required context to pull this]

IMO, at some point Sass codegens should be able to emit set of the standard CSS, v2 (and above), v3 (and above), v4 (and above) and since so forth. With those set, the compiler should error if the non-conforming pass-through CSS code is encountered. For instance, expression evaluation was ended by IE team in 2008: http://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx and it is no longer supported in standard mode since IE8. Now in a team work, if someone used the expression evaluation, they should get the message if certain compile-time flag was set (say --css2 or --css3). This is similar to how JS superset languages (sweet.js, coffeescript, typescript) are doing it.

With that said, I think a black-list approach would be more appropriate to sniff out the vendor specific (non-prefix) tokens (such as expression(), filter() etc.) and throw.

@mgreter mgreter self-assigned this May 10, 2015
@mgreter mgreter added this to the 3.2.4 milestone May 10, 2015
mgreter added a commit to mgreter/libsass that referenced this issue May 10, 2015
mgreter added a commit to mgreter/libsass that referenced this issue May 10, 2015
mgreter added a commit to mgreter/libsass that referenced this issue May 10, 2015
mgreter added a commit to mgreter/libsass that referenced this issue May 10, 2015
mgreter added a commit to mgreter/libsass that referenced this issue May 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants