| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) | 2 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * | 24 * |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "sky/engine/config.h" | 27 #include "sky/engine/config.h" |
| 28 #include "sky/engine/core/css/CSSValue.h" | 28 #include "sky/engine/core/css/CSSValue.h" |
| 29 | 29 |
| 30 #include "sky/engine/core/css/CSSAspectRatioValue.h" | 30 #include "sky/engine/core/css/CSSAspectRatioValue.h" |
| 31 #include "sky/engine/core/css/CSSBorderImageSliceValue.h" | 31 #include "sky/engine/core/css/CSSBorderImageSliceValue.h" |
| 32 #include "sky/engine/core/css/CSSCalculationValue.h" | 32 #include "sky/engine/core/css/CSSCalculationValue.h" |
| 33 #include "sky/engine/core/css/CSSCrossfadeValue.h" | 33 #include "sky/engine/core/css/CSSCrossfadeValue.h" |
| 34 #include "sky/engine/core/css/CSSCursorImageValue.h" | |
| 35 #include "sky/engine/core/css/CSSFilterValue.h" | 34 #include "sky/engine/core/css/CSSFilterValue.h" |
| 36 #include "sky/engine/core/css/CSSFontFaceSrcValue.h" | 35 #include "sky/engine/core/css/CSSFontFaceSrcValue.h" |
| 37 #include "sky/engine/core/css/CSSFontFeatureValue.h" | 36 #include "sky/engine/core/css/CSSFontFeatureValue.h" |
| 38 #include "sky/engine/core/css/CSSFontValue.h" | 37 #include "sky/engine/core/css/CSSFontValue.h" |
| 39 #include "sky/engine/core/css/CSSFunctionValue.h" | 38 #include "sky/engine/core/css/CSSFunctionValue.h" |
| 40 #include "sky/engine/core/css/CSSGradientValue.h" | 39 #include "sky/engine/core/css/CSSGradientValue.h" |
| 41 #include "sky/engine/core/css/CSSImageSetValue.h" | 40 #include "sky/engine/core/css/CSSImageSetValue.h" |
| 42 #include "sky/engine/core/css/CSSImageValue.h" | 41 #include "sky/engine/core/css/CSSImageValue.h" |
| 43 #include "sky/engine/core/css/CSSInheritedValue.h" | 42 #include "sky/engine/core/css/CSSInheritedValue.h" |
| 44 #include "sky/engine/core/css/CSSInitialValue.h" | 43 #include "sky/engine/core/css/CSSInitialValue.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 ASSERT(isCSSOMSafe()); | 110 ASSERT(isCSSOMSafe()); |
| 112 return toTextCloneCSSValue(this)->cssText() == other.cssText(); | 111 return toTextCloneCSSValue(this)->cssText() == other.cssText(); |
| 113 } | 112 } |
| 114 | 113 |
| 115 if (m_classType == other.m_classType) { | 114 if (m_classType == other.m_classType) { |
| 116 switch (m_classType) { | 115 switch (m_classType) { |
| 117 case AspectRatioClass: | 116 case AspectRatioClass: |
| 118 return compareCSSValues<CSSAspectRatioValue>(*this, other); | 117 return compareCSSValues<CSSAspectRatioValue>(*this, other); |
| 119 case BorderImageSliceClass: | 118 case BorderImageSliceClass: |
| 120 return compareCSSValues<CSSBorderImageSliceValue>(*this, other); | 119 return compareCSSValues<CSSBorderImageSliceValue>(*this, other); |
| 121 case CursorImageClass: | |
| 122 return compareCSSValues<CSSCursorImageValue>(*this, other); | |
| 123 case FontClass: | 120 case FontClass: |
| 124 return compareCSSValues<CSSFontValue>(*this, other); | 121 return compareCSSValues<CSSFontValue>(*this, other); |
| 125 case FontFaceSrcClass: | 122 case FontFaceSrcClass: |
| 126 return compareCSSValues<CSSFontFaceSrcValue>(*this, other); | 123 return compareCSSValues<CSSFontFaceSrcValue>(*this, other); |
| 127 case FontFeatureClass: | 124 case FontFeatureClass: |
| 128 return compareCSSValues<CSSFontFeatureValue>(*this, other); | 125 return compareCSSValues<CSSFontFeatureValue>(*this, other); |
| 129 case FunctionClass: | 126 case FunctionClass: |
| 130 return compareCSSValues<CSSFunctionValue>(*this, other); | 127 return compareCSSValues<CSSFunctionValue>(*this, other); |
| 131 case LinearGradientClass: | 128 case LinearGradientClass: |
| 132 return compareCSSValues<CSSLinearGradientValue>(*this, other); | 129 return compareCSSValues<CSSLinearGradientValue>(*this, other); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 ASSERT(isCSSOMSafe()); | 176 ASSERT(isCSSOMSafe()); |
| 180 return toTextCloneCSSValue(this)->cssText(); | 177 return toTextCloneCSSValue(this)->cssText(); |
| 181 } | 178 } |
| 182 ASSERT(!isCSSOMSafe() || isSubtypeExposedToCSSOM()); | 179 ASSERT(!isCSSOMSafe() || isSubtypeExposedToCSSOM()); |
| 183 | 180 |
| 184 switch (classType()) { | 181 switch (classType()) { |
| 185 case AspectRatioClass: | 182 case AspectRatioClass: |
| 186 return toCSSAspectRatioValue(this)->customCSSText(); | 183 return toCSSAspectRatioValue(this)->customCSSText(); |
| 187 case BorderImageSliceClass: | 184 case BorderImageSliceClass: |
| 188 return toCSSBorderImageSliceValue(this)->customCSSText(); | 185 return toCSSBorderImageSliceValue(this)->customCSSText(); |
| 189 case CursorImageClass: | |
| 190 return toCSSCursorImageValue(this)->customCSSText(); | |
| 191 case FontClass: | 186 case FontClass: |
| 192 return toCSSFontValue(this)->customCSSText(); | 187 return toCSSFontValue(this)->customCSSText(); |
| 193 case FontFaceSrcClass: | 188 case FontFaceSrcClass: |
| 194 return toCSSFontFaceSrcValue(this)->customCSSText(); | 189 return toCSSFontFaceSrcValue(this)->customCSSText(); |
| 195 case FontFeatureClass: | 190 case FontFeatureClass: |
| 196 return toCSSFontFeatureValue(this)->customCSSText(); | 191 return toCSSFontFeatureValue(this)->customCSSText(); |
| 197 case FunctionClass: | 192 case FunctionClass: |
| 198 return toCSSFunctionValue(this)->customCSSText(); | 193 return toCSSFunctionValue(this)->customCSSText(); |
| 199 case LinearGradientClass: | 194 case LinearGradientClass: |
| 200 return toCSSLinearGradientValue(this)->customCSSText(); | 195 return toCSSLinearGradientValue(this)->customCSSText(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 239 } |
| 245 ASSERT(!isCSSOMSafe() || isSubtypeExposedToCSSOM()); | 240 ASSERT(!isCSSOMSafe() || isSubtypeExposedToCSSOM()); |
| 246 | 241 |
| 247 switch (classType()) { | 242 switch (classType()) { |
| 248 case AspectRatioClass: | 243 case AspectRatioClass: |
| 249 delete toCSSAspectRatioValue(this); | 244 delete toCSSAspectRatioValue(this); |
| 250 return; | 245 return; |
| 251 case BorderImageSliceClass: | 246 case BorderImageSliceClass: |
| 252 delete toCSSBorderImageSliceValue(this); | 247 delete toCSSBorderImageSliceValue(this); |
| 253 return; | 248 return; |
| 254 case CursorImageClass: | |
| 255 delete toCSSCursorImageValue(this); | |
| 256 return; | |
| 257 case FontClass: | 249 case FontClass: |
| 258 delete toCSSFontValue(this); | 250 delete toCSSFontValue(this); |
| 259 return; | 251 return; |
| 260 case FontFaceSrcClass: | 252 case FontFaceSrcClass: |
| 261 delete toCSSFontFaceSrcValue(this); | 253 delete toCSSFontFaceSrcValue(this); |
| 262 return; | 254 return; |
| 263 case FontFeatureClass: | 255 case FontFeatureClass: |
| 264 delete toCSSFontFeatureValue(this); | 256 delete toCSSFontFeatureValue(this); |
| 265 return; | 257 return; |
| 266 case FunctionClass: | 258 case FunctionClass: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 } | 314 } |
| 323 | 315 |
| 324 PassRefPtr<CSSValue> CSSValue::cloneForCSSOM() const | 316 PassRefPtr<CSSValue> CSSValue::cloneForCSSOM() const |
| 325 { | 317 { |
| 326 switch (classType()) { | 318 switch (classType()) { |
| 327 case PrimitiveClass: | 319 case PrimitiveClass: |
| 328 return toCSSPrimitiveValue(this)->cloneForCSSOM(); | 320 return toCSSPrimitiveValue(this)->cloneForCSSOM(); |
| 329 case ValueListClass: | 321 case ValueListClass: |
| 330 return toCSSValueList(this)->cloneForCSSOM(); | 322 return toCSSValueList(this)->cloneForCSSOM(); |
| 331 case ImageClass: | 323 case ImageClass: |
| 332 case CursorImageClass: | |
| 333 return toCSSImageValue(this)->cloneForCSSOM(); | 324 return toCSSImageValue(this)->cloneForCSSOM(); |
| 334 case CSSFilterClass: | 325 case CSSFilterClass: |
| 335 return toCSSFilterValue(this)->cloneForCSSOM(); | 326 return toCSSFilterValue(this)->cloneForCSSOM(); |
| 336 case CSSTransformClass: | 327 case CSSTransformClass: |
| 337 return toCSSTransformValue(this)->cloneForCSSOM(); | 328 return toCSSTransformValue(this)->cloneForCSSOM(); |
| 338 case ImageSetClass: | 329 case ImageSetClass: |
| 339 return toCSSImageSetValue(this)->cloneForCSSOM(); | 330 return toCSSImageSetValue(this)->cloneForCSSOM(); |
| 340 default: | 331 default: |
| 341 ASSERT(!isSubtypeExposedToCSSOM()); | 332 ASSERT(!isSubtypeExposedToCSSOM()); |
| 342 return TextCloneCSSValue::create(classType(), cssText()); | 333 return TextCloneCSSValue::create(classType(), cssText()); |
| 343 } | 334 } |
| 344 } | 335 } |
| 345 | 336 |
| 346 } | 337 } |
| OLD | NEW |