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

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

Issue 23742003: Use css-device-adapt constraining for legacy viewport tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review issue: one assignent per line/statement Created 7 years, 3 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/Document.cpp ('k') | Source/core/dom/ViewportArguments.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ViewportArguments.h
diff --git a/Source/core/dom/ViewportArguments.h b/Source/core/dom/ViewportArguments.h
index 9eaf555e5f11781fda7cdec86be75e18f6bb4642..2b02b718905f82edc4dbb15f83860e23e8c5c975 100644
--- a/Source/core/dom/ViewportArguments.h
+++ b/Source/core/dom/ViewportArguments.h
@@ -50,13 +50,11 @@ struct ViewportArguments {
enum Type {
// These are ordered in increasing importance.
- Implicit,
- XHTMLMobileProfile,
+ UserAgentStyleSheet,
HandheldFriendlyMeta,
MobileOptimizedMeta,
ViewportMeta,
- ViewportMetaLayoutSizeQuirk,
- CSSDeviceAdaptation
+ AuthorStyleSheet
} type;
enum {
@@ -72,10 +70,8 @@ struct ViewportArguments {
ValueExtendToZoom = -10
};
- ViewportArguments(Type type = Implicit)
+ ViewportArguments(Type type = UserAgentStyleSheet)
: type(type)
- , width(ValueAuto)
- , height(ValueAuto)
, zoom(ValueAuto)
, minZoom(ValueAuto)
, maxZoom(ValueAuto)
@@ -86,12 +82,10 @@ struct ViewportArguments {
}
// All arguments are in CSS units.
- PageScaleConstraints resolve(const FloatSize& initialViewportSize, int defaultWidth) const;
+ PageScaleConstraints resolve(const FloatSize& initialViewportSize) const;
- float width;
Length minWidth;
Length maxWidth;
- float height;
Length minHeight;
Length maxHeight;
float zoom;
@@ -105,10 +99,8 @@ struct ViewportArguments {
{
// Used for figuring out whether to reset the viewport or not,
// thus we are not taking type into account.
- return width == other.width
- && minWidth == other.minWidth
+ return minWidth == other.minWidth
&& maxWidth == other.maxWidth
- && height == other.height
&& minHeight == other.minHeight
&& maxHeight == other.maxHeight
&& zoom == other.zoom
@@ -124,6 +116,8 @@ struct ViewportArguments {
return !(*this == other);
}
+ bool isLegacyViewportType() const { return type >= HandheldFriendlyMeta && type <= ViewportMeta; }
+
private:
enum Direction { Horizontal, Vertical };
static float resolveViewportLength(const Length&, const FloatSize& initialViewportSize, Direction);
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/ViewportArguments.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698