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

Unified Diff: Source/core/dom/ViewportDescription.cpp

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rename browser zoom to page zoom Created 6 years, 12 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
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ViewportDescription.cpp
diff --git a/Source/core/dom/ViewportDescription.cpp b/Source/core/dom/ViewportDescription.cpp
index 77f924e623ba812de4200e337901fd69f67722f3..7f63c6a663e4036492510384d15e084c4e089f88 100644
--- a/Source/core/dom/ViewportDescription.cpp
+++ b/Source/core/dom/ViewportDescription.cpp
@@ -54,17 +54,17 @@ float ViewportDescription::resolveViewportLength(const Length& length, const Flo
if (length.type() == ExtendToZoom)
return ViewportDescription::ValueExtendToZoom;
- if ((length.type() == Percent && direction == Horizontal) || length.type() == ViewportPercentageWidth)
+ if (length.type() == Percent && direction == Horizontal)
return initialViewportSize.width() * length.getFloatValue() / 100.0f;
- if ((length.type() == Percent && direction == Vertical) || length.type() == ViewportPercentageHeight)
+ if (length.type() == Percent && direction == Vertical)
return initialViewportSize.height() * length.getFloatValue() / 100.0f;
- if (length.type() == ViewportPercentageMin)
- return min(initialViewportSize.width(), initialViewportSize.height()) * length.viewportPercentageLength() / 100.0f;
+ if (length.type() == DeviceWidth)
+ return initialViewportSize.width();
- if (length.type() == ViewportPercentageMax)
- return max(initialViewportSize.width(), initialViewportSize.height()) * length.viewportPercentageLength() / 100.0f;
+ if (length.type() == DeviceHeight)
+ return initialViewportSize.height();
ASSERT_NOT_REACHED();
return ViewportDescription::ValueAuto;
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698