-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for painting document markers using system colors #10601
Conversation
EWS run on previous version of this PR (hash 4f0ade9) |
Thanks for the review! |
#endif // USE(APPLE_INTERNAL_SDK) | ||
|
||
#if HAVE(NSSPELLCHECKER_CORRECTION_INDICATOR_UNDERLINE_COLOR) | ||
@interface NSSpellChecker (Staging_105286196) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you haven't, can you file a bug for removing this staging code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed a bug and added a comment.
Color RenderThemeCocoa::platformDictationAlternativesMarkerColor(OptionSet<StyleColorOptions> options) const | ||
{ | ||
auto useDarkMode = options.contains(StyleColorOptions::UseDarkAppearance); | ||
return useDarkMode ? SRGBA<uint8_t> { 40, 145, 255, 217 } : SRGBA<uint8_t> { 0, 122, 255, 191 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we can factor out all the same special numbers so that it's more clear that they're all the same thing? I'm also assuming there's no way to get these from the system or elsewhere and they need to be manually defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was doing some digging and it appears that there are system colors that we can use for these!
Though I will need to audit them individually to compare behavior. Since this hardcoding is not new I have filed https://bugs.webkit.org/show_bug.cgi?id=252868 to address this separately.
For now, I have updated the PR to unify the dictation alternative paths, and share the same color method, reducing the amount of duplication.
EWS run on current version of this PR (hash 1173f0e) |
https://bugs.webkit.org/show_bug.cgi?id=252791 rdar://105796291 Reviewed by Wenson Hsieh and Megan Gardner. Use system colors for painting document markers when possible. To support this functionality, new `RenderTheme` methods are added to control platform-specific marker colors and the color cache is expanded for the new colors. This approach matches the implementation of existing system colors. * Source/WebCore/PAL/pal/spi/mac/NSSpellCheckerSPI.h: * Source/WebCore/rendering/RenderTheme.cpp: (WebCore::RenderTheme::spellingMarkerColor const): (WebCore::RenderTheme::platformSpellingMarkerColor const): (WebCore::RenderTheme::dictationAlternativesMarkerColor const): (WebCore::RenderTheme::platformDictationAlternativesMarkerColor const): (WebCore::RenderTheme::autocorrectionReplacementMarkerColor const): (WebCore::RenderTheme::platformAutocorrectionReplacementMarkerColor const): (WebCore::RenderTheme::grammarMarkerColor const): (WebCore::RenderTheme::platformGrammarMarkerColor const): (WebCore::RenderTheme::documentMarkerLineColor const): * Source/WebCore/rendering/RenderTheme.h: * Source/WebCore/rendering/RenderThemeCocoa.h: * Source/WebCore/rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::platformSpellingMarkerColor const): (WebCore::RenderThemeCocoa::platformDictationAlternativesMarkerColor const): (WebCore::RenderThemeCocoa::platformAutocorrectionReplacementMarkerColor const): (WebCore::RenderThemeCocoa::platformGrammarMarkerColor const): (WebCore::grammarColor): Deleted. (WebCore::RenderThemeCocoa::documentMarkerLineColor const): Deleted. * Source/WebCore/rendering/RenderThemeMac.h: * Source/WebCore/rendering/RenderThemeMac.mm: (WebCore::usePlatformColorForAutocorrectionReplacementMarker): (WebCore::RenderThemeMac::platformAutocorrectionReplacementMarkerColor const): Canonical link: https://commits.webkit.org/260779@main
1173f0e
to
68ae85e
Compare
Committed 260779@main (68ae85e): https://commits.webkit.org/260779@main Reviewed commits have been landed. Closing PR #10601 and removing active labels. |
68ae85e
1173f0e
π macπ wpeπ wincairoπ mac-AS-debugπ§ͺ ios-wk2π§ͺ api-macπ§ͺ gtk-wk2π§ͺ api-iosπ§ͺ mac-wk1π§ͺ api-gtkπ§ͺ mac-wk2π tv-simπ§ͺ mac-AS-debug-wk2π watchπ§ͺ mac-wk2-stress