googleprojectzero / domato

DOM fuzzer
https://googleprojectzero.blogspot.ch/2017/09/the-great-dom-fuzz-off-of-2017.html
Apache License 2.0
1.69k stars 278 forks source link

Grammar for Canvas API #17

Closed symeonp closed 6 years ago

symeonp commented 6 years ago

Based on Ivan's comments.

symeonp commented 6 years ago

Hey thanks, so I've updated those issues here: https://github.com/symeonp/domato/commit/2352c18f756d877f58c0311a0d042571bf13d740

My question, now am getting somehow that colour not found, this doesn't make sense honestly. I've also commented out google's license cause it would get rendered as html code and added one-two new canvas functions and included cssproperties.txt. Is there anything else you can think of that needs to get improved? Am not closing the PR for the time being so I won't have to flood your project with PRs. Thanks so much!

ifratric commented 6 years ago

Thanks for working on this!

I see where the problem is - you put !include ... after !begin lines, which means that the contents of the included lines will be treated like programming language lines instead of context free grammar rules (which they are). The included rules use whatever context the parser was using at the include point.

symeonp commented 6 years ago

My pleasure! I did however experiment a bit at some phase and even adding them at the top of the grammar am still getting the above exception. Not quire sure what I'm missing here, thanks!

ifratric commented 6 years ago

The included files also need to be copied to the same directory as the current grammar (canvas.txt), that's the only other thing I can think of.

symeonp commented 6 years ago

Okay, I figured it out, somehow I had "<color"> instead of "<color>", had to debug it a bit! Plus the exception clearly mentions it, which I missed heh! That's why I was wondering how come did it work before, cool thanks!

ifratric commented 6 years ago

Hey, sorry about the radio silence on my part, I was kept pretty busy by other things. I had a chance to play with it again today and I think it looks good! Merging :-)

symeonp commented 6 years ago

Hey Ivan, thank you so much, that's great! I will try to implement more functions in the near future as well. Cheers

ifratric commented 6 years ago

Thank you for working on it!