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

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

Issue 1033943002: Rename LayoutStyle to papayawhip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ensureComputedStyle Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSMatrix.cpp ('k') | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 25 matching lines...) Expand all
36 class CSSBasicShape; 36 class CSSBasicShape;
37 class CSSCalcValue; 37 class CSSCalcValue;
38 class CSSToLengthConversionData; 38 class CSSToLengthConversionData;
39 class Counter; 39 class Counter;
40 class Length; 40 class Length;
41 class LengthSize; 41 class LengthSize;
42 class Pair; 42 class Pair;
43 class Quad; 43 class Quad;
44 class RGBColor; 44 class RGBColor;
45 class Rect; 45 class Rect;
46 class LayoutStyle; 46 class ComputedStyle;
47 47
48 // Dimension calculations are imprecise, often resulting in values of e.g. 48 // Dimension calculations are imprecise, often resulting in values of e.g.
49 // 44.99998. We need to go ahead and round if we're really close to the next 49 // 44.99998. We need to go ahead and round if we're really close to the next
50 // integer value. 50 // integer value.
51 template<typename T> inline T roundForImpreciseConversion(double value) 51 template<typename T> inline T roundForImpreciseConversion(double value)
52 { 52 {
53 value += (value < 0) ? -0.01 : +0.01; 53 value += (value < 0) ? -0.01 : +0.01;
54 return ((value > std::numeric_limits<T>::max()) || (value < std::numeric_lim its<T>::min())) ? 0 : static_cast<T>(value); 54 return ((value > std::numeric_limits<T>::max()) || (value < std::numeric_lim its<T>::min())) ? 0 : static_cast<T>(value);
55 } 55 }
56 56
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 return adoptRefWillBeNoop(new CSSPrimitiveValue(value, type)); 233 return adoptRefWillBeNoop(new CSSPrimitiveValue(value, type));
234 } 234 }
235 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const String& value, UnitType type) 235 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const String& value, UnitType type)
236 { 236 {
237 return adoptRefWillBeNoop(new CSSPrimitiveValue(value, type)); 237 return adoptRefWillBeNoop(new CSSPrimitiveValue(value, type));
238 } 238 }
239 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const Length& value, float zoom) 239 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const Length& value, float zoom)
240 { 240 {
241 return adoptRefWillBeNoop(new CSSPrimitiveValue(value, zoom)); 241 return adoptRefWillBeNoop(new CSSPrimitiveValue(value, zoom));
242 } 242 }
243 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const LengthSize& va lue, const LayoutStyle& style) 243 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const LengthSize& va lue, const ComputedStyle& style)
244 { 244 {
245 return adoptRefWillBeNoop(new CSSPrimitiveValue(value, style)); 245 return adoptRefWillBeNoop(new CSSPrimitiveValue(value, style));
246 } 246 }
247 template<typename T> static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create (T value) 247 template<typename T> static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create (T value)
248 { 248 {
249 return adoptRefWillBeNoop(new CSSPrimitiveValue(value)); 249 return adoptRefWillBeNoop(new CSSPrimitiveValue(value));
250 } 250 }
251 251
252 // This value is used to handle quirky margins in reflow roots (body, td, an d th) like WinIE. 252 // This value is used to handle quirky margins in reflow roots (body, td, an d th) like WinIE.
253 // The basic idea is that a stylesheet can use the value __qem (for quirky e m) instead of em. 253 // The basic idea is that a stylesheet can use the value __qem (for quirky e m) instead of em.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 static bool unitTypeToLengthUnitType(UnitType, LengthUnitType&); 327 static bool unitTypeToLengthUnitType(UnitType, LengthUnitType&);
328 static UnitType lengthUnitTypeToUnitType(LengthUnitType); 328 static UnitType lengthUnitTypeToUnitType(LengthUnitType);
329 329
330 private: 330 private:
331 CSSPrimitiveValue(CSSValueID); 331 CSSPrimitiveValue(CSSValueID);
332 CSSPrimitiveValue(CSSPropertyID); 332 CSSPrimitiveValue(CSSPropertyID);
333 // int vs. unsigned is too subtle to distinguish types, so require a UnitTyp e. 333 // int vs. unsigned is too subtle to distinguish types, so require a UnitTyp e.
334 CSSPrimitiveValue(int parserOperator, UnitType); 334 CSSPrimitiveValue(int parserOperator, UnitType);
335 CSSPrimitiveValue(unsigned color, UnitType); // RGB value 335 CSSPrimitiveValue(unsigned color, UnitType); // RGB value
336 CSSPrimitiveValue(const Length&, float zoom); 336 CSSPrimitiveValue(const Length&, float zoom);
337 CSSPrimitiveValue(const LengthSize&, const LayoutStyle&); 337 CSSPrimitiveValue(const LengthSize&, const ComputedStyle&);
338 CSSPrimitiveValue(const String&, UnitType); 338 CSSPrimitiveValue(const String&, UnitType);
339 CSSPrimitiveValue(double, UnitType); 339 CSSPrimitiveValue(double, UnitType);
340 340
341 template<typename T> CSSPrimitiveValue(T); // Defined in CSSPrimitiveValueMa ppings.h 341 template<typename T> CSSPrimitiveValue(T); // Defined in CSSPrimitiveValueMa ppings.h
342 template<typename T> CSSPrimitiveValue(T* val) 342 template<typename T> CSSPrimitiveValue(T* val)
343 : CSSValue(PrimitiveClass) 343 : CSSValue(PrimitiveClass)
344 { 344 {
345 init(PassRefPtrWillBeRawPtr<T>(val)); 345 init(PassRefPtrWillBeRawPtr<T>(val));
346 } 346 }
347 347
348 template<typename T> CSSPrimitiveValue(PassRefPtrWillBeRawPtr<T> val) 348 template<typename T> CSSPrimitiveValue(PassRefPtrWillBeRawPtr<T> val)
349 : CSSValue(PrimitiveClass) 349 : CSSValue(PrimitiveClass)
350 { 350 {
351 init(val); 351 init(val);
352 } 352 }
353 353
354 static void create(int); // compile-time guard 354 static void create(int); // compile-time guard
355 static void create(unsigned); // compile-time guard 355 static void create(unsigned); // compile-time guard
356 template<typename T> operator T*(); // compile-time guard 356 template<typename T> operator T*(); // compile-time guard
357 357
358 void init(const Length&); 358 void init(const Length&);
359 void init(const LengthSize&, const LayoutStyle&); 359 void init(const LengthSize&, const ComputedStyle&);
360 void init(PassRefPtrWillBeRawPtr<Counter>); 360 void init(PassRefPtrWillBeRawPtr<Counter>);
361 void init(PassRefPtrWillBeRawPtr<Rect>); 361 void init(PassRefPtrWillBeRawPtr<Rect>);
362 void init(PassRefPtrWillBeRawPtr<Pair>); 362 void init(PassRefPtrWillBeRawPtr<Pair>);
363 void init(PassRefPtrWillBeRawPtr<Quad>); 363 void init(PassRefPtrWillBeRawPtr<Quad>);
364 void init(PassRefPtrWillBeRawPtr<CSSBasicShape>); 364 void init(PassRefPtrWillBeRawPtr<CSSBasicShape>);
365 void init(PassRefPtrWillBeRawPtr<CSSCalcValue>); 365 void init(PassRefPtrWillBeRawPtr<CSSCalcValue>);
366 366
367 double computeLengthDouble(const CSSToLengthConversionData&); 367 double computeLengthDouble(const CSSToLengthConversionData&);
368 368
369 union { 369 union {
(...skipping 14 matching lines...) Expand all
384 }; 384 };
385 385
386 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray; 386 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray;
387 typedef CSSPrimitiveValue::CSSLengthTypeArray CSSLengthTypeArray; 387 typedef CSSPrimitiveValue::CSSLengthTypeArray CSSLengthTypeArray;
388 388
389 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); 389 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue());
390 390
391 } // namespace blink 391 } // namespace blink
392 392
393 #endif // CSSPrimitiveValue_h 393 #endif // CSSPrimitiveValue_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSMatrix.cpp ('k') | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698