Color keywords in override-color cause a crash
<rdar://problem/83389290>
Looks like color keywords are idents, otherwise it's a color primitive value.
static void applyValueColor(BuilderState& builderState, CSSValue& value) { auto& primitiveValue = downcast<CSSPrimitiveValue>(value); if (primitiveValue.valueID() == CSSValueCurrentcolor) { applyInheritColor(builderState); return; } if (builderState.applyPropertyToRegularStyle()) builderState.style().setColor(builderState.colorFromPrimitiveValue(primitiveValue, ForVisitedLink::No)); if (builderState.applyPropertyToVisitedLinkStyle()) builderState.style().setVisitedLinkColor(builderState.colorFromPrimitiveValue(primitiveValue, ForVisitedLink::Yes)); } - and - Color BuilderState::colorFromPrimitiveValue(const CSSPrimitiveValue& value, ForVisitedLink forVisitedLink) const { if (value.isRGBColor()) return value.color(); auto identifier = value.valueID(); switch (identifier) { case CSSValueWebkitText: return document().textColor(); case CSSValueWebkitLink: return (element() && element()->isLink() && forVisitedLink == ForVisitedLink::Yes) ? document().visitedLinkColor() : document().linkColor(); case CSSValueWebkitActivelink: return document().activeLinkColor(); case CSSValueWebkitFocusRingColor: return RenderTheme::singleton().focusRingColor(document().styleColorOptions(&m_style)); case CSSValueCurrentcolor: return RenderStyle::currentColor(); default: return StyleColor::colorFromKeyword(identifier, document().styleColorOptions(&m_style)); } }
See: https://github.com/w3c/csswg-drafts/issues/6680
Created attachment 439129 [details] WIP, as if resolution needed to be done per-element
Created attachment 439131 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Committed r283053 (242113@main): <https://commits.webkit.org/242113@main>