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

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

Issue 1496683002: Avoid rounding down viewport dimensions in Media Queries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved to double Created 5 years 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/MediaValues.cpp
diff --git a/third_party/WebKit/Source/core/css/MediaValues.cpp b/third_party/WebKit/Source/core/css/MediaValues.cpp
index 294df98397efd6f9b0d41719738fdfc098939d3f..a36c3411f437d9fad10565373f4f4c92ddb11919 100644
--- a/third_party/WebKit/Source/core/css/MediaValues.cpp
+++ b/third_party/WebKit/Source/core/css/MediaValues.cpp
@@ -32,18 +32,18 @@ PassRefPtrWillBeRawPtr<MediaValues> MediaValues::createDynamicIfFrameExists(Loca
return MediaValuesCached::create();
}
-int MediaValues::calculateViewportWidth(LocalFrame* frame) const
+double MediaValues::calculateViewportWidth(LocalFrame* frame) const
{
ASSERT(frame && frame->view() && frame->document());
int viewportWidth = frame->view()->layoutSize(IncludeScrollbars).width();
- return adjustForAbsoluteZoom(viewportWidth, frame->document()->layoutView());
+ return adjustDoubleForAbsoluteZoom(viewportWidth, *frame->document()->layoutView());
}
-int MediaValues::calculateViewportHeight(LocalFrame* frame) const
+double MediaValues::calculateViewportHeight(LocalFrame* frame) const
{
ASSERT(frame && frame->view() && frame->document());
int viewportHeight = frame->view()->layoutSize(IncludeScrollbars).height();
- return adjustForAbsoluteZoom(viewportHeight, frame->document()->layoutView());
+ return adjustDoubleForAbsoluteZoom(viewportHeight, *frame->document()->layoutView());
}
int MediaValues::calculateDeviceWidth(LocalFrame* frame) const
@@ -153,7 +153,7 @@ int MediaValues::calculateAvailableHoverTypes(LocalFrame* frame) const
return frame->settings()->availableHoverTypes();
}
-bool MediaValues::computeLengthImpl(double value, CSSPrimitiveValue::UnitType type, unsigned defaultFontSize, unsigned viewportWidth, unsigned viewportHeight, double& result)
+bool MediaValues::computeLengthImpl(double value, CSSPrimitiveValue::UnitType type, unsigned defaultFontSize, double viewportWidth, double viewportHeight, double& result)
{
// The logic in this function is duplicated from CSSToLengthConversionData::zoomedComputedPixels()
// because MediaValues::computeLength() needs nearly identical logic, but we haven't found a way to make
« no previous file with comments | « third_party/WebKit/Source/core/css/MediaValues.h ('k') | third_party/WebKit/Source/core/css/MediaValuesCached.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698