static bool pointerMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues) { MediaValues::PointerDeviceType pointer = mediaValues.pointer(); // If we're on a port that hasn't explicitly opted into providing pointer device information // (or otherwise can't be confident in the pointer hardware available), then behave exactly // as if this feature feature isn't supported. if (pointer == MediaValues::UnknownPointer) return false; if (!value.isValid()) return pointer != MediaValues::NoPointer; if (!value.isID) return false; return (pointer == MediaValues::NoPointer && value.id == CSSValueNone) || (pointer == MediaValues::TouchPointer && value.id == CSSValueCoarse) || (pointer == MediaValues::MousePointer && value.id == CSSValueFine); }
static bool hoverMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues) { MediaValues::PointerDeviceType pointer = mediaValues.pointer(); // If we're on a port that hasn't explicitly opted into providing pointer device information // (or otherwise can't be confident in the pointer hardware available), then behave exactly // as if this feature feature isn't supported. if (pointer == MediaValues::UnknownPointer) return false; float number = 1; if (value.isValid()) { if (!numberValue(value, number)) return false; } return (pointer == MediaValues::NoPointer && !number) || (pointer == MediaValues::TouchPointer && !number) || (pointer == MediaValues::MousePointer && number == 1); }