| OLD | NEW |
| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 unsigned short type = primitiveType(); | 191 unsigned short type = primitiveType(); |
| 192 return type >= CSS_DPPX && type <= CSS_DPCM; | 192 return type >= CSS_DPPX && type <= CSS_DPCM; |
| 193 } | 193 } |
| 194 bool isViewportPercentageLength() const { return m_primitiveUnitType >= CSS_
VW && m_primitiveUnitType <= CSS_VMAX; } | 194 bool isViewportPercentageLength() const { return m_primitiveUnitType >= CSS_
VW && m_primitiveUnitType <= CSS_VMAX; } |
| 195 bool isFlex() const { return primitiveType() == CSS_FR; } | 195 bool isFlex() const { return primitiveType() == CSS_FR; } |
| 196 bool isValueID() const { return m_primitiveUnitType == CSS_VALUE_ID; } | 196 bool isValueID() const { return m_primitiveUnitType == CSS_VALUE_ID; } |
| 197 bool colorIsDerivedFromElement() const; | 197 bool colorIsDerivedFromElement() const; |
| 198 | 198 |
| 199 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifier(CSSValueID
valueID) | 199 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifier(CSSValueID
valueID) |
| 200 { | 200 { |
| 201 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSPrimitiveV
alue(valueID)); | 201 return adoptRefWillBeRefCountedGarbageCollected(new CSSPrimitiveValue(va
lueID)); |
| 202 } | 202 } |
| 203 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifier(CSSPropert
yID propertyID) | 203 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifier(CSSPropert
yID propertyID) |
| 204 { | 204 { |
| 205 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSPrimitiveV
alue(propertyID)); | 205 return adoptRefWillBeRefCountedGarbageCollected(new CSSPrimitiveValue(pr
opertyID)); |
| 206 } | 206 } |
| 207 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createParserOperator(int pa
rserOperator) | 207 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createParserOperator(int pa
rserOperator) |
| 208 { | 208 { |
| 209 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSPrimitiveV
alue(parserOperator)); | 209 return adoptRefWillBeRefCountedGarbageCollected(new CSSPrimitiveValue(pa
rserOperator)); |
| 210 } | 210 } |
| 211 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createColor(unsigned rgbVal
ue) | 211 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createColor(unsigned rgbVal
ue) |
| 212 { | 212 { |
| 213 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSPrimitiveV
alue(rgbValue)); | 213 return adoptRefWillBeRefCountedGarbageCollected(new CSSPrimitiveValue(rg
bValue)); |
| 214 } | 214 } |
| 215 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(double value, UnitTy
pes type) | 215 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(double value, UnitTy
pes type) |
| 216 { | 216 { |
| 217 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSPrimitiveV
alue(value, type)); | 217 return adoptRefWillBeRefCountedGarbageCollected(new CSSPrimitiveValue(va
lue, type)); |
| 218 } | 218 } |
| 219 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const String& value,
UnitTypes type) | 219 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const String& value,
UnitTypes type) |
| 220 { | 220 { |
| 221 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSPrimitiveV
alue(value, type)); | 221 return adoptRefWillBeRefCountedGarbageCollected(new CSSPrimitiveValue(va
lue, type)); |
| 222 } | 222 } |
| 223 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const Length& value,
float zoom) | 223 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const Length& value,
float zoom) |
| 224 { | 224 { |
| 225 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSPrimitiveV
alue(value, zoom)); | 225 return adoptRefWillBeRefCountedGarbageCollected(new CSSPrimitiveValue(va
lue, zoom)); |
| 226 } | 226 } |
| 227 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const LengthSize& va
lue) | 227 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const LengthSize& va
lue) |
| 228 { | 228 { |
| 229 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSPrimitiveV
alue(value)); | 229 return adoptRefWillBeRefCountedGarbageCollected(new CSSPrimitiveValue(va
lue)); |
| 230 } | 230 } |
| 231 template<typename T> static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create
(T value) | 231 template<typename T> static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create
(T value) |
| 232 { | 232 { |
| 233 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSPrimitiveV
alue(value)); | 233 return adoptRefWillBeRefCountedGarbageCollected(new CSSPrimitiveValue(va
lue)); |
| 234 } | 234 } |
| 235 | 235 |
| 236 // This value is used to handle quirky margins in reflow roots (body, td, an
d th) like WinIE. | 236 // This value is used to handle quirky margins in reflow roots (body, td, an
d th) like WinIE. |
| 237 // The basic idea is that a stylesheet can use the value __qem (for quirky e
m) instead of em. | 237 // The basic idea is that a stylesheet can use the value __qem (for quirky e
m) instead of em. |
| 238 // When the quirky value is used, if you're in quirks mode, the margin will
collapse away | 238 // When the quirky value is used, if you're in quirks mode, the margin will
collapse away |
| 239 // inside a table cell. | 239 // inside a table cell. |
| 240 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createAllowingMarginQuirk(d
ouble value, UnitTypes type) | 240 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createAllowingMarginQuirk(d
ouble value, UnitTypes type) |
| 241 { | 241 { |
| 242 CSSPrimitiveValue* quirkValue = new CSSPrimitiveValue(value, type); | 242 CSSPrimitiveValue* quirkValue = new CSSPrimitiveValue(value, type); |
| 243 quirkValue->m_isQuirkValue = true; | 243 quirkValue->m_isQuirkValue = true; |
| 244 return adoptRefCountedWillBeRefCountedGarbageCollected(quirkValue); | 244 return adoptRefWillBeRefCountedGarbageCollected(quirkValue); |
| 245 } | 245 } |
| 246 | 246 |
| 247 ~CSSPrimitiveValue(); | 247 ~CSSPrimitiveValue(); |
| 248 | 248 |
| 249 void cleanup(); | 249 void cleanup(); |
| 250 | 250 |
| 251 unsigned short primitiveType() const; | 251 unsigned short primitiveType() const; |
| 252 | 252 |
| 253 double computeDegrees(); | 253 double computeDegrees(); |
| 254 | 254 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 Rect* rect; | 403 Rect* rect; |
| 404 Quad* quad; | 404 Quad* quad; |
| 405 } m_value; | 405 } m_value; |
| 406 }; | 406 }; |
| 407 | 407 |
| 408 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); | 408 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); |
| 409 | 409 |
| 410 } // namespace WebCore | 410 } // namespace WebCore |
| 411 | 411 |
| 412 #endif // CSSPrimitiveValue_h | 412 #endif // CSSPrimitiveValue_h |
| OLD | NEW |