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

Side by Side Diff: Source/core/platform/Length.h

Issue 19555002: Translate viewport related meta tags into @viewport descriptors as suggested by the CSS Device Adap… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) 4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com)
5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 22 matching lines...) Expand all
33 #include "wtf/Vector.h" 33 #include "wtf/Vector.h"
34 34
35 namespace WebCore { 35 namespace WebCore {
36 36
37 enum LengthType { 37 enum LengthType {
38 Auto, Relative, Percent, Fixed, 38 Auto, Relative, Percent, Fixed,
39 Intrinsic, MinIntrinsic, 39 Intrinsic, MinIntrinsic,
40 MinContent, MaxContent, FillAvailable, FitContent, 40 MinContent, MaxContent, FillAvailable, FitContent,
41 Calculated, 41 Calculated,
42 ViewportPercentageWidth, ViewportPercentageHeight, ViewportPercentageMin, Vi ewportPercentageMax, 42 ViewportPercentageWidth, ViewportPercentageHeight, ViewportPercentageMin, Vi ewportPercentageMax,
43 ExtendToZoom,
43 Undefined 44 Undefined
44 }; 45 };
45 46
46 class CalculationValue; 47 class CalculationValue;
47 48
48 struct Length { 49 struct Length {
49 WTF_MAKE_FAST_ALLOCATED; 50 WTF_MAKE_FAST_ALLOCATED;
50 public: 51 public:
51 Length() 52 Length()
52 : m_intValue(0), m_quirk(false), m_type(Auto), m_isFloat(false) 53 : m_intValue(0), m_quirk(false), m_type(Auto), m_isFloat(false)
53 { 54 {
54 } 55 }
55 56
56 Length(LengthType t) 57 Length(LengthType t)
57 : m_intValue(0), m_quirk(false), m_type(t), m_isFloat(false) 58 : m_intValue(0), m_quirk(false), m_type(t), m_isFloat(false)
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 bool isLegacyIntrinsic() const { return type() == Intrinsic || type() == Min Intrinsic; } 225 bool isLegacyIntrinsic() const { return type() == Intrinsic || type() == Min Intrinsic; }
225 bool isIntrinsic() const { return type() == MinContent || type() == MaxConte nt || type() == FillAvailable || type() == FitContent; } 226 bool isIntrinsic() const { return type() == MinContent || type() == MaxConte nt || type() == FillAvailable || type() == FitContent; }
226 bool isSpecified() const { return type() == Fixed || type() == Percent || ty pe() == Calculated || isViewportPercentage(); } 227 bool isSpecified() const { return type() == Fixed || type() == Percent || ty pe() == Calculated || isViewportPercentage(); }
227 bool isSpecifiedOrIntrinsic() const { return isSpecified() || isIntrinsic(); } 228 bool isSpecifiedOrIntrinsic() const { return isSpecified() || isIntrinsic(); }
228 bool isCalculated() const { return type() == Calculated; } 229 bool isCalculated() const { return type() == Calculated; }
229 bool isCalculatedEqual(const Length&) const; 230 bool isCalculatedEqual(const Length&) const;
230 bool isMinContent() const { return type() == MinContent; } 231 bool isMinContent() const { return type() == MinContent; }
231 bool isMaxContent() const { return type() == MaxContent; } 232 bool isMaxContent() const { return type() == MaxContent; }
232 bool isFillAvailable() const { return type() == FillAvailable; } 233 bool isFillAvailable() const { return type() == FillAvailable; }
233 bool isFitContent() const { return type() == FitContent; } 234 bool isFitContent() const { return type() == FitContent; }
235 bool isExtendToZoom() const { return type() == ExtendToZoom; }
234 236
235 Length blend(const Length& from, double progress) const 237 Length blend(const Length& from, double progress) const
236 { 238 {
237 // Blend two lengths to produce a new length that is in between them. U sed for animation. 239 // Blend two lengths to produce a new length that is in between them. U sed for animation.
238 if (from.type() == Calculated || type() == Calculated) 240 if (from.type() == Calculated || type() == Calculated)
239 return blendMixedTypes(from, progress); 241 return blendMixedTypes(from, progress);
240 242
241 if (!from.isZero() && !isZero() && from.type() != type()) 243 if (!from.isZero() && !isZero() && from.type() != type())
242 return blendMixedTypes(from, progress); 244 return blendMixedTypes(from, progress);
243 245
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 bool m_quirk; 309 bool m_quirk;
308 unsigned char m_type; 310 unsigned char m_type;
309 bool m_isFloat; 311 bool m_isFloat;
310 }; 312 };
311 313
312 Vector<Length> parseHTMLAreaElementCoords(const String&); 314 Vector<Length> parseHTMLAreaElementCoords(const String&);
313 315
314 } // namespace WebCore 316 } // namespace WebCore
315 317
316 #endif // Length_h 318 #endif // Length_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698