| Summary: | Color keywords in override-color cause a crash | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Myles C. Maxfield <mmaxfield> | ||||||
| Component: | Text | Assignee: | Myles C. Maxfield <mmaxfield> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | clopez, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, macpherson, menard, mmaxfield, sam, simon.fraser, webkit-bug-importer, youennf | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=230533 | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 230446 | ||||||||
| Attachments: |
|
||||||||
|
Description
Myles C. Maxfield
2021-09-22 02:05:45 PDT
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));
}
}
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> |