serenity icon indicating copy to clipboard operation
serenity copied to clipboard

LibWeb: Clip property CSS

Open martinfalisse opened this issue 3 years ago • 1 comments

Add ability to parse a Rect when it is passed to the Clip property in CSS, and then later implement it when drawing divs (borders, text, backgrounds).

Fixes a bug I found in aljazeera.com where they use a div with clip: rect(0px, 0px, 0px, 0px) that is supposed to be invisible.

before: Screenshot from 2022-07-29 16-13-21 after: Screenshot from 2022-07-29 19-56-42

martinfalisse avatar Jul 29 '22 17:07 martinfalisse

Made the changes. Thank you for the feedback!

martinfalisse avatar Jul 31 '22 01:07 martinfalisse

@MacDue thanks for your feedback. This implementation does seem more correct. I don't seem to be finding any bugs with this implementation, though to be honest I wasn't seeing text glitches in the previous one either. I could believe that there were problems with child elements though, may not have tested that enough.

martinfalisse avatar Aug 02 '22 13:08 martinfalisse

@martinfalisse The child elements were not tested before, but it failed on the wpt.live tests without it (which uses them in every test) -- maybe add a few to your own tests :^)

MacDue avatar Aug 02 '22 13:08 MacDue