[Webkit-unassigned] [Bug 247326] Add helper function to match identifiers and return a corresponding enum mapped enum value for CSS property parser

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 1 20:41:41 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=247326

--- Comment #3 from Sam Weinig <sam at webkit.org> ---
Yet another alternative would be to use the template arguments themselves (I haven't written out this version yet, but it would be a recursive walk through the argument pairs). The caller might look like this:

```
static std::optional<HueInterpolationMethod> consumeHueInterpolationMethod(CSSParserTokenRange& range)
{
    return consumeIdentifierMappingTo<HueInterpolationMethod,
        CSSValueShorter, HueInterpolationMethod::Shorter,
        CSSValueLonger, HueInterpolationMethod::Longer,
        CSSValueIncreasing, HueInterpolationMethod::Increasing,
        CSSValueDecreasing, HueInterpolationMethod::Decreasing,
        CSSValueSpecified, HueInterpolationMethod::Specified,
    >(range);
}
```

-- 
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/20221102/4126ad78/attachment.htm>


More information about the webkit-unassigned mailing list