flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: [FLEXJS][FALCONJX] Changing JS-side CSS encoding
Date Wed, 14 Sep 2016 22:09:41 GMT
On 9/14/16, 2:31 PM, "Harbs" <harbs.lists@gmail.com> wrote:

>Will this effect the CSS file generated?

The JS-side outputs both a .css file and some data packed onto the
application that is converted into data structures for calls to
ValuesManager (via SimpleCSSValuesImpl).  The .css file won't change, it
needs to be standard CSS.  I am proposing to change the data that is
packed onto the application.

>What do you mean by “hacking at runtime”?

A goal is for MXML output to be data instead of code since you can alter
data at runtime for testing purposes and in case you need to hack in a fix
for something.

Right now, the data is just a flat array of properties followed by values
(a rough approximation is):

[ "global", 3, "fontWeight", "normal", "fontSize", 10, "fontFamily",

This array says create the global CSS selector, and assign it 3
properties: fontWeight: normal, fontSize: 10, fontFamily: "Arial".

Because it is an array, you can alter it before the ValuesImpl interprets
it, swapping in mock objects or different values.

The proposal is to change the data to (roughly):

[ "global", function() { this.fontWeight = normal; this.fontSize = 10;
this.fontFamily = "Arial"];

This is because I couldn't find a good way to generate the function at
runtime and it is theoretically faster to just call the function and get
the object back instead of iterating through the array.  However, you
can't hack the function at runtime, but you could replace it.


View raw message