mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-08 16:12:23 +02:00
The spec is unclear about when exactly we should parse the style sheet. Previously we'd do so before calling this algorithm, which was error-prone, as seen by the bug fixed by the previous commit. The spec for step 1 of "create a CSS style sheet" says: 1. Create a new CSS style sheet object and set its properties as specified. The definitions linked are UA-defined enough that it seems reasonable to put the parsing here. That simplifies the user code a little and makes it harder to mess up. It does raise the question of what to do if parsing fails. I've matched our previous behaviour by just logging and returning in that case. While I'm modifying this method, I've also converted the bool params to enums so they're a little clearer to read.
31 KiB
31 KiB