RESOLVED FIXED 211993
Fix operator== and hash() for ExtendedColor
https://bugs.webkit.org/show_bug.cgi?id=211993
Summary Fix operator== and hash() for ExtendedColor
Simon Fraser (smfr)
Reported 2020-05-16 22:23:01 PDT
Fix operator== and hash() for ExtendedColor
Attachments
Patch (11.48 KB, patch)
2020-05-16 22:25 PDT, Simon Fraser (smfr)
no flags
Patch (11.28 KB, patch)
2020-05-17 09:32 PDT, Simon Fraser (smfr)
no flags
Patch (11.28 KB, patch)
2020-05-17 10:14 PDT, Simon Fraser (smfr)
sam: review+
Simon Fraser (smfr)
Comment 1 2020-05-16 22:25:46 PDT
Simon Fraser (smfr)
Comment 2 2020-05-17 09:32:39 PDT
Simon Fraser (smfr)
Comment 3 2020-05-17 10:14:49 PDT
Sam Weinig
Comment 4 2020-05-17 10:40:50 PDT
Comment on attachment 399595 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399595&action=review > Source/WebCore/platform/graphics/Color.h:320 > +// One or both may be extended. s/may/must/
Simon Fraser (smfr)
Comment 5 2020-05-17 12:28:37 PDT
Radar WebKit Bug Importer
Comment 6 2020-05-17 12:29:14 PDT
Darin Adler
Comment 7 2020-05-18 13:02:28 PDT
Comment on attachment 399595 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399595&action=review > Source/WebCore/platform/graphics/ExtendedColor.h:78 > + return a.colorSpace() == b.colorSpace() && areEssentiallyEqual(a.channels(), b.channels()); How did you settle on "essentially equal" as the definition of ==, rather than something closer to floating point "=="?
Simon Fraser (smfr)
Comment 8 2020-05-18 13:20:13 PDT
It seemed like the right thing to do? I didn't have any strong evidence to support either choice.
Darin Adler
Comment 9 2020-05-18 13:33:43 PDT
I would suggest that "==" should be built on top of "==", with no shift to "essentially" done beneath the covers. In fact, reflecting on this I know it’s a problem for hashing! It‘s critical for hash functions that if two values compute as "==", then they have the same hash. That seems to not be true.
Simon Fraser (smfr)
Comment 10 2020-05-18 15:32:43 PDT
Note You need to log in before you can comment on or make changes to this bug.