Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5d42114d58682590ac6fb8e28dccc82c71538035
      
https://github.com/WebKit/WebKit/commit/5d42114d58682590ac6fb8e28dccc82c71538035
  Author: Aditya Keerthi <akeer...@apple.com>
  Date:   2024-04-10 (Wed, 10 Apr 2024)

  Changed paths:
    M Source/WebCore/rendering/RenderTheme.cpp
    M Source/WebCore/rendering/mac/RenderThemeMac.mm

  Log Message:
  -----------
  REGRESSION (277259@main): ASSERT(!forVisitedLink) in 
RenderThemeIOS::systemColor
https://bugs.webkit.org/show_bug.cgi?id=272441
rdar://126190394

Reviewed by Ryosuke Niwa and Tim Nguyen.

`-webkit-link` is a special value that resolves differently depending on whether
it is used with `:visited`. Due to this, there are assertions that ensure its
actual value is not inserted into caches that do not know about `:visited`
styles. These assertions work by checking `StyleColorOptions`.

277259@main made `-webkit-link` dependent on `VisitedText`. This means that
`VisitedText` was now also being passed along with the visited option.
277259@main relaxed the assertion in `RenderThemeMac` to allow for this, but
did not do so in `RenderThemeIOS`.

However, it does not make sense to pass the visited option along at all, given
`VisitedText` is independent of `:visited`. Additionally, the approach in
277259@main is slightly flawed, as it made `-webkit-link` dependent on other
system colors. This is incorrect, as in the future, it may be desirable to make
`LinkText` and `VisitedText` vary per-platform (as is allowed by the spec).
However, the value of `-webkit-link` (at least in light mode) is specified in
the HTML standard, and should never vary per-platform.

Fix by making `-webkit-link` independent of other system colors by introducing
static helpers. Additionally, revert the relaxed assertion.

* Source/WebCore/rendering/RenderTheme.cpp:
(WebCore::defaultLinkColor):
(WebCore::defaultVisitedLinkColor):
(WebCore::RenderTheme::systemColor const):
* Source/WebCore/rendering/mac/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):

Canonical link: https://commits.webkit.org/277303@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to