Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a26b16470591823b5c79246d9264e3a89aa9fca9
https://github.com/WebKit/WebKit/commit/a26b16470591823b5c79246d9264e3a89aa9fca9
Author: Joanne Pan <[email protected]>
Date: 2026-07-13 (Mon, 13 Jul 2026)
Changed paths:
M Source/WebCore/style/StyleSubstitutionResolver.cpp
M Source/WebCore/style/StyleSubstitutionResolver.h
Log Message:
-----------
[css-values-5 random-item()] Factor random-item() argument-grammar
substitution into a helper following the attr() pattern
https://bugs.webkit.org/show_bug.cgi?id=319276
rdar://182117859
Reviewed by Tim Nguyen.
Follow-up to bug 317702 (random-item() computed-value resolution), addressing
Antti's review feedback on PR #68097:
https://github.com/WebKit/WebKit/pull/68097#discussion_r3551786137
This patch extracts substituteRandomItemArgumentGrammar(), mirroring
substituteAttrArgumentGrammar():
- It splits <random-item-args> = random-item( <declaration-value>,
[ <declaration-value>? ]# ) at the literal commas, substitutes the first
argument (the <random-key>), and returns the substituted key plus the raw
item ranges.
- substituteRandomItemFunction() then resolves the base value and
selects/substitutes the chosen item as a distinct second step. As with
attr()'s fallback, the items are substituted lazily.
* Source/WebCore/style/StyleSubstitutionResolver.cpp:
(WebCore::Style::SubstitutionResolver::substituteRandomItemArgumentGrammar):
(WebCore::Style::SubstitutionResolver::substituteRandomItemFunction):
* Source/WebCore/style/StyleSubstitutionResolver.h:
Canonical link: https://commits.webkit.org/317104@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications