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

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

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.h
diff --git a/third_party/WebKit/Source/core/css/MediaValues.h b/third_party/WebKit/Source/core/css/MediaValues.h
index d32c0022bfeea28f425336ae63e50a6151a4bd88..7ce4fdf5d92412070bbf237bbec59e2d9441e889 100644
--- a/third_party/WebKit/Source/core/css/MediaValues.h
+++ b/third_party/WebKit/Source/core/css/MediaValues.h
@@ -28,9 +28,9 @@ public:
virtual PassRefPtrWillBeRawPtr<MediaValues> copy() const = 0;
virtual bool isSafeToSendToAnotherThread() const = 0;
- static bool computeLengthImpl(double value, CSSPrimitiveValue::UnitType, unsigned defaultFontSize, unsigned viewportWidth, unsigned viewportHeight, double& result);
+ static bool computeLengthImpl(double value, CSSPrimitiveValue::UnitType, unsigned defaultFontSize, double viewportWidth, double viewportHeight, double& result);
template<typename T>
- static bool computeLength(double value, CSSPrimitiveValue::UnitType type, unsigned defaultFontSize, unsigned viewportWidth, unsigned viewportHeight, T& result)
+ static bool computeLength(double value, CSSPrimitiveValue::UnitType type, unsigned defaultFontSize, double viewportWidth, double viewportHeight, T& result)
{
double tempResult;
if (!computeLengthImpl(value, type, defaultFontSize, viewportWidth, viewportHeight, tempResult))
@@ -41,8 +41,8 @@ public:
virtual bool computeLength(double value, CSSPrimitiveValue::UnitType, int& result) const = 0;
virtual bool computeLength(double value, CSSPrimitiveValue::UnitType, double& result) const = 0;
- virtual int viewportWidth() const = 0;
- virtual int viewportHeight() const = 0;
+ virtual double viewportWidth() const = 0;
+ virtual double viewportHeight() const = 0;
virtual int deviceWidth() const = 0;
virtual int deviceHeight() const = 0;
virtual float devicePixelRatio() const = 0;
@@ -62,8 +62,8 @@ public:
virtual bool isCached() const { return false; }
protected:
- int calculateViewportWidth(LocalFrame*) const;
- int calculateViewportHeight(LocalFrame*) const;
+ double calculateViewportWidth(LocalFrame*) const;
+ double calculateViewportHeight(LocalFrame*) const;
int calculateDeviceWidth(LocalFrame*) const;
int calculateDeviceHeight(LocalFrame*) const;
bool calculateStrictMode(LocalFrame*) const;
« no previous file with comments | « third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp ('k') | third_party/WebKit/Source/core/css/MediaValues.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698