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

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

Issue 2232093002: Removed parent data storage common to multiple CSSValues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unsigned from enum class Created 4 years, 4 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 private: 270 private:
271 CSSPrimitiveValue(CSSValueID); 271 CSSPrimitiveValue(CSSValueID);
272 CSSPrimitiveValue(const Length&, float zoom); 272 CSSPrimitiveValue(const Length&, float zoom);
273 CSSPrimitiveValue(double, UnitType); 273 CSSPrimitiveValue(double, UnitType);
274 274
275 template<typename T> CSSPrimitiveValue(T); // Defined in CSSPrimitiveValueMa ppings.h 275 template<typename T> CSSPrimitiveValue(T); // Defined in CSSPrimitiveValueMa ppings.h
276 276
277 template<typename T> CSSPrimitiveValue(T* val) 277 template<typename T> CSSPrimitiveValue(T* val)
278 : CSSValue(PrimitiveClass) 278 : CSSValue(PrimitiveClass)
279 , m_primitiveUnitType(0)
280 , m_hasCachedCSSText(false)
279 { 281 {
280 init(val); 282 init(val);
281 } 283 }
282 284
283 static void create(int); // compile-time guard 285 static void create(int); // compile-time guard
284 static void create(unsigned); // compile-time guard 286 static void create(unsigned); // compile-time guard
285 template<typename T> operator T*(); // compile-time guard 287 template<typename T> operator T*(); // compile-time guard
286 288
287 // Code generated by CSSPrimitiveValueUnitTrie.cpp.tmpl 289 // Code generated by CSSPrimitiveValueUnitTrie.cpp.tmpl
288 static UnitType stringToUnitType(const LChar*, unsigned length); 290 static UnitType stringToUnitType(const LChar*, unsigned length);
289 static UnitType stringToUnitType(const UChar*, unsigned length); 291 static UnitType stringToUnitType(const UChar*, unsigned length);
290 292
291 void init(UnitType); 293 void init(UnitType);
292 void init(const Length&); 294 void init(const Length&);
293 void init(CSSCalcValue*); 295 void init(CSSCalcValue*);
294 296
295 double computeLengthDouble(const CSSToLengthConversionData&) const; 297 double computeLengthDouble(const CSSToLengthConversionData&) const;
296 298
297 inline UnitType type() const { return static_cast<UnitType>(m_primitiveUnitT ype); } 299 inline UnitType type() const { return static_cast<UnitType>(m_primitiveUnitT ype); }
298 300
301 unsigned m_primitiveUnitType : 7; // CSSPrimitiveValue::UnitType
302 mutable unsigned m_hasCachedCSSText : 1;
303
299 union { 304 union {
300 CSSValueID valueID; 305 CSSValueID valueID;
301 double num; 306 double num;
302 // FIXME: oilpan: Should be a member, but no support for members in unio ns. Just trace the raw ptr for now. 307 // FIXME: oilpan: Should be a member, but no support for members in unio ns. Just trace the raw ptr for now.
303 CSSCalcValue* calc; 308 CSSCalcValue* calc;
304 } m_value; 309 } m_value;
305 }; 310 };
306 311
307 using CSSLengthArray = CSSPrimitiveValue::CSSLengthArray; 312 using CSSLengthArray = CSSPrimitiveValue::CSSLengthArray;
308 313
309 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); 314 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue());
310 315
311 } // namespace blink 316 } // namespace blink
312 317
313 #endif // CSSPrimitiveValue_h 318 #endif // CSSPrimitiveValue_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp » ('j') | third_party/WebKit/Source/core/css/CSSValue.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698