Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 59da037a4b6636a933a1cf6041f2de4c4b6dd163
      
https://github.com/WebKit/WebKit/commit/59da037a4b6636a933a1cf6041f2de4c4b6dd163
  Author: Elika Etemad <[email protected]>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    A LayoutTests/fast/css/internal-current-background-color-expected.txt
    A LayoutTests/fast/css/internal-current-background-color.html
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/CSSValueKeywords.in
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Color.cpp
    M Source/WebCore/css/values/color/CSSKeywordColor.cpp
    M Source/WebCore/style/MatchedDeclarationsCache.cpp
    M Source/WebCore/style/StyleAdjuster.cpp
    M Source/WebCore/style/StyleDifference.cpp
    M Source/WebCore/style/computed/StyleComputedStyleBase+ConstructionInlines.h
    M Source/WebCore/style/computed/StyleComputedStyleBase+GettersInlines.h
   
M Source/WebCore/style/computed/StyleComputedStyleBase+SettersInlines.h
    M Source/WebCore/style/computed/StyleComputedStyleBase.cpp
    M Source/WebCore/style/computed/StyleComputedStyleBase.h
    M Source/WebCore/style/computed/data/StyleInheritedData.cpp
    M Source/WebCore/style/computed/data/StyleInheritedData.h
    M Source/WebCore/style/computed/data/StyleInheritedRareData.cpp
    M Source/WebCore/style/computed/data/StyleInheritedRareData.h
    M Source/WebCore/style/values/color/StyleColor.cpp

  Log Message:
  -----------
  Add ability to use background-color as a <color>
https://bugs.webkit.org/show_bug.cgi?id=321741
rdar://184868456

Reviewed by Antti Koivisto.

Adds an -internal-current-background-color keyword which walks up the ancestor
chain and computes to the nearest non-transparent background-color, skipping
'display: contents' boxes. On color, accent-color, and background-color it
checks the parent first; on all other properties, it checks
the element's own
background-color first.

See https://github.com/w3c/csswg-drafts/issues/5292 for discussion.

This is implemented by adding a currentBackgroundColor tracking value to
StyleInheritedData. To make room for this, we're moving border-spacing to
StyleInheritedRareData. Modern websites do not use tables for layout, so
this is no longer likely to be a commonly set property, except within actual
tables.

Test: fast/css/internal-current-background-color.html

* LayoutTests/fast/css/internal-current-background-color-expected.txt: Added.
* LayoutTests/fast/css/internal-current-background-color.html: Added.
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/CSSValueKeywords.in:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Color.cpp:
(WebCore::CSSPropertyParserHelpers::consumeColor):
* Source/WebCore/css/values/color/CSSKeywordColor.cpp:
(WebCore::CSS::createColor):
*
Source/WebCore/style/MatchedDeclarationsCache.cpp:
(WebCore::Style::MatchedDeclarationsCache::isCacheable):
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
* Source/WebCore/style/StyleDifference.cpp:
* Source/WebCore/style/computed/StyleComputedStyleBase+ConstructionInlines.h:
(WebCore::Style::ComputedStyleBase::ComputedStyleBase):
(WebCore::Style::ComputedStyleBase::NonInheritedFlags::copyNonInheritedFrom):
* Source/WebCore/style/computed/StyleComputedStyleBase+GettersInlines.h:
(WebCore::Style::ComputedStyleBase::usesCurrentBackgroundColorKeyword const):
(WebCore::Style::ComputedStyleBase::currentBackgroundColor const):
* Source/WebCore/style/computed/StyleComputedStyleBase+SettersInlines.h:
(WebCore::Style::ComputedStyleBase::setUsesCurrentBackgroundColorKeyword):
(WebCore::Style::ComputedStyleBase::setCurrentBackgroundColor):
*
Source/WebCore/style/computed/StyleComputedStyleBase.cpp:
(WebCore::Style::ComputedStyleBase::NonInheritedFlags::dumpDifferences const):
* Source/WebCore/style/computed/StyleComputedStyleBase.h:
* Source/WebCore/style/computed/data/StyleInheritedData.cpp:
(WebCore::Style::InheritedData::InheritedData):
(WebCore::Style::InheritedData::fastPathInheritedEqual const):
(WebCore::Style::InheritedData::nonFastPathInheritedEqual const):
(WebCore::Style::InheritedData::fastPathInheritFrom):
(WebCore::Style::InheritedData::dumpDifferences const):
* Source/WebCore/style/computed/data/StyleInheritedData.h:
* Source/WebCore/style/computed/data/StyleInheritedRareData.cpp:
(WebCore::Style::InheritedRareData::InheritedRareData):
(WebCore::Style::InheritedRareData::operator== const):
(WebCore::Style::InheritedRareData::dumpDifferences const):
* Source/WebCore/style/computed/data/StyleInheritedRareData.h:
*
Source/WebCore/style/values/color/StyleColor.cpp:
(WebCore::Style::resolveInternalCurrentBackgroundColor):
(WebCore::Style::CSSValueConversion<Color>::operator):

Canonical link: 
https://flagged.apple.com:443/proxy?t2=dA0W3j8Ta7&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzIwOTM0QG1haW4=&emid=09821d42-2cf0-4f6a-966f-fd338fabea8c&c=11



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to