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

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

Issue 227043007: CSS Length calculation with MediaValues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sizes_parser3
Patch Set: Fix debug compile issue Created 6 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
« no previous file with comments | « Source/core/css/CSSLengthData.h ('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 17 matching lines...) Expand all
28 #include "platform/graphics/Color.h" 28 #include "platform/graphics/Color.h"
29 #include "wtf/Forward.h" 29 #include "wtf/Forward.h"
30 #include "wtf/MathExtras.h" 30 #include "wtf/MathExtras.h"
31 #include "wtf/PassRefPtr.h" 31 #include "wtf/PassRefPtr.h"
32 32
33 namespace WebCore { 33 namespace WebCore {
34 34
35 class CSSBasicShape; 35 class CSSBasicShape;
36 class CSSCalcValue; 36 class CSSCalcValue;
37 class CSSToLengthConversionData; 37 class CSSToLengthConversionData;
38 class CSSLengthData;
38 class Counter; 39 class Counter;
39 class ExceptionState; 40 class ExceptionState;
40 class Length; 41 class Length;
41 class LengthSize; 42 class LengthSize;
42 class Pair; 43 class Pair;
43 class Quad; 44 class Quad;
44 class RGBColor; 45 class RGBColor;
45 class Rect; 46 class Rect;
46 class RenderStyle; 47 class RenderStyle;
47 48
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 277
277 /* 278 /*
278 * Computes a length in pixels out of the given CSSValue 279 * Computes a length in pixels out of the given CSSValue
279 * 280 *
280 * The metrics have to be a bit different for screen and printer output. 281 * The metrics have to be a bit different for screen and printer output.
281 * For screen output we assume 1 inch == 72 px, for printer we assume 300 dp i 282 * For screen output we assume 1 inch == 72 px, for printer we assume 300 dp i
282 * 283 *
283 * this is screen/printer dependent, so we probably need a config option for this, 284 * this is screen/printer dependent, so we probably need a config option for this,
284 * and some tool to calibrate. 285 * and some tool to calibrate.
285 */ 286 */
286 template<typename T> T computeLength(const CSSToLengthConversionData&); 287 template<typename T> T computeLength(const CSSLengthData&);
287 288
288 // Converts to a Length, mapping various unit types appropriately. 289 // Converts to a Length, mapping various unit types appropriately.
289 template<int> Length convertToLength(const CSSToLengthConversionData&); 290 template<int> Length convertToLength(const CSSToLengthConversionData&);
290 291
291 double getDoubleValue(unsigned short unitType, ExceptionState&) const; 292 double getDoubleValue(unsigned short unitType, ExceptionState&) const;
292 double getDoubleValue(unsigned short unitType) const; 293 double getDoubleValue(unsigned short unitType) const;
293 double getDoubleValue() const; 294 double getDoubleValue() const;
294 295
295 void setFloatValue(unsigned short unitType, double floatValue, ExceptionStat e&); 296 void setFloatValue(unsigned short unitType, double floatValue, ExceptionStat e&);
296 float getFloatValue(unsigned short unitType, ExceptionState& exceptionState) const { return getValue<float>(unitType, exceptionState); } 297 float getFloatValue(unsigned short unitType, ExceptionState& exceptionState) const { return getValue<float>(unitType, exceptionState); }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 void init(const Length&); 384 void init(const Length&);
384 void init(const LengthSize&); 385 void init(const LengthSize&);
385 void init(PassRefPtrWillBeRawPtr<Counter>); 386 void init(PassRefPtrWillBeRawPtr<Counter>);
386 void init(PassRefPtrWillBeRawPtr<Rect>); 387 void init(PassRefPtrWillBeRawPtr<Rect>);
387 void init(PassRefPtrWillBeRawPtr<Pair>); 388 void init(PassRefPtrWillBeRawPtr<Pair>);
388 void init(PassRefPtrWillBeRawPtr<Quad>); 389 void init(PassRefPtrWillBeRawPtr<Quad>);
389 void init(PassRefPtrWillBeRawPtr<CSSBasicShape>); 390 void init(PassRefPtrWillBeRawPtr<CSSBasicShape>);
390 void init(PassRefPtrWillBeRawPtr<CSSCalcValue>); 391 void init(PassRefPtrWillBeRawPtr<CSSCalcValue>);
391 bool getDoubleValueInternal(UnitTypes targetUnitType, double* result) const; 392 bool getDoubleValueInternal(UnitTypes targetUnitType, double* result) const;
392 393
393 double computeLengthDouble(const CSSToLengthConversionData&); 394 double computeLengthDouble(const CSSLengthData*);
394 395
395 union { 396 union {
396 CSSPropertyID propertyID; 397 CSSPropertyID propertyID;
397 CSSValueID valueID; 398 CSSValueID valueID;
398 int parserOperator; 399 int parserOperator;
399 double num; 400 double num;
400 StringImpl* string; 401 StringImpl* string;
401 unsigned rgbcolor; 402 unsigned rgbcolor;
402 // FIXME: oilpan: Should be members, but no support for members in union s. Just trace the raw ptr for now. 403 // FIXME: oilpan: Should be members, but no support for members in union s. Just trace the raw ptr for now.
403 CSSBasicShape* shape; 404 CSSBasicShape* shape;
404 CSSCalcValue* calc; 405 CSSCalcValue* calc;
405 Counter* counter; 406 Counter* counter;
406 Pair* pair; 407 Pair* pair;
407 Rect* rect; 408 Rect* rect;
408 Quad* quad; 409 Quad* quad;
409 } m_value; 410 } m_value;
410 }; 411 };
411 412
412 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); 413 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue());
413 414
414 } // namespace WebCore 415 } // namespace WebCore
415 416
416 #endif // CSSPrimitiveValue_h 417 #endif // CSSPrimitiveValue_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSLengthData.h ('k') | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698