| Summary: | Date/time inputs should not use user-specified formats | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Aditya Keerthi <akeerthi> | ||||||
| Component: | Forms | Assignee: | Aditya Keerthi <akeerthi> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | cdumez, webkit-bug-importer, wenson_hsieh | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | Safari Technology Preview | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Aditya Keerthi
2020-09-14 10:54:15 PDT
Created attachment 408726 [details]
Patch
Comment on attachment 408726 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=408726&action=review > Source/WebCore/ChangeLog:19 > + No new tests due to an inability to change system settings. We have a number of ways to change user defaults just for DRT/WKTR. I'm not sure if we have exactly what's needed here, but it's far from impossible. Created attachment 409138 [details]
Patch
Added a test. Comment on attachment 409138 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409138&action=review > Tools/TestWebKitAPI/Tests/mac/DateInputTests.mm:59 > + system([NSString stringWithFormat:@"defaults write %@ %@ -dict-add %@ %@", domain, preferencesKey, @"1", customDateFormat].UTF8String); Nit - is there a more elegant way to do this using NSUserDefaults? > Tools/TestWebKitAPI/Tests/mac/DateInputTests.mm:67 > + system([NSString stringWithFormat:@"defaults delete %@ %@", domain, preferencesKey].UTF8String); (Ditto) (In reply to Wenson Hsieh from comment #6) > Comment on attachment 409138 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=409138&action=review > > > Tools/TestWebKitAPI/Tests/mac/DateInputTests.mm:59 > > + system([NSString stringWithFormat:@"defaults write %@ %@ -dict-add %@ %@", domain, preferencesKey, @"1", customDateFormat].UTF8String); > > Nit - is there a more elegant way to do this using NSUserDefaults? The only way to do this using NSUserDefaults is through `[NSUserDefaults setPersistentDomain:forName:]` using `NSGlobalDomain`. Unfortunately, that approach will result in all other global preferences being cleared. Committed r267283: <https://trac.webkit.org/changeset/267283> All reviewed patches have been landed. Closing bug and clearing flags on attachment 409138 [details]. |