We should support drawing focus rings on iOS.
<rdar://problem/6508697>
Created attachment 359520 [details] Patch
Created attachment 359522 [details] Patch Remove ColorIOS.mm from Xcode project and add to SourceCocoa.txt so that it can be part of unified builds.
Comment on attachment 359522 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359522&action=review > Source/WebCore/platform/ios/ColorIOS.mm:37 > + // FIXME: Make this work for a UIColor that was created from a pattern. Also make it work with DispayP3 colors. > Source/WebCore/platform/ios/ColorIOS.mm:46 > + static const double scaleFactor = nextafter(256.0, 0.0); > + return makeRGBA(scaleFactor * redComponent, scaleFactor * greenComponent, scaleFactor * blueComponent, scaleFactor * alpha); Why not makeRGBA32FromFloats()?
(In reply to Simon Fraser (smfr) from comment #4) > Comment on attachment 359522 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=359522&action=review > > > Source/WebCore/platform/ios/ColorIOS.mm:37 > > + // FIXME: Make this work for a UIColor that was created from a pattern. > > Also make it work with DispayP3 colors. Will amend this comment before landing. > > > Source/WebCore/platform/ios/ColorIOS.mm:46 > > + static const double scaleFactor = nextafter(256.0, 0.0); > > + return makeRGBA(scaleFactor * redComponent, scaleFactor * greenComponent, scaleFactor * blueComponent, scaleFactor * alpha); > > Why not makeRGBA32FromFloats()? So, you're staying makeRGBA32FromFloats() is analogous to this code? I took this code from ColorMac.m: <https://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/mac/ColorMac.mm?rev=240041#L56>.
(In reply to Daniel Bates from comment #5) > > > Source/WebCore/platform/ios/ColorIOS.mm:46 > > > + static const double scaleFactor = nextafter(256.0, 0.0); > > > + return makeRGBA(scaleFactor * redComponent, scaleFactor * greenComponent, scaleFactor * blueComponent, scaleFactor * alpha); > > > > Why not makeRGBA32FromFloats()? > > So, you're staying makeRGBA32FromFloats() is analogous to this code? I took > this code from ColorMac.m: > <https://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/mac/ > ColorMac.mm?rev=240041#L56>. I am going to defer doing this for now as makeRGBA32FromFloats() does not seem to produce identical results from code inspection as well as by the comment in Color.cpp, <https://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/Color.cpp?rev=240041#L84>. If I make this change for ColorIOS.mm then we should make it for ColorMac.mm.
Created attachment 359539 [details] To Land
Committed r240174: <https://trac.webkit.org/changeset/240174>
(In reply to Daniel Bates from comment #6) > (In reply to Daniel Bates from comment #5) > > > > Source/WebCore/platform/ios/ColorIOS.mm:46 > > > > + static const double scaleFactor = nextafter(256.0, 0.0); > > > > + return makeRGBA(scaleFactor * redComponent, scaleFactor * greenComponent, scaleFactor * blueComponent, scaleFactor * alpha); > > > > > > Why not makeRGBA32FromFloats()? > > > > So, you're staying makeRGBA32FromFloats() is analogous to this code? I took > > this code from ColorMac.m: > > <https://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/mac/ > > ColorMac.mm?rev=240041#L56>. > > I am going to defer doing this for now as makeRGBA32FromFloats() does not > seem to produce identical results from code inspection as well as by the > comment in Color.cpp, > <https://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/ > Color.cpp?rev=240041#L84>. If I make this change for ColorIOS.mm then we > should make it for ColorMac.mm. We have multiple code paths that do float -> 0-255 color component conversions, and I think we probably have 3 types of rounding: 1. Multiply by nextafter(256.0, 0.0); 2. colorFloatToRGBAByte() which is lroundf(255.0f * f) 3. f * 255 and truncate. We need to standardize on one.
Committed attempt to fix the iOS build in <https://trac.webkit.org/changeset/240177>.
Committed another build fix in <https://trac.webkit.org/changeset/240179/>.
Committed another build fix in <https://trac.webkit.org/changeset/240185/>.