Bug 198687

Summary: Integrate dark mode support for iOS
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: WebKit Misc.Assignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: ajuma, bdakin, commit-queue, ews, fred.wang, megan_gardner, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Timothy Hatcher 2019-06-07 21:40:57 PDT
Put iOS dark mode support in the open source.
Comment 1 Radar WebKit Bug Importer 2019-06-07 21:41:06 PDT
<rdar://problem/51545643>
Comment 2 Timothy Hatcher 2019-06-08 21:55:55 PDT Comment hidden (obsolete)
Comment 3 Timothy Hatcher 2019-06-08 23:05:27 PDT Comment hidden (obsolete)
Comment 4 Build Bot 2019-06-08 23:06:57 PDT Comment hidden (obsolete)
Comment 5 Timothy Hatcher 2019-06-08 23:11:32 PDT Comment hidden (obsolete)
Comment 6 Tim Horton 2019-06-08 23:38:58 PDT
Comment on attachment 371705 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=371705&action=review

> Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig:119
> +ENABLE_DARK_MODE_CSS_iphonesimulator = ENABLE_DARK_MODE_CSS;

Probably iosmac too?
Comment 7 Timothy Hatcher 2019-06-09 13:19:17 PDT Comment hidden (obsolete)
Comment 8 Timothy Hatcher 2019-06-09 13:45:12 PDT Comment hidden (obsolete)
Comment 9 Timothy Hatcher 2019-06-09 18:48:41 PDT
Created attachment 371715 [details]
Patch
Comment 10 Tim Horton 2019-06-10 11:25:24 PDT
Comment on attachment 371715 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=371715&action=review

> Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm:133
> +    styleConfiguration.appearanceName = coreContext.useDarkAppearance() ? @"UIAppearanceDark" : @"UIAppearanceLight";

No constants for these?
Comment 11 Timothy Hatcher 2019-06-10 11:49:30 PDT
(In reply to Tim Horton from comment #10)
> Comment on attachment 371715 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=371715&action=review
> 
> > Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm:133
> > +    styleConfiguration.appearanceName = coreContext.useDarkAppearance() ? @"UIAppearanceDark" : @"UIAppearanceLight";
> 
> No constants for these?

Sadly not.
Comment 12 WebKit Commit Bot 2019-06-10 12:19:22 PDT
Comment on attachment 371715 [details]
Patch

Clearing flags on attachment: 371715

Committed r246270: <https://trac.webkit.org/changeset/246270>
Comment 13 WebKit Commit Bot 2019-06-10 12:19:24 PDT
All reviewed patches have been landed.  Closing bug.
Comment 14 Frédéric Wang (:fredw) 2019-07-10 08:49:03 PDT
Comment on attachment 371715 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=371715&action=review

@Timothy: I get various build failure for missing API when building with the latest XCode 11 beta 3 (FontCascadeCocoa.mm, LocalCurrentTraitCollection.mm and RenderThemeIOS.mm ). Is it something expected?

> Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h:167
> ++ (UIColor *)tableCellDefaultSelectionTintColor;

I'm not familiar with Objective C but this is causing a build failure for me with XCode 11 beta 3, that I can workaround by moving this above the NS_ASSUME_NONNULL_END statement.
Comment 15 Frédéric Wang (:fredw) 2019-07-10 08:49:44 PDT
(In reply to Frédéric Wang (:fredw) from comment #14)
> Comment on attachment 371715 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=371715&action=review
> 
> @Timothy: I get various build failure for missing API when building with the
> latest XCode 11 beta 3 (FontCascadeCocoa.mm, LocalCurrentTraitCollection.mm
> and RenderThemeIOS.mm ).

(in OS_DARK_MODE_SUPPORT sections)
Comment 16 Timothy Hatcher 2019-07-10 10:13:49 PDT
Comment on attachment 371715 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=371715&action=review

>> Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h:167
>> ++ (UIColor *)tableCellDefaultSelectionTintColor;
> 
> I'm not familiar with Objective C but this is causing a build failure for me with XCode 11 beta 3, that I can workaround by moving this above the NS_ASSUME_NONNULL_END statement.

Moving to NS_ASSUME_NONNULL_END section or adding a new section of START and END likely is the right fix. File a new bug with the build errors and we can take a look.
Comment 17 Timothy Hatcher 2019-07-10 18:55:17 PDT
(In reply to Timothy Hatcher from comment #16)
> Comment on attachment 371715 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=371715&action=review
> 
> >> Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h:167
> >> ++ (UIColor *)tableCellDefaultSelectionTintColor;
> > 
> > I'm not familiar with Objective C but this is causing a build failure for me with XCode 11 beta 3, that I can workaround by moving this above the NS_ASSUME_NONNULL_END statement.
> 
> Moving to NS_ASSUME_NONNULL_END section or adding a new section of START and
> END likely is the right fix. File a new bug with the build errors and we can
> take a look.

Bug 199481 tracks making WebKit build with the public SDK.
Comment 18 Frédéric Wang (:fredw) 2019-07-11 00:32:26 PDT
(In reply to Timothy Hatcher from comment #17)
> (In reply to Timothy Hatcher from comment #16)
> > Comment on attachment 371715 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=371715&action=review
> > 
> > >> Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h:167
> > >> ++ (UIColor *)tableCellDefaultSelectionTintColor;
> > > 
> > > I'm not familiar with Objective C but this is causing a build failure for me with XCode 11 beta 3, that I can workaround by moving this above the NS_ASSUME_NONNULL_END statement.
> > 
> > Moving to NS_ASSUME_NONNULL_END section or adding a new section of START and
> > END likely is the right fix. File a new bug with the build errors and we can
> > take a look.
> 
> Bug 199481 tracks making WebKit build with the public SDK.

Thanks!