Summary: | Copying white text from dark mode WebKit apps and pasting in a light mode app results in white (invisible) text | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Timothy Hatcher <timothy> | ||||||||
Component: | WebKit Misc. | Assignee: | Timothy Hatcher <timothy> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | bdakin, commit-queue, ews-watchlist, megan_gardner, mifenton, thorton, webkit-bug-importer, wenson_hsieh | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | Safari Technology Preview | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Timothy Hatcher
2019-10-07 17:33:28 PDT
Created attachment 380377 [details]
Patch
Created attachment 380381 [details]
Patch
Created attachment 380438 [details]
Patch
Web Inspector layout test failure on WK1 is unrelated. Ready to review. 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? 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. Comment on attachment 380438 [details] Patch Clearing flags on attachment: 380438 Committed r250863: <https://trac.webkit.org/changeset/250863> All reviewed patches have been landed. Closing bug. |