예제 #1
0
static bool hoverMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
    HoverType hover = mediaValues.primaryHoverType();

    if (RuntimeEnabledFeatures::hoverMediaQueryKeywordsEnabled()) {
        if (!value.isValid())
            return hover != HoverTypeNone;

        if (!value.isID)
            return false;

        return (hover == HoverTypeNone && value.id == CSSValueNone)
            || (hover == HoverTypeOnDemand && value.id == CSSValueOnDemand)
            || (hover == HoverTypeHover && value.id == CSSValueHover);
    } else {
        float number = 1;
        if (value.isValid()) {
            if (!numberValue(value, number))
                return false;
        }

        return (hover == HoverTypeNone && !number)
            || (hover == HoverTypeOnDemand && !number)
            || (hover == HoverTypeHover && number == 1);
    }
}
static bool hoverMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
    HoverType hover = mediaValues.primaryHoverType();

    if (!value.isValid())
        return hover != HoverTypeNone;

    if (!value.isID)
        return false;

    return (hover == HoverTypeNone && value.id == CSSValueNone)
        || (hover == HoverTypeOnDemand && value.id == CSSValueOnDemand)
        || (hover == HoverTypeHover && value.id == CSSValueHover);
}