| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 #include "core/css/CSSVariableReferenceValue.h" | 64 #include "core/css/CSSVariableReferenceValue.h" |
| 65 | 65 |
| 66 namespace blink { | 66 namespace blink { |
| 67 | 67 |
| 68 struct SameSizeAsCSSValue : public GarbageCollectedFinalized<SameSizeAsCSSValue>
{ | 68 struct SameSizeAsCSSValue : public GarbageCollectedFinalized<SameSizeAsCSSValue>
{ |
| 69 uint32_t bitfields; | 69 uint32_t bitfields; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 static_assert(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), "CSSValue should s
tay small"); | 72 static_assert(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), "CSSValue should s
tay small"); |
| 73 | 73 |
| 74 bool CSSValue::isImplicitInitialValue() const | |
| 75 { | |
| 76 return m_classType == InitialClass && toCSSInitialValue(this)->isImplicit(); | |
| 77 } | |
| 78 | |
| 79 bool CSSValue::hasFailedOrCanceledSubresources() const | 74 bool CSSValue::hasFailedOrCanceledSubresources() const |
| 80 { | 75 { |
| 81 if (isValueList()) | 76 if (isValueList()) |
| 82 return toCSSValueList(this)->hasFailedOrCanceledSubresources(); | 77 return toCSSValueList(this)->hasFailedOrCanceledSubresources(); |
| 83 if (getClassType() == FontFaceSrcClass) | 78 if (getClassType() == FontFaceSrcClass) |
| 84 return toCSSFontFaceSrcValue(this)->hasFailedOrCanceledSubresources(); | 79 return toCSSFontFaceSrcValue(this)->hasFailedOrCanceledSubresources(); |
| 85 if (getClassType() == ImageClass) | 80 if (getClassType() == ImageClass) |
| 86 return toCSSImageValue(this)->hasFailedOrCanceledSubresources(); | 81 return toCSSImageValue(this)->hasFailedOrCanceledSubresources(); |
| 87 if (getClassType() == CrossfadeClass) | 82 if (getClassType() == CrossfadeClass) |
| 88 return toCSSCrossfadeValue(this)->hasFailedOrCanceledSubresources(); | 83 return toCSSCrossfadeValue(this)->hasFailedOrCanceledSubresources(); |
| 89 if (getClassType() == ImageSetClass) | 84 if (getClassType() == ImageSetClass) |
| 90 return toCSSImageSetValue(this)->hasFailedOrCanceledSubresources(); | 85 return toCSSImageSetValue(this)->hasFailedOrCanceledSubresources(); |
| 91 | 86 |
| 92 return false; | 87 return false; |
| 93 } | 88 } |
| 94 | 89 |
| 95 template<class ChildClassType> | 90 template<class ChildClassType> |
| 96 inline static bool compareCSSValues(const CSSValue& first, const CSSValue& secon
d) | 91 inline static bool compareCSSValues(const CSSValue& first, const CSSValue& secon
d) |
| 97 { | 92 { |
| 98 return static_cast<const ChildClassType&>(first).equals(static_cast<const Ch
ildClassType&>(second)); | 93 return static_cast<const ChildClassType&>(first).equals(static_cast<const Ch
ildClassType&>(second)); |
| 99 } | 94 } |
| 100 | 95 |
| 101 bool CSSValue::equals(const CSSValue& other) const | 96 bool CSSValue::equals(const CSSValue& other) const |
| 102 { | 97 { |
| 98 if (m_implicit != other.m_implicit) |
| 99 return false; |
| 103 if (m_classType == other.m_classType) { | 100 if (m_classType == other.m_classType) { |
| 104 switch (getClassType()) { | 101 switch (getClassType()) { |
| 105 case BasicShapeCircleClass: | 102 case BasicShapeCircleClass: |
| 106 return compareCSSValues<CSSBasicShapeCircleValue>(*this, other); | 103 return compareCSSValues<CSSBasicShapeCircleValue>(*this, other); |
| 107 case BasicShapeEllipseClass: | 104 case BasicShapeEllipseClass: |
| 108 return compareCSSValues<CSSBasicShapeEllipseValue>(*this, other); | 105 return compareCSSValues<CSSBasicShapeEllipseValue>(*this, other); |
| 109 case BasicShapePolygonClass: | 106 case BasicShapePolygonClass: |
| 110 return compareCSSValues<CSSBasicShapePolygonValue>(*this, other); | 107 return compareCSSValues<CSSBasicShapePolygonValue>(*this, other); |
| 111 case BasicShapeInsetClass: | 108 case BasicShapeInsetClass: |
| 112 return compareCSSValues<CSSBasicShapeInsetValue>(*this, other); | 109 return compareCSSValues<CSSBasicShapeInsetValue>(*this, other); |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 toCSSCustomPropertyDeclaration(this)->traceAfterDispatch(visitor); | 532 toCSSCustomPropertyDeclaration(this)->traceAfterDispatch(visitor); |
| 536 return; | 533 return; |
| 537 case PendingSubstitutionValueClass: | 534 case PendingSubstitutionValueClass: |
| 538 toCSSPendingSubstitutionValue(this)->traceAfterDispatch(visitor); | 535 toCSSPendingSubstitutionValue(this)->traceAfterDispatch(visitor); |
| 539 return; | 536 return; |
| 540 } | 537 } |
| 541 ASSERT_NOT_REACHED(); | 538 ASSERT_NOT_REACHED(); |
| 542 } | 539 } |
| 543 | 540 |
| 544 } // namespace blink | 541 } // namespace blink |
| OLD | NEW |