-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Default link colors lack sufficient contrast in the dark color scheme #17512
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
Conversation
EWS run on previous version of this PR (hash 17513cf)
|
<a class="light" href="https://www.webkit.org">Light</a> | ||
<a class="dark" href="https://www.webkit.org">Dark</a> |
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.
You can also add tests for :visited by doing <a href="">
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.
Updated – thanks!
EWS run on previous version of this PR (hash b894898)
|
EWS run on previous version of this PR (hash d37f3fc) |
|
EWS run on current version of this PR (hash bfd7c04) |
https://bugs.webkit.org/show_bug.cgi?id=209851 rdar://61149466 Reviewed by Tim Nguyen and Megan Gardner. Currently, link colors are the same in both the light and dark color schemes. This results in a lack of contrast against dark backgrounds. To fix, dark-mode specific link colors are defined. The definitions match the values used by Chromium, and are not taken from the system link color. This approach was chosen as the default link color in the light color scheme is defined by https://html.spec.whatwg.org/multipage/rendering.html#phrasing-content-3, and also does not come from the system. * LayoutTests/css-dark-mode/link-colors-expected.html: Added. * LayoutTests/css-dark-mode/link-colors.html: Added. * Source/WebCore/dom/Document.cpp: Link colors can be adjusted by HTML using the `link`, `alink`, and `vlink` attributes. Adjust logic to ensure that a static link color is only used if the corresponding attribute is specified. Without these changes, the dark mode color would never be used, as the light mode color is stored as the default. (WebCore::Document::linkColor const): (WebCore::Document::visitedLinkColor const): (WebCore::Document::activeLinkColor const): (WebCore::Document::resetLinkColor): (WebCore::Document::resetVisitedLinkColor): (WebCore::Document::resetActiveLinkColor): * Source/WebCore/dom/Document.h: (WebCore::Document::linkColor const): Deleted. (WebCore::Document::visitedLinkColor const): Deleted. (WebCore::Document::activeLinkColor const): Deleted. * Source/WebCore/rendering/RenderTheme.cpp: (WebCore::RenderTheme::systemColor const): Add definitions for colors under the dark color scheme. * Source/WebCore/style/ColorFromPrimitiveValue.cpp: (WebCore::Style::colorFromPrimitiveValue): Pass in `StyleColorOptions` when determining the link color, so that it can be resolved against the used color scheme. Canonical link: https://commits.webkit.org/267847@main
bfd7c04
to
5413aa7
Compare
Committed 267847@main (5413aa7): https://commits.webkit.org/267847@main Reviewed commits have been landed. Closing PR #17512 and removing active labels. |
5413aa7
bfd7c04