stealth icon indicating copy to clipboard operation
stealth copied to clipboard

CSS Parser: Language Parser Features

Open cookiengineer opened this issue 4 years ago • 0 comments

The new recursive-descent Parser is now implemented and somewhat stable in its featureset. In order to implement the first language, the CSS Parser has to be written from scratch in order to have a real AST that's not limited by a line-by-line parsing approach.

The problem with CSS's specifications is that they are very unclear in regards to syntax, as they heavily rely on a generic "non-ASCII ident token" which pretty much can be everything, including the :hankey: emoji.

This issue tries to keep track of the relevant CSS specifications and their implications (to have a feature list of things that are not yet implemented).

Animations Level 1

  • [ ] @keyframes
  • [ ] animation properties

Media Queries Level 3

Reasons not to implement Media Queries Level 4 and 5: expressions inside the media-feature(s) can be endlessly chained, which is very likely malicious to some extend. Therefore >=, >, <, <= as operators are not being implemented, and only the and and or syntax will be supported.

  • [ ] @media
  • [ ] @supports
  • [ ] Implement the conditions based on the correct precedence of and, or and only.
  • [ ] only as a keyword has no effect, and is only there to make legacy Browsers ignore the media query.

Conditional Rules Level 3

  • [ ] Rules can be nested recursively inside the body of a @media or @supports rule and therefore can contain both style-rule and at-rule inside them.

Values and Units Module Level 4

Numeric Data Types:

  • [ ] integer data type
  • [ ] number data type
  • [ ] dimension values
  • [ ] percentage values
  • [ ] ratio data type

Length Data Type

  • [ ] Relative Lengths
  • [ ] Absolute Lengths

Other Quantities

  • [ ] Angle Units
  • [ ] Duration Units
  • [ ] Frequency Units

Other Data Types

  • [ ] color data type
  • [ ] image data type
  • [ ] position data type (2d positioning)

Functions

  • [ ] attr() function
  • [ ] Mathematical Expressions

Paged Media Module Level 3

  • [ ] @page rule
  • [ ] Page Margin Boxes
  • [ ] Page Properties
  • [ ] Page Size
  • [ ] Page Breaks

cookiengineer avatar Jan 31 '21 18:01 cookiengineer