static bool deviceAspectRatioMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues) { if (value.isValid()) return compareAspectRatioValue(value, mediaValues.deviceWidth(), mediaValues.deviceHeight(), op); // ({,min-,max-}device-aspect-ratio) // assume if we have a device, its aspect ratio is non-zero. return true; }
static bool deviceWidthMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues) { if (value.isValid()) return computeLengthAndCompare(value, op, mediaValues, mediaValues.deviceWidth()); // ({,min-,max-}device-width) // assume if we have a device, assume non-zero return true; }
static bool deviceWidthMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues) { if (value.isValid()) { int length; return computeLength(value, mediaValues, length) && compareValue(static_cast<int>(mediaValues.deviceWidth()), length, op); } // ({,min-,max-}device-width) // assume if we have a device, assume non-zero return true; }