[macos] Fixed attribution round-tripping test

AppKit incorrectly uses calibrated RGB when exporting HTML, so input calibrated RGB to ensure round-tripping.
This commit is contained in:
Minh Nguyễn
2020-02-24 22:34:28 -08:00
committed by Minh Nguyễn
parent 4c8f5524a9
commit a0c7b2d72c

View File

@@ -69,10 +69,11 @@
#if TARGET_OS_IPHONE
UIColor *redColor = [UIColor redColor];
#else
// CSS uses the sRGB color space. In macOS 10.12 Sierra and below,
// -[NSColor redColor] is in the calibrated RGB space and has a slightly
// different sRGB value than on iOS and macOS 10.13 High Sierra.
NSColor *redColor = [NSColor colorWithSRGBRed:1 green:0 blue:0 alpha:1];
// CSS uses the sRGB color space.
// AppKit incorrectly uses calibrated RGB when exporting HTML, so input
// calibrated RGB to ensure round-tripping.
// <rdar://problem/46115233> <http://www.openradar.me/46115233>
NSColor *redColor = [NSColor colorWithCalibratedRed:1 green:0 blue:0 alpha:1];
#endif
NSAttributedString *gl = [[NSAttributedString alloc] initWithString:@"GL" attributes:@{
NSBackgroundColorAttributeName: redColor,