News for hackers. Stuff that matters.
Re:CSS Reminification: A crazy idea that worked by sbierwagen on Wednesday March 08, 2017 @07:01PM (#13825217)
If you really want to get fancy you could use Selenium to get screenshots and compare them to check that the remynified CSS produces the same layout as the original CSS.

http://www.seleniumhq.org/

Re:CSS Reminification: A crazy idea that worked by chiefofgxbxl on Wednesday March 08, 2017 @08:40PM (#13826019)
To add to that point, if you manage to get screenshots you can do an image comparison using perceptual hashing [0]. The idea is to compute hashes of images and compare those, rather than scanning through each pixel.

Note that perceptual hashes should not obey the avalanche effect, so a minor difference in the two images should yield a small change in the hashes (desirable in this case). Then accept results that are within some small % error margin.

An example of a library that does this is jimp [1].

[0] https://en.wikipedia.org/wiki/Perceptual_hashing [1] https://github.com/oliver-moran/jimp#comparing-images

Re:CSS Reminification: A crazy idea that worked by bowmessage on Wednesday March 08, 2017 @08:43PM (#13826045)
This is a really cool concept. Thanks.
Re:CSS Reminification: A crazy idea that worked by Khalos on Wednesday March 08, 2017 @07:53PM (#13825675)
This would be great, but would probably significantly hurt performance.

Especially if media queries come into play and we'd have to try different resolutions and ensure they're all the same.

Re:CSS Reminification: A crazy idea that worked by askmike on Wednesday March 08, 2017 @07:54PM (#13825684)
> Especially if media queries come into play

Or even more simply: if your CSS is supposed to work on all pages of a website.

Re:CSS Reminification: A crazy idea that worked by bastawhiz on Wednesday March 08, 2017 @09:44PM (#13826468)
And @supports, and vendor prefixes, and animations, and print styles, and IE hacks...
Re:CSS Reminification: A crazy idea that worked by make3 on Thursday March 09, 2017 @04:43AM (#13828224)
running one instance for each combination for each targeted browser and browser version, lol. this would take forever