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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSPrimitiveValue.h

Issue 2813583002: Support calc(...) in ConsumeAngleOrPercent / for conic-gradient (Closed)
Patch Set: Fix up IsAngle Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 kUResolution, 157 kUResolution,
158 kUOther 158 kUOther
159 }; 159 };
160 static UnitCategory UnitTypeToUnitCategory(UnitType); 160 static UnitCategory UnitTypeToUnitCategory(UnitType);
161 static float ClampToCSSLengthRange(double); 161 static float ClampToCSSLengthRange(double);
162 162
163 static bool IsAngle(UnitType unit) { 163 static bool IsAngle(UnitType unit) {
164 return unit == UnitType::kDegrees || unit == UnitType::kRadians || 164 return unit == UnitType::kDegrees || unit == UnitType::kRadians ||
165 unit == UnitType::kGradians || unit == UnitType::kTurns; 165 unit == UnitType::kGradians || unit == UnitType::kTurns;
166 } 166 }
167 bool IsAngle() const { return IsAngle(GetType()); } 167 bool IsAngle() const { return IsAngle(TypeWithCalcResolved()); }
f(malita) 2017/04/10 14:16:26 All IsFoo() helpers seem to ignore calc values at
fs 2017/04/10 14:22:58 Hmm, IsLength, IsNumber and IsPercentage (the non-
168 bool IsFontRelativeLength() const { 168 bool IsFontRelativeLength() const {
169 return GetType() == UnitType::kQuirkyEms || GetType() == UnitType::kEms || 169 return GetType() == UnitType::kQuirkyEms || GetType() == UnitType::kEms ||
170 GetType() == UnitType::kExs || GetType() == UnitType::kRems || 170 GetType() == UnitType::kExs || GetType() == UnitType::kRems ||
171 GetType() == UnitType::kChs; 171 GetType() == UnitType::kChs;
172 } 172 }
173 bool IsQuirkyEms() const { return GetType() == UnitType::kQuirkyEms; } 173 bool IsQuirkyEms() const { return GetType() == UnitType::kQuirkyEms; }
174 bool IsViewportPercentageLength() const { 174 bool IsViewportPercentageLength() const {
175 return IsViewportPercentageLength(GetType()); 175 return IsViewportPercentageLength(GetType());
176 } 176 }
177 static bool IsViewportPercentageLength(UnitType type) { 177 static bool IsViewportPercentageLength(UnitType type) {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 short CSSPrimitiveValue::ComputeLength(const CSSToLengthConversionData&) const; 335 short CSSPrimitiveValue::ComputeLength(const CSSToLengthConversionData&) const;
336 336
337 template <> 337 template <>
338 float CSSPrimitiveValue::ComputeLength(const CSSToLengthConversionData&) const; 338 float CSSPrimitiveValue::ComputeLength(const CSSToLengthConversionData&) const;
339 339
340 template <> 340 template <>
341 double CSSPrimitiveValue::ComputeLength(const CSSToLengthConversionData&) const; 341 double CSSPrimitiveValue::ComputeLength(const CSSToLengthConversionData&) const;
342 } // namespace blink 342 } // namespace blink
343 343
344 #endif // CSSPrimitiveValue_h 344 #endif // CSSPrimitiveValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698