Bug 266930

Summary: <input type="color"> cannot select a color when NSAutomaticWindowAnimationsEnabled is false
Product: WebKit Reporter: 陈湛明 <chenzhanming04>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Major CC: akeerthi, ap, cdumez, dan, jonasw, justvanrossum, nick, smoley, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac (Intel)   
OS: macOS 14   
Attachments:
Description Flags
The color picker is not working
none
Screen recording of problem
none
test
none
Two text dumps of plist files, that seemed to have caused the misbehavior none

陈湛明
Reported 2023-12-29 08:00:20 PST
Created attachment 469239 [details] The color picker is not working The color picker is not working, nor is the system popup. The workaround is to open the system popup and drag the color at the bottom-left inside the popup to that input element. I am not sure whether it is a macOS or a WebKit bug.
Attachments
The color picker is not working (343.91 KB, image/png)
2023-12-29 08:00 PST, 陈湛明
no flags
Screen recording of problem (296.81 KB, video/mp4)
2024-10-02 09:06 PDT, Jonas Walldén
no flags
test (903 bytes, text/html)
2024-10-03 17:31 PDT, Alexey Proskuryakov
no flags
Two text dumps of plist files, that seemed to have caused the misbehavior (2.87 KB, application/zip)
2024-11-19 07:22 PST, justvanrossum
no flags
Alexey Proskuryakov
Comment 1 2024-01-02 09:57:39 PST
Thank you for the report. Could you please provide your test case, and information about your configuration? This does work in general.
Radar WebKit Bug Importer
Comment 2 2024-01-05 08:01:14 PST
陈湛明
Comment 3 2024-01-08 09:41:33 PST
(In reply to Alexey Proskuryakov from comment #1) > Thank you for the report. Could you please provide your test case, and > information about your configuration? This does work in general. The test case is just a simple HTML file with one line: <input type="color"> It was not working in Safari 17.2.1 (19617.1.17.11.12), neither 272766@main. I am running 14.2.1 (23C71).
Smoley
Comment 4 2024-01-09 13:47:19 PST
This is working for me in Safari Technology Preview 185
Nick
Comment 5 2024-08-20 12:02:21 PDT
I'm still seeing issues with <input type="color"> in 17.5!
Alexey Proskuryakov
Comment 6 2024-08-20 13:09:53 PDT
It is difficult to make any progress here, given that we aren't able to reproduce, and clearly this is working for most people. Is there anything you can see that helps isolate the problem? E.g. does this happen on all devices that you have access to, or just some, and if so, what seems different between these? Does this still happen if you create a fresh user account on your Mac, and try in this account? It may be useful to provide a screen recording and a sysdiagnose, taken immediately after reproducing. Could you please file a report with these using Feedback Assistant, and post the feedback number here for reference?
Jonas Walldén
Comment 7 2024-10-02 09:06:59 PDT
Created attachment 472770 [details] Screen recording of problem
Jonas Walldén
Comment 8 2024-10-02 09:07:57 PDT
I'm in the same situation where <input type="color"> fails to change when selecting a color from the popup balloon. However, it does respond to drag-n-drop of swatches from another color input within the web page as well as via programmatic setting so I doubt the problem is in WebKit framework but rather the process that implements the actual picker UI. I downloaded the latest Safari Tech Preview as of today (release 204, WebKit 20621.1.1.111.3) and captured a screen recording where I'm logging the various events triggered by the control. This shows the standard click and focus events being fired as expected, and even input/change events when dragging swatches between two inputs or clicking the "Random" button, but the popup UI is unable to update the value. Event breakpoints in WebInspector were consistent with the event logging. I also grabbed the current WebKit source and peeked through the various classes in search for some environment condition that could explain the lost events (e.g. locale handling) but I found nothing. My test was performed with Sequoia 15.0 on an MacBook Pro M3 Max. System language is English, though some other locale settings (region/date/time/measurement) are set for Sweden. No Safari extensions installed.
Alexey Proskuryakov
Comment 9 2024-10-03 17:31:42 PDT
Created attachment 472798 [details] test Same test as attachment. I'm unable to reproduce with this test, including after changing the region to Sweden and relaunching Safari. I've highlighted this issue to some others to think about what additional information would help isolate the problem.
Aditya Keerthi
Comment 10 2024-10-03 17:33:50 PDT
Does the issue also reproduce if you click "Show Colors" and use the panel? Or is it only with colors selected from the popover?
Jonas Walldén
Comment 11 2024-10-04 00:29:36 PDT
Thanks Alexey for attaching the test code since I completely forgot that. Hope Live Text saved you some typing. :-) Aditya: Yes, same problem happens with the Show Colors panel. I have experimented a bit more and creating a new user account on the same laptop and running vanilla Safari from Sequoia 15.0 works fine. My primary account was created in 2010 so there's many years of plist accumulation and who knows that "defaults write" I've added since then, e.g. to disable smooth scrolling system-wide. I tried using Console.app to see if there were any messages of interest but there's too much noise to say for sure. E.g. there's "parent BrowserWindow 0x7176ee580 (bbe8) add _NSPopoverWindow 0x70dbd8400 (bf46) to group" that looks to be related, but if there is something in particular I should look for please let me know. Are there similar XPC-driven popups I can compare? <input type="date"> works without problem at least. The color picker in Web Inspector looks completely different (and works fine) so that seems unrelated as well.
Dan
Comment 12 2024-11-19 07:14:29 PST
It seems deleting `.GlobalPreferences.plist` and `.GlobalPreferences_m.plist` from `~/Library/Preferences/` has worked for some Safari users (see, for example, the discussion at https://talk.observablehq.com/t/problem-with-color-picker-on-safari-for-mac/6558/), so maybe the plist culprits can be narrowed down to these two?
justvanrossum
Comment 13 2024-11-19 07:21:13 PST
Hi Dan, I was just about to comment the same... I was experiencing this problem and removing these files (followed by a restart) helped. ~/Library/Preferences/.GlobalPreferences.plist and ~/Library/Preferences/.GlobalPreferences_m.plist Just in case this is helpful: I managed to make a text dump of those two files before I removed them. I will try to attach them as a zip archive named "GlobalPreferences_dumps.zip".
justvanrossum
Comment 14 2024-11-19 07:22:52 PST
Created attachment 473278 [details] Two text dumps of plist files, that seemed to have caused the misbehavior The zip archive contains text dumps of these files: ~/Library/Preferences/.GlobalPreferences.plist ~/Library/Preferences/.GlobalPreferences_m.plist
Alexey Proskuryakov
Comment 15 2024-11-19 09:05:00 PST
Perfect, thank you so much. The culprit is NSAutomaticWindowAnimationsEnabled, the issue reproduces with this command: /Applications/Safari.app/Contents/MacOS/Safari -NSAutomaticWindowAnimationsEnabled 0
Jonas Walldén
Comment 16 2024-11-19 09:30:01 PST
Great detective work! I have the same setting in my main user account, and I can get the color picker to work again by enabling window animations.
Note You need to log in before you can comment on or make changes to this bug.