Chromium Code Reviews| 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..2571638f4385ef675e6a0572dbd2e6cf146be0c2 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 |
| +float 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 clampTo<float>(adjustDoubleForAbsoluteZoom(viewportWidth, *frame->document()->layoutView())); |
| } |
| -int MediaValues::calculateViewportHeight(LocalFrame* frame) const |
| +float 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 clampTo<float>(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, float viewportWidth, float viewportHeight, double& result) |
|
rune
2015/12/04 08:20:59
Why did you choose float and not double for the vi
|
| { |
| // 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 |