The Pipeline: CSS Compiler
The Sandbox has full support for the CSS 2.1 Grammar version. The original description of its syntax can be found at W3C Grammar of CSS 2.1.
For current experimenting purposes, the Pipeline is using internally a CSS Compiler component built using the COCO/R compiler generator. The resulting Scanner/Parser components have been tested extensively against the W3C CSS 2.1 test suite/s.
The transformation of the CSS artifacts (global, inline or imported style sheets) is realized through an implementation of the Visitor pattern on top of the ASTs (abstract syntax trees) generated by the CSS Compiler component. The Visitor component generates this JSON-ized view of the ASTs to be further consumed by the Policy Engine itself.
Visiting the CSS Abstract Syntax Trees
The recursive application, starting at the CSS Block level, of a Visitor operator generates the JSON-ized view of the aggregated style sheet following the conventions already described. The application of this operator follows the hierarchy of artifacts depicted in the diagram below:
Asynchronous Loading of Imported Style Sheets
The Transformation Pipeline accomodates the transformation of CSS artifacts specified by @import statements through an asynchronous mechanism. For each gadget asset, the following asynchronous CSS processing occurs: