Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hsl doesn't behave the same way in Edge as in Chrome #374

Open
lionleaf opened this issue Aug 8, 2018 · 1 comment
Open

hsl doesn't behave the same way in Edge as in Chrome #374

lionleaf opened this issue Aug 8, 2018 · 1 comment
Labels
bug contributions welcome Feel free to assign this issue to yourself and work on it

Comments

@lionleaf
Copy link
Owner

lionleaf commented Aug 8, 2018

This breaks some dweets in Edge, for instance https://www.dwitter.net/d/9098

Maybe another Edge-fix to deal with this?

Thanks to u/mvs202 for raising this! He believes it is the 4th parameter of hsl not behaving properly in Edge, and automatically changing it to hsla might be a fix.

@lionleaf lionleaf added bug contributions welcome Feel free to assign this issue to yourself and work on it labels Aug 8, 2018
@joeytwiddle
Copy link
Collaborator

joeytwiddle commented Aug 8, 2018

I guess that would need to be some setters added to the canvas (with defineProperty), intercepting assignments to fillStyle and strokeStyle.

Are there any other properties we would need to intercept? ...CSS...? Here is one: shadowColor

So far there are three shortcuts that work in Chrome and Firefox but not everywhere:

# Dropping the ')'

hsl(1,20%,30%     ->  hsl(1,20%,30%)

# Dropping the 'a' but still passing a fourth argument

hsl(4,30%,20%,.1  ->  hsla(4,30%,20%,.1)

# Dropping the ','s

hsl(4 30%20%      ->  hsl(4,30%,20%)

To fix for everyone, we would need to efficiently detect each of those shortcuts, and convert to the full version.


Test dweets:

https://www.dwitter.net/d/9170
The bottom-right square combines the first two shortcuts. That fails on iOS Safari, Edge and Linux Chromium 64.0

https://www.dwitter.net/d/9161
Uses the third shorcut. The sphere appears black on Linux Chromium 64.0 and 65.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug contributions welcome Feel free to assign this issue to yourself and work on it
Projects
None yet
Development

No branches or pull requests

2 participants