royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <>
Subject Re: [CSS#26]
Date Tue, 06 Mar 2018 16:36:23 GMT
Hi Carlos,

If you can find a way to handle linear-gradient for SWF that would be
great.  I don't know this area of the code that well, but I think you have
at least 3 choices:

1) Alter the AST
2) Output a String
3) Reduce it to a function call.

FWIW, #3 requires changing the reducer which seems scary.  I think I've
avoided it so far.

Options #1 and #2 are similar.  I think you can see that the parsing sets
up a data structure with things like CSSRgbColorPropertyValue and
CSSFunctionCallPropertyValue.  It should be possible to see that a
CSSFunctionCallPropertyValue is a linear-gradient and swap it out for some
other CSS structure that represents what the parser would have generated

#1:  backgroundColors: #000000, #123456;
#2:  backgroundColor: "linearGradient(#000000, #123456)"

For #1, there seems to already be custom styles that end with "xxxColors"
(note plural) that have a list of colors.
For #2, you are trying to set backgroundColor to a String that the
framework could parse at runtime.

Good luck,

On 3/6/18, 4:16 AM, " on behalf of Carlos Rovira"
< on behalf of> wrote:

>Hi Alex,
>I'm looking into CSS compiler files and trying to see what to do. This for
>the momento exceeds me, but I'll try to continue trying to understand this
>part, but will need cross various emails with you:
>For this one:
>I assume the point is in CSSReducer class (line 530), then I need to deal
>with CSSFunctionCallPropertyValue
>but first of all is what to do with  *linear-gradient(#3BB0FF, #1E36FA)'*
>in SWF
>I think this value could not be valid in SWF for "background", but in that
>* we can make it valid
>* maybe for SWF there's some way to discriminate css rules for SWF and for
>(In the end if we want JS and SWF match, I think we should support
>linear-gradients in SWF in some way
>Carlos Rovira

View raw message