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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGLength.h

Issue 1544543003: Adding support of viewport units to SVG (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Align with review comments Created 4 years, 11 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 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 void newValueSpecifiedUnits(CSSPrimitiveValue::UnitType, float valueInSpecif iedUnits); 80 void newValueSpecifiedUnits(CSSPrimitiveValue::UnitType, float valueInSpecif iedUnits);
81 void convertToSpecifiedUnits(CSSPrimitiveValue::UnitType, const SVGLengthCon text&); 81 void convertToSpecifiedUnits(CSSPrimitiveValue::UnitType, const SVGLengthCon text&);
82 82
83 // Helper functions 83 // Helper functions
84 static inline bool isRelativeUnit(CSSPrimitiveValue::UnitType unitType) 84 static inline bool isRelativeUnit(CSSPrimitiveValue::UnitType unitType)
85 { 85 {
86 return unitType == CSSPrimitiveValue::UnitType::Percentage 86 return unitType == CSSPrimitiveValue::UnitType::Percentage
87 || unitType == CSSPrimitiveValue::UnitType::Ems 87 || unitType == CSSPrimitiveValue::UnitType::Ems
88 || unitType == CSSPrimitiveValue::UnitType::Exs 88 || unitType == CSSPrimitiveValue::UnitType::Exs
89 || unitType == CSSPrimitiveValue::UnitType::Rems 89 || unitType == CSSPrimitiveValue::UnitType::Rems
90 || unitType == CSSPrimitiveValue::UnitType::Chs; 90 || unitType == CSSPrimitiveValue::UnitType::Chs
91 || (unitType >= CSSPrimitiveValue::UnitType::ViewportWidth && unitTy pe <= CSSPrimitiveValue::UnitType::ViewportMax);
91 } 92 }
92 inline bool isRelative() const { return isRelativeUnit(m_value->typeWithCalc Resolved()); } 93 inline bool isRelative() const { return isRelativeUnit(m_value->typeWithCalc Resolved()); }
93 94
94 bool isZero() const 95 bool isZero() const
95 { 96 {
96 return m_value->getFloatValue() == 0; 97 return m_value->getFloatValue() == 0;
97 } 98 }
98 99
99 static SVGLengthMode lengthModeForAnimatedLengthAttribute(const QualifiedNam e&); 100 static SVGLengthMode lengthModeForAnimatedLengthAttribute(const QualifiedNam e&);
100 static bool negativeValuesForbiddenForAnimatedLengthAttribute(const Qualifie dName&); 101 static bool negativeValuesForbiddenForAnimatedLengthAttribute(const Qualifie dName&);
(...skipping 10 matching lines...) Expand all
111 112
112 RefPtrWillBeMember<CSSPrimitiveValue> m_value; 113 RefPtrWillBeMember<CSSPrimitiveValue> m_value;
113 unsigned m_unitMode : 2; 114 unsigned m_unitMode : 2;
114 }; 115 };
115 116
116 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength); 117 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength);
117 118
118 } // namespace blink 119 } // namespace blink
119 120
120 #endif // SVGLength_h 121 #endif // SVGLength_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | third_party/WebKit/Source/core/svg/SVGLength.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698