RESOLVED FIXED Bug 202662
Copying white text from dark mode WebKit apps and pasting in a light mode app results in white (invisible) text
https://bugs.webkit.org/show_bug.cgi?id=202662
Summary Copying white text from dark mode WebKit apps and pasting in a light mode app...
Timothy Hatcher
Reported 2019-10-07 17:33:28 PDT
HTMLConverter needs to strip white colors when the document is in dark mode, like it does for black in light mode. <rdar://problem/48677354>
Attachments
Patch (12.77 KB, patch)
2019-10-07 17:36 PDT, Timothy Hatcher
no flags
Patch (12.86 KB, patch)
2019-10-07 18:34 PDT, Timothy Hatcher
no flags
Patch (12.90 KB, patch)
2019-10-08 09:49 PDT, Timothy Hatcher
no flags
Timothy Hatcher
Comment 1 2019-10-07 17:36:33 PDT Comment hidden (obsolete)
Timothy Hatcher
Comment 2 2019-10-07 18:34:00 PDT Comment hidden (obsolete)
Timothy Hatcher
Comment 3 2019-10-08 09:49:58 PDT
Timothy Hatcher
Comment 4 2019-10-08 13:54:22 PDT
Web Inspector layout test failure on WK1 is unrelated. Ready to review.
Megan Gardner
Comment 5 2019-10-08 14:05:30 PDT
Comment on attachment 380438 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=380438&action=review > Source/WebCore/editing/cocoa/HTMLConverter.mm:-864 > - if (red < ColorEpsilon && green < ColorEpsilon && blue < ColorEpsilon && (ignoreBlack || alpha < ColorEpsilon)) I'm guessing this was basically looking for 'black'. I don't know what the trade off for looking for 'probably almost black' and 'true black' is, but I'm trusting this is equal or better than Color::isBlackColor. > Source/WebCore/editing/cocoa/HTMLConverter.mm:882 > + nit whitespace?
Timothy Hatcher
Comment 6 2019-10-08 14:14:49 PDT
Comment on attachment 380438 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=380438&action=review >> Source/WebCore/editing/cocoa/HTMLConverter.mm:-864 >> - if (red < ColorEpsilon && green < ColorEpsilon && blue < ColorEpsilon && (ignoreBlack || alpha < ColorEpsilon)) > > I'm guessing this was basically looking for 'black'. I don't know what the trade off for looking for 'probably almost black' and 'true black' is, but I'm trusting this is equal or better than Color::isBlackColor. Yes, this was looking for black. However, since getRGBA does a division by 255 to convert the hex to a float, so there was this logic to avoid floating point issues. Using Color::isBlackColor is better because it looks at the internal hex, and supports extended color too.
WebKit Commit Bot
Comment 7 2019-10-08 14:56:36 PDT
Comment on attachment 380438 [details] Patch Clearing flags on attachment: 380438 Committed r250863: <https://trac.webkit.org/changeset/250863>
WebKit Commit Bot
Comment 8 2019-10-08 14:56:37 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.