Bug 228859

Summary: caret-color does not work on first click in ios
Product: WebKit Reporter: Rostislav Shtanko <shtanko243>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: akeerthi, hi, megan_gardner, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: iPhone / iPad   
OS: iOS 14   
Attachments:
Description Flags
example of invalid caret color
none
Patch none

Description Rostislav Shtanko 2021-08-06 02:08:25 PDT
Hello!
I faced a problem with CSS in ios 13 - custom caret color, which can be defined by caret-color style is not working on first browser load. https://developer.mozilla.org/en-US/docs/Web/CSS/caret-color
I provided an example in the attachment. 
This problem can be reproduced at least in ios 13.3, ios 13.6, and in ios 14.2 (browsers: safari, google chrome). In the example, I'm using an ios simulator, but actually, the problem is the same on real devices. 
IOS Version in the example is 13.3.
Comment 1 Rostislav Shtanko 2021-08-06 02:27:19 PDT
Created attachment 435059 [details]
example of invalid caret color
Comment 2 Wenson Hsieh 2021-08-07 12:52:34 PDT
This doesn't reproduce for me on iOS 15 (I tested iPhone w/ software keyboard and iPad with hardware keyboard).
Comment 3 Wenson Hsieh 2021-08-07 12:57:13 PDT
(In reply to Wenson Hsieh from comment #2)
> This doesn't reproduce for me on iOS 15 (I tested iPhone w/ software
> keyboard and iPad with hardware keyboard).

Never mind, I'm able to reproduce now — this only happens if I focus the input field right after backgrounding Safari and bringing it to the foreground again.
Comment 4 Radar WebKit Bug Importer 2021-08-08 14:36:10 PDT
<rdar://problem/81674787>
Comment 5 Wenson Hsieh 2021-08-08 15:28:01 PDT
Created attachment 435159 [details]
Patch
Comment 6 Wenson Hsieh 2021-08-08 18:16:33 PDT
Comment on attachment 435159 [details]
Patch

Thanks for the review!
Comment 7 EWS 2021-08-08 18:21:48 PDT
Committed r280767 (240352@main): <https://commits.webkit.org/240352@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435159 [details].
Comment 8 Rostislav Shtanko 2021-08-09 00:58:01 PDT
Thank you for the patch. Is it possible to use it in my safari 13 (ios 13)?
Comment 9 Wenson Hsieh 2021-08-09 07:56:30 PDT
(In reply to Rostislav Shtanko from comment #8)
> Thank you for the patch. Is it possible to use it in my safari 13 (ios 13)?

Unfortunately, not on iOS 13. I will leave an update when this fix makes it into a beta release of iOS — thank you for your patience!