Skip to content

Commit

Permalink
Fix unused function warnings when ENABLE(CSS_CONIC_GRADIENTS) is OFF
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=247455

Reviewed by Tim Nguyen.

Guard `consumeAngleOrPercent` and `consumeAngularColorStopList` with
`ENABLE(CSS_CONIC_GRADIENTS)`.

* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:

Canonical link: https://commits.webkit.org/256302@main
  • Loading branch information
donny-dont committed Nov 4, 2022
1 parent d2d79fd commit 8c9874a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
Expand Up @@ -1417,10 +1417,12 @@ RefPtr<CSSPrimitiveValue> consumeResolution(CSSParserTokenRange& range)
return consumeMetaConsumer<ResolutionConsumer>(range, { }, ValueRange::All, CSSParserMode::HTMLStandardMode, UnitlessQuirk::Forbid, UnitlessZeroQuirk::Forbid, CSSValuePool::singleton());
}

#if ENABLE(CSS_CONIC_GRADIENTS)
static RefPtr<CSSPrimitiveValue> consumeAngleOrPercent(CSSParserTokenRange& range, CSSParserMode parserMode)
{
return consumeMetaConsumer<AngleOrPercentConsumer>(range, { }, ValueRange::All, parserMode, UnitlessQuirk::Forbid, UnitlessZeroQuirk::Allow, CSSValuePool::singleton());
}
#endif

static std::optional<LengthOrPercentRaw> consumeLengthOrPercentRaw(CSSParserTokenRange& range, CSSParserMode parserMode)
{
Expand Down Expand Up @@ -3618,10 +3620,12 @@ static std::optional<CSSGradientColorStopList> consumeLengthColorStopList(CSSPar
return consumeColorStopList(range, context, supportsColorHints, [&] { return consumeLengthOrPercent(range, context.mode, ValueRange::All); });
}

#if ENABLE(CSS_CONIC_GRADIENTS)
static std::optional<CSSGradientColorStopList> consumeAngularColorStopList(CSSParserTokenRange& range, const CSSParserContext& context, SupportsColorHints supportsColorHints)
{
return consumeColorStopList(range, context, supportsColorHints, [&] { return consumeAngleOrPercent(range, context.mode); });
}
#endif

static RefPtr<CSSValue> consumePrefixedRadialGradient(CSSParserTokenRange& range, const CSSParserContext& context, CSSGradientRepeat repeating)
{
Expand Down

0 comments on commit 8c9874a

Please sign in to comment.