GoSuB Browser Progress, pt26

Created at 2023-11-29 13:00:11 (4 months ago)

There is been a lot of yak shaving the last week. I wanted to work on the whole "http connection -> rendertree" pipeline, but I got stuck at the point that I wanted to incorporate the CSS parser in the main html5 parser. To make things easy, i wanted to use a blocking parser: when it finds a stylesheet, it will stop the html5 parsing until the css3 parsing is done.

Unfortunately, the CSS3 isn't as easy as (at least I) thought. Turns out we have a tokenizer and parser for the general CSS, but that just converts it into blocks of rules. It doesn't actually do anything syntaxly with the data. So, it will see there is a qualified rule, but the prelude/selectors aren't parsed into neat selectors yet.

This is where i'm currently stuck at. I'm trying to use nom for doing some generating of the css-tree and the idea might be ok, I have a lot of trouble with execution. I don't understand the library enough to use it properly yet (it doesn't help if you are parsing custom tokens instead of chars, although this should be possible with nom according to the internet (so it must be true)).

So, at least this week, probably next one too, will be about trying to make CSS3 sheets into an AST tree that can be used at the render-tree level (and actually also at the CSSOM interface, which should be fairly easy to implement at that point).

Much progress is being made (not by me) with the javascript research and implementation, so I'm hoping we get this implemented very soon as well.

rust parsing nom css3

About jaytaph

Codemuser extraordinaire

avatar Loves building crazy and insane stuff. Happiest when left alone. All I wanted was a Pepsi, just a Pepsi.
Joined:March 24, 2023
Following:2
Followers:2
Posts:46
Comments:3
Upvotes:4
RSS feed