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

content: url fails to compile #34

Closed
carlosrovira opened this issue Mar 24, 2018 · 6 comments
Closed

content: url fails to compile #34

carlosrovira opened this issue Mar 24, 2018 · 6 comments
Assignees
Labels
Milestone

Comments

@carlosrovira
Copy link
Contributor

Hi,

while

content: "Hello";

is compiled right, this other:

content: url(assets/checkbox-tick.svg);

Fails with the following error:

Internal error: java.lang.ClassCastException: org.apache.royale.compiler.internal.css.CSSURLAndFormatPropertyValue cannot be cast to org.apache.royale.compiler.internal.css.CSSStringPropertyValue org.apache.royale.compiler.internal.css.CSSProperty.toCSSString(CSSProperty.java:77)

I'll try to do this in other way, but for now it seems the best way to create the tick in a checkbox via svg. Tested modifying the CSS live on the browser works great. Hope you could fix this

Thanks

@Harbs
Copy link
Contributor

Harbs commented Mar 24, 2018

You are missing quotes in the url var. It should be something like this:
content: url('assets/checkbox-tick.svg');

@Harbs
Copy link
Contributor

Harbs commented Mar 24, 2018

That said, it could be the error should be more descriptive...

@Harbs
Copy link
Contributor

Harbs commented Mar 24, 2018

Hmm. It seems like unquoted urls are allowed in HTML CSS: https://developer.mozilla.org/en-US/docs/Web/CSS/url

@carlosrovira
Copy link
Contributor Author

Right, in fact we need to support unquouted, since this is related to bug #35
I'm think I solved it in compiler, but now don't know how to handle it in SimpleCSSValuesImpl, since it seems it expects to have the quotes, but don't know where is processed. At least with my fix in the compiler branch there's no error, but it's not working ok

@carlosrovira
Copy link
Contributor Author

But regarding you proposed solution I tried to use it with quotes and it doesn't work.

@aharui aharui self-assigned this Mar 27, 2018
@aharui aharui closed this as completed in 546b5a5 Mar 27, 2018
@carlosrovira
Copy link
Contributor Author

Hi Alex, This is working now, thanks!

@carlosrovira carlosrovira added this to the v0.9.3 milestone Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants