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
WebCore::colorFromCocoaColor
can sometimes fail to convert a color
#14414
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Catalyst,
Remember that this is not just about Catalyst, the method can also return NO
on iOS.
EWS run on previous version of this PR (hash 1e6c73b) |
EWS run on current version of this PR (hash 29bcfd6) |
https://bugs.webkit.org/show_bug.cgi?id=257405 rdar://108643609 Reviewed by Aditya Keerthi. The method `[UIColor getRed:green:blue:alpha:]` can fail if the given color is of an incompatible color space, such as `NSColor Generic Gray Gamma 2.2 Profile colorspace 0.5 1`. Previously in the ColorIOS implementation of `WebCore::colorFromCocoaColor`, we would just silently fail and return an empty color. This PR fixes this by checking if `[UIColor getRed:green:blue:alpha:]` is successful. If it is not, we instead create a single colored pixel, and then extract the converted color from it to return. * Source/WebCore/platform/ios/ColorIOS.mm: (WebCore::colorFromCocoaColor): Canonical link: https://commits.webkit.org/264619@main
29bcfd6
to
d4bad90
Compare
Committed 264619@main (d4bad90): https://commits.webkit.org/264619@main Reviewed commits have been landed. Closing PR #14414 and removing active labels. |
d4bad90
29bcfd6