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

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

Issue 16962002: [css-device-adapt] insertRule tests and ASSERT for device lengths. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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 | « LayoutTests/css3/device-adapt/viewport-insert-rule-before-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ViewportArguments.cpp
diff --git a/Source/core/dom/ViewportArguments.cpp b/Source/core/dom/ViewportArguments.cpp
index 8593f84c5e24c65a599df23b63b1bd621cda4c43..331ac12620b1295ac063911959889ecb8c06b741 100644
--- a/Source/core/dom/ViewportArguments.cpp
+++ b/Source/core/dom/ViewportArguments.cpp
@@ -103,41 +103,16 @@ PageScaleConstraints ViewportArguments::resolve(const FloatSize& initialViewport
}
if (type == ViewportArguments::CSSDeviceAdaptation) {
- switch (int(resultMinWidth)) {
- case ViewportArguments::ValueDeviceWidth:
- resultMinWidth = deviceSize.width();
- break;
- case ViewportArguments::ValueDeviceHeight:
- resultMinWidth = deviceSize.height();
- break;
- }
-
- switch (int(resultMaxWidth)) {
- case ViewportArguments::ValueDeviceWidth:
- resultMaxWidth = deviceSize.width();
- break;
- case ViewportArguments::ValueDeviceHeight:
- resultMaxWidth = deviceSize.height();
- break;
- }
- switch (int(resultMinHeight)) {
- case ViewportArguments::ValueDeviceWidth:
- resultMinHeight = deviceSize.width();
- break;
- case ViewportArguments::ValueDeviceHeight:
- resultMinHeight = deviceSize.height();
- break;
- }
-
- switch (int(resultMaxHeight)) {
- case ViewportArguments::ValueDeviceWidth:
- resultMaxHeight = deviceSize.width();
- break;
- case ViewportArguments::ValueDeviceHeight:
- resultMaxHeight = deviceSize.height();
- break;
- }
+ // device-width/device-height not supported for @viewport.
+ ASSERT(resultMinWidth != ViewportArguments::ValueDeviceWidth);
+ ASSERT(resultMinWidth != ViewportArguments::ValueDeviceHeight);
+ ASSERT(resultMaxWidth != ViewportArguments::ValueDeviceWidth);
+ ASSERT(resultMaxWidth != ViewportArguments::ValueDeviceHeight);
+ ASSERT(resultMinHeight != ViewportArguments::ValueDeviceWidth);
+ ASSERT(resultMinHeight != ViewportArguments::ValueDeviceHeight);
+ ASSERT(resultMaxHeight != ViewportArguments::ValueDeviceWidth);
+ ASSERT(resultMaxHeight != ViewportArguments::ValueDeviceHeight);
if (resultMinWidth != ViewportArguments::ValueAuto || resultMaxWidth != ViewportArguments::ValueAuto)
resultWidth = compareIgnoringAuto(resultMinWidth, compareIgnoringAuto(resultMaxWidth, deviceSize.width(), min), max);
« no previous file with comments | « LayoutTests/css3/device-adapt/viewport-insert-rule-before-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698