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 |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 * | 24 * |
25 */ | 25 */ |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "core/css/CSSValue.h" | 28 #include "core/css/CSSValue.h" |
29 | 29 |
30 #include "core/css/CSSArrayFunctionValue.h" | |
31 #include "core/css/CSSAspectRatioValue.h" | 30 #include "core/css/CSSAspectRatioValue.h" |
32 #include "core/css/CSSBorderImageSliceValue.h" | 31 #include "core/css/CSSBorderImageSliceValue.h" |
33 #include "core/css/CSSCalculationValue.h" | 32 #include "core/css/CSSCalculationValue.h" |
34 #include "core/css/CSSCanvasValue.h" | 33 #include "core/css/CSSCanvasValue.h" |
35 #include "core/css/CSSCrossfadeValue.h" | 34 #include "core/css/CSSCrossfadeValue.h" |
36 #include "core/css/CSSCursorImageValue.h" | 35 #include "core/css/CSSCursorImageValue.h" |
37 #include "core/css/CSSFilterValue.h" | 36 #include "core/css/CSSFilterValue.h" |
38 #include "core/css/CSSFontFaceSrcValue.h" | 37 #include "core/css/CSSFontFaceSrcValue.h" |
39 #include "core/css/CSSFontFeatureValue.h" | 38 #include "core/css/CSSFontFeatureValue.h" |
40 #include "core/css/CSSFontValue.h" | 39 #include "core/css/CSSFontValue.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 case CSSTransformClass: | 203 case CSSTransformClass: |
205 return compareCSSValues<CSSTransformValue>(*this, other); | 204 return compareCSSValues<CSSTransformValue>(*this, other); |
206 case LineBoxContainClass: | 205 case LineBoxContainClass: |
207 return compareCSSValues<CSSLineBoxContainValue>(*this, other); | 206 return compareCSSValues<CSSLineBoxContainValue>(*this, other); |
208 case CalculationClass: | 207 case CalculationClass: |
209 return compareCSSValues<CSSCalcValue>(*this, other); | 208 return compareCSSValues<CSSCalcValue>(*this, other); |
210 case ImageSetClass: | 209 case ImageSetClass: |
211 return compareCSSValues<CSSImageSetValue>(*this, other); | 210 return compareCSSValues<CSSImageSetValue>(*this, other); |
212 case CSSFilterClass: | 211 case CSSFilterClass: |
213 return compareCSSValues<CSSFilterValue>(*this, other); | 212 return compareCSSValues<CSSFilterValue>(*this, other); |
214 case CSSArrayFunctionValueClass: | |
215 return compareCSSValues<CSSArrayFunctionValue>(*this, other); | |
216 case CSSSVGDocumentClass: | 213 case CSSSVGDocumentClass: |
217 return compareCSSValues<CSSSVGDocumentValue>(*this, other); | 214 return compareCSSValues<CSSSVGDocumentValue>(*this, other); |
218 default: | 215 default: |
219 ASSERT_NOT_REACHED(); | 216 ASSERT_NOT_REACHED(); |
220 return false; | 217 return false; |
221 } | 218 } |
222 } else if (m_classType == ValueListClass && other.m_classType != ValueListCl
ass) | 219 } else if (m_classType == ValueListClass && other.m_classType != ValueListCl
ass) |
223 return toCSSValueList(this)->equals(other); | 220 return toCSSValueList(this)->equals(other); |
224 else if (m_classType != ValueListClass && other.m_classType == ValueListClas
s) | 221 else if (m_classType != ValueListClass && other.m_classType == ValueListClas
s) |
225 return static_cast<const CSSValueList&>(other).equals(*this); | 222 return static_cast<const CSSValueList&>(other).equals(*this); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 case CSSTransformClass: | 281 case CSSTransformClass: |
285 return toCSSTransformValue(this)->customCSSText(); | 282 return toCSSTransformValue(this)->customCSSText(); |
286 case LineBoxContainClass: | 283 case LineBoxContainClass: |
287 return toCSSLineBoxContainValue(this)->customCSSText(); | 284 return toCSSLineBoxContainValue(this)->customCSSText(); |
288 case CalculationClass: | 285 case CalculationClass: |
289 return toCSSCalcValue(this)->customCSSText(); | 286 return toCSSCalcValue(this)->customCSSText(); |
290 case ImageSetClass: | 287 case ImageSetClass: |
291 return toCSSImageSetValue(this)->customCSSText(); | 288 return toCSSImageSetValue(this)->customCSSText(); |
292 case CSSFilterClass: | 289 case CSSFilterClass: |
293 return toCSSFilterValue(this)->customCSSText(); | 290 return toCSSFilterValue(this)->customCSSText(); |
294 case CSSArrayFunctionValueClass: | |
295 return toCSSArrayFunctionValue(this)->customCSSText(); | |
296 case CSSSVGDocumentClass: | 291 case CSSSVGDocumentClass: |
297 return toCSSSVGDocumentValue(this)->customCSSText(); | 292 return toCSSSVGDocumentValue(this)->customCSSText(); |
298 } | 293 } |
299 ASSERT_NOT_REACHED(); | 294 ASSERT_NOT_REACHED(); |
300 return String(); | 295 return String(); |
301 } | 296 } |
302 | 297 |
303 void CSSValue::destroy() | 298 void CSSValue::destroy() |
304 { | 299 { |
305 if (m_isTextClone) { | 300 if (m_isTextClone) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 return; | 382 return; |
388 case CalculationClass: | 383 case CalculationClass: |
389 delete toCSSCalcValue(this); | 384 delete toCSSCalcValue(this); |
390 return; | 385 return; |
391 case ImageSetClass: | 386 case ImageSetClass: |
392 delete toCSSImageSetValue(this); | 387 delete toCSSImageSetValue(this); |
393 return; | 388 return; |
394 case CSSFilterClass: | 389 case CSSFilterClass: |
395 delete toCSSFilterValue(this); | 390 delete toCSSFilterValue(this); |
396 return; | 391 return; |
397 case CSSArrayFunctionValueClass: | |
398 delete toCSSArrayFunctionValue(this); | |
399 return; | |
400 case CSSSVGDocumentClass: | 392 case CSSSVGDocumentClass: |
401 delete toCSSSVGDocumentValue(this); | 393 delete toCSSSVGDocumentValue(this); |
402 return; | 394 return; |
403 } | 395 } |
404 ASSERT_NOT_REACHED(); | 396 ASSERT_NOT_REACHED(); |
405 } | 397 } |
406 | 398 |
407 void CSSValue::finalizeGarbageCollectedObject() | 399 void CSSValue::finalizeGarbageCollectedObject() |
408 { | 400 { |
409 if (m_isTextClone) { | 401 if (m_isTextClone) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 return; | 483 return; |
492 case CalculationClass: | 484 case CalculationClass: |
493 toCSSCalcValue(this)->~CSSCalcValue(); | 485 toCSSCalcValue(this)->~CSSCalcValue(); |
494 return; | 486 return; |
495 case ImageSetClass: | 487 case ImageSetClass: |
496 toCSSImageSetValue(this)->~CSSImageSetValue(); | 488 toCSSImageSetValue(this)->~CSSImageSetValue(); |
497 return; | 489 return; |
498 case CSSFilterClass: | 490 case CSSFilterClass: |
499 toCSSFilterValue(this)->~CSSFilterValue(); | 491 toCSSFilterValue(this)->~CSSFilterValue(); |
500 return; | 492 return; |
501 case CSSArrayFunctionValueClass: | |
502 toCSSArrayFunctionValue(this)->~CSSArrayFunctionValue(); | |
503 return; | |
504 case CSSSVGDocumentClass: | 493 case CSSSVGDocumentClass: |
505 toCSSSVGDocumentValue(this)->~CSSSVGDocumentValue(); | 494 toCSSSVGDocumentValue(this)->~CSSSVGDocumentValue(); |
506 return; | 495 return; |
507 } | 496 } |
508 ASSERT_NOT_REACHED(); | 497 ASSERT_NOT_REACHED(); |
509 } | 498 } |
510 | 499 |
511 void CSSValue::trace(Visitor* visitor) | 500 void CSSValue::trace(Visitor* visitor) |
512 { | 501 { |
513 if (m_isTextClone) { | 502 if (m_isTextClone) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 return; | 584 return; |
596 case CalculationClass: | 585 case CalculationClass: |
597 toCSSCalcValue(this)->traceAfterDispatch(visitor); | 586 toCSSCalcValue(this)->traceAfterDispatch(visitor); |
598 return; | 587 return; |
599 case ImageSetClass: | 588 case ImageSetClass: |
600 toCSSImageSetValue(this)->traceAfterDispatch(visitor); | 589 toCSSImageSetValue(this)->traceAfterDispatch(visitor); |
601 return; | 590 return; |
602 case CSSFilterClass: | 591 case CSSFilterClass: |
603 toCSSFilterValue(this)->traceAfterDispatch(visitor); | 592 toCSSFilterValue(this)->traceAfterDispatch(visitor); |
604 return; | 593 return; |
605 case CSSArrayFunctionValueClass: | |
606 toCSSArrayFunctionValue(this)->traceAfterDispatch(visitor); | |
607 return; | |
608 case CSSSVGDocumentClass: | 594 case CSSSVGDocumentClass: |
609 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor); | 595 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor); |
610 return; | 596 return; |
611 } | 597 } |
612 ASSERT_NOT_REACHED(); | 598 ASSERT_NOT_REACHED(); |
613 } | 599 } |
614 | 600 |
615 PassRefPtrWillBeRawPtr<CSSValue> CSSValue::cloneForCSSOM() const | 601 PassRefPtrWillBeRawPtr<CSSValue> CSSValue::cloneForCSSOM() const |
616 { | 602 { |
617 switch (classType()) { | 603 switch (classType()) { |
618 case PrimitiveClass: | 604 case PrimitiveClass: |
619 return toCSSPrimitiveValue(this)->cloneForCSSOM(); | 605 return toCSSPrimitiveValue(this)->cloneForCSSOM(); |
620 case ValueListClass: | 606 case ValueListClass: |
621 return toCSSValueList(this)->cloneForCSSOM(); | 607 return toCSSValueList(this)->cloneForCSSOM(); |
622 case ImageClass: | 608 case ImageClass: |
623 case CursorImageClass: | 609 case CursorImageClass: |
624 return toCSSImageValue(this)->cloneForCSSOM(); | 610 return toCSSImageValue(this)->cloneForCSSOM(); |
625 case CSSFilterClass: | 611 case CSSFilterClass: |
626 return toCSSFilterValue(this)->cloneForCSSOM(); | 612 return toCSSFilterValue(this)->cloneForCSSOM(); |
627 case CSSArrayFunctionValueClass: | |
628 return toCSSArrayFunctionValue(this)->cloneForCSSOM(); | |
629 case CSSTransformClass: | 613 case CSSTransformClass: |
630 return toCSSTransformValue(this)->cloneForCSSOM(); | 614 return toCSSTransformValue(this)->cloneForCSSOM(); |
631 case ImageSetClass: | 615 case ImageSetClass: |
632 return toCSSImageSetValue(this)->cloneForCSSOM(); | 616 return toCSSImageSetValue(this)->cloneForCSSOM(); |
633 default: | 617 default: |
634 ASSERT(!isSubtypeExposedToCSSOM()); | 618 ASSERT(!isSubtypeExposedToCSSOM()); |
635 return TextCloneCSSValue::create(classType(), cssText()); | 619 return TextCloneCSSValue::create(classType(), cssText()); |
636 } | 620 } |
637 } | 621 } |
638 | 622 |
639 } | 623 } |
OLD | NEW |