This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse the repository at this point in the history
System colors do not always respect inherited color-scheme values
https://bugs.webkit.org/show_bug.cgi?id=240925 rdar://94247591 Reviewed by Antti Koivisto. The MatchedDeclarationsCache speeds up style computation by reusing by copying non-inherited properties from an earlier style object built using the same exact style declarations. Since 'color-scheme' is an inherited property, it is possible for two elements to have the same 'background-color' declaration, with different color schemes. However, the computed value of a system color is dependent on the computed style's 'color-scheme' value. Consequently, the cache entry can only be used if the styles have equivalent color schemes. * LayoutTests/css-dark-mode/color-scheme-inherited-expected.html: Added. * LayoutTests/css-dark-mode/color-scheme-inherited.html: Added. * Source/WebCore/style/MatchedDeclarationsCache.cpp: (WebCore::Style::MatchedDeclarationsCache::Entry::isUsableAfterHighPriorityProperties const): Canonical link: https://commits.webkit.org/253041@main
- Loading branch information
Showing 3 changed files with 48 additions and 0 deletions.