stealth icon indicating copy to clipboard operation
stealth copied to clipboard

Stealth: CSS Condition/Rule Parser

Open cookiengineer opened this issue 5 years ago • 0 comments

The CSS parser currently cannot parse logical conditions and pretty much lacks the featureset to parse everything in the https://www.w3.org/TR/css3-conditional/ specification.

The RULE.mjs file is created, but isn't integrated anyhow. In order to do so, the CSS.parse() method in parser/CSS.mjs needs to get support for proper body parsing and splitting. Currently, the parsing logic is line-based, do it instead needs to keep track of each nested { and } hierarchy.

The idea is that the RULE.mjs methods can get passed-through their own body signature and delegate everything correctly to the NORMAL/SHORTHAND parsers. The issue here is that this currently heavily relies on the CSS.parse() method, and this is a broken concept that will never work out for this.

  • [ ] Rename RULE.mjs into CONDITION.mjs as this is the logical-condition-parser containing file.
  • [ ] Migrate CSS.parse() method into a delegation pattern using concept
  • [ ] Migrate CSS.parse() into an AST structure that can support logical and logical nested conditions
  • [ ] Migrate CSS.parse() to use a scope-based parser that also respects properties that could have e.g. content: '}' in their values.

cookiengineer avatar Mar 05 '20 10:03 cookiengineer