Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Unified Diff: third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp

Issue 2836613002: Better overflow handling for aspect-ratio MQ. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
index 94647ba85b2e076e080434fdd9bd1b527a890487..43be70e945d65a58eb10b0413d40f0240dd8d95b 100644
--- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
+++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
@@ -193,10 +193,10 @@ static bool CompareAspectRatioValue(const MediaQueryExpValue& value,
int width,
int height,
MediaFeaturePrefix op) {
- if (value.is_ratio)
- return CompareValue(width * static_cast<int>(value.denominator),
- height * static_cast<int>(value.numerator), op);
-
+ if (value.is_ratio) {
+ return CompareValue(static_cast<double>(width) * value.denominator,
+ static_cast<double>(height) * value.numerator, op);
+ }
return false;
}

Powered by Google App Engine
This is Rietveld 408576698