ladybird icon indicating copy to clipboard operation
ladybird copied to clipboard

LibWeb: Add fuzzing test for calc() usage

Open AtkinsSJ opened this issue 1 year ago • 3 comments

As can be seen from the output, we're missing full calc() support for the following properties:

  • [ ] column-count
  • [ ] grid-auto-columns
  • [ ] grid-auto-rows
  • [ ] grid-template-columns
  • [ ] grid-template-rows
  • [ ] line-height
  • [ ] transform-origin

~~The grid-* ones seem to just be missing a getComputedStyle implementation, so it's hard to tell.~~ I found the bug, it's fixed in a commit here.

AtkinsSJ avatar Oct 14 '24 11:10 AtkinsSJ

True. I also realised while having lunch that this doesn't properly test things, because anything with var() in (which I added to stop it immediately being simplified) has its calc()s resolved in a different code path. So I'll rewrite it to try each property multiple times with different values instead.

Removing that path doesn't make us fail any of our tests but does mean we serialise calc() values verbatim instead of simplified, so we'll fail a bunch of WPT tests. I really ought to get simplification done.

AtkinsSJ avatar Oct 14 '24 11:10 AtkinsSJ

Changes:

  • Add test cases that don't use var().
  • Rename the test.
  • Add in a fix for grid-template-* properties serializing to the empty string.

AtkinsSJ avatar Oct 14 '24 13:10 AtkinsSJ

Rebased because I merge-conflicted myself with the grid-*-gap change. :laughing:

AtkinsSJ avatar Oct 14 '24 16:10 AtkinsSJ

Just corrected the commit message, there were a couple more properties I hadn't noticed I'd fixed. :laughing:

AtkinsSJ avatar Oct 15 '24 09:10 AtkinsSJ