[Webkit-unassigned] [Bug 230605] Color keywords in override-color cause a crash
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Sep 23 21:19:45 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=230605
--- Comment #3 from Myles C. Maxfield <mmaxfield at apple.com> ---
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));
}
}
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210924/c622f898/attachment.htm>
More information about the webkit-unassigned
mailing list