Changeset 142444 in webkit
- Timestamp:
- Feb 11, 2013 3:00:54 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 69 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r142442 r142444 1 2013-02-11 Alexander Shalamov <alexander.shalamov@intel.com> 2 3 Implement CSSValue::equals(const CSSValue&) to optimise CSSValue comparison 4 https://bugs.webkit.org/show_bug.cgi?id=102901 5 6 Reviewed by Antti Koivisto. 7 8 New layout test to verify that CSSValue objects comparison works properly. 9 10 * cssom/cssvalue-comparison-expected.txt: Added. 11 * cssom/cssvalue-comparison.html: Added. 12 1 13 2013-02-11 Kentaro Hara <haraken@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r142443 r142444 1 2013-02-11 Alexander Shalamov <alexander.shalamov@intel.com> 2 3 Implement CSSValue::equals(const CSSValue&) to optimise CSSValue comparison 4 https://bugs.webkit.org/show_bug.cgi?id=102901 5 6 Reviewed by Antti Koivisto. 7 8 Added comparison method to CSSValue and its children, so that the 9 css values could be compared efficiently. Before this patch, CSSValue 10 objects were compared using strings that were generated by the cssText() method. 11 12 Test: cssom/cssvalue-comparison.html 13 14 * css/CSSAspectRatioValue.cpp: 15 (WebCore::CSSAspectRatioValue::equals): 16 (WebCore): 17 * css/CSSAspectRatioValue.h: 18 (CSSAspectRatioValue): 19 * css/CSSBasicShapes.cpp: 20 (WebCore::CSSBasicShapeRectangle::equals): 21 (WebCore): 22 (WebCore::CSSBasicShapeCircle::equals): 23 (WebCore::CSSBasicShapeEllipse::equals): 24 (WebCore::CSSBasicShapePolygon::equals): 25 * css/CSSBasicShapes.h: 26 (CSSBasicShapeRectangle): 27 (CSSBasicShapeCircle): 28 (CSSBasicShapeEllipse): 29 (CSSBasicShapePolygon): 30 * css/CSSBorderImageSliceValue.cpp: 31 (WebCore::CSSBorderImageSliceValue::equals): 32 (WebCore): 33 * css/CSSBorderImageSliceValue.h: 34 (CSSBorderImageSliceValue): 35 * css/CSSCalculationValue.cpp: 36 (WebCore::CSSCalcValue::equals): 37 (WebCore): 38 (WebCore::CSSCalcPrimitiveValue::equals): 39 (CSSCalcPrimitiveValue): 40 (WebCore::CSSCalcPrimitiveValue::type): 41 (WebCore::CSSCalcBinaryOperation::equals): 42 (CSSCalcBinaryOperation): 43 (WebCore::CSSCalcBinaryOperation::type): 44 * css/CSSCalculationValue.h: 45 (WebCore::CSSCalcExpressionNode::equals): 46 (CSSCalcExpressionNode): 47 (CSSCalcValue): 48 * css/CSSCanvasValue.cpp: 49 (WebCore::CSSCanvasValue::equals): 50 (WebCore): 51 * css/CSSCanvasValue.h: 52 (CSSCanvasValue): 53 * css/CSSComputedStyleDeclaration.cpp: 54 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 55 (WebCore::CSSComputedStyleDeclaration::cssPropertyMatches): 56 (WebCore::CSSComputedStyleDeclaration::getCSSPropertyValuesForSidesShorthand): 57 * css/CSSCrossfadeValue.cpp: 58 (WebCore::CSSCrossfadeValue::equals): 59 (WebCore): 60 * css/CSSCrossfadeValue.h: 61 (CSSCrossfadeValue): 62 * css/CSSCursorImageValue.cpp: 63 (WebCore::CSSCursorImageValue::equals): 64 (WebCore): 65 * css/CSSCursorImageValue.h: 66 (CSSCursorImageValue): 67 * css/CSSFontFaceSrcValue.cpp: 68 (WebCore::CSSFontFaceSrcValue::equals): 69 (WebCore): 70 * css/CSSFontFaceSrcValue.h: 71 (CSSFontFaceSrcValue): 72 * css/CSSFunctionValue.cpp: 73 (WebCore::CSSFunctionValue::equals): 74 (WebCore): 75 * css/CSSFunctionValue.h: 76 (CSSFunctionValue): 77 * css/CSSGradientValue.cpp: 78 (WebCore::CSSLinearGradientValue::equals): 79 (WebCore): 80 (WebCore::CSSRadialGradientValue::equals): 81 * css/CSSGradientValue.h: 82 (WebCore::CSSGradientColorStop::operator==): 83 (CSSLinearGradientValue): 84 (CSSRadialGradientValue): 85 * css/CSSImageValue.cpp: 86 (WebCore::CSSImageValue::equals): 87 (WebCore): 88 * css/CSSImageValue.h: 89 (CSSImageValue): 90 * css/CSSInheritedValue.h: 91 (WebCore::CSSInheritedValue::equals): 92 (CSSInheritedValue): 93 * css/CSSInitialValue.h: 94 (WebCore::CSSInitialValue::equals): 95 (CSSInitialValue): 96 * css/CSSLineBoxContainValue.h: 97 (WebCore::CSSLineBoxContainValue::equals): 98 * css/CSSPrimitiveValue.cpp: 99 (WebCore::CSSPrimitiveValue::equals): 100 (WebCore): 101 * css/CSSPrimitiveValue.h: 102 (CSSPrimitiveValue): 103 * css/CSSReflectValue.cpp: 104 (WebCore::CSSReflectValue::equals): 105 (WebCore): 106 * css/CSSReflectValue.h: 107 (CSSReflectValue): 108 * css/CSSTimingFunctionValue.cpp: 109 (WebCore::CSSCubicBezierTimingFunctionValue::equals): 110 (WebCore): 111 (WebCore::CSSStepsTimingFunctionValue::equals): 112 * css/CSSTimingFunctionValue.h: 113 (WebCore::CSSLinearTimingFunctionValue::equals): 114 (CSSLinearTimingFunctionValue): 115 (CSSCubicBezierTimingFunctionValue): 116 (CSSStepsTimingFunctionValue): 117 * css/CSSUnicodeRangeValue.cpp: 118 (WebCore::CSSUnicodeRangeValue::equals): 119 (WebCore): 120 * css/CSSUnicodeRangeValue.h: 121 (CSSUnicodeRangeValue): 122 * css/CSSValue.cpp: 123 (WebCore): 124 (WebCore::compareCSSValues): 125 (WebCore::CSSValue::equals): 126 * css/CSSValue.h: 127 (CSSValue): 128 (WebCore): 129 (WebCore::compareCSSValueVector): 130 (WebCore::compareCSSValuePtr): 131 * css/CSSValueList.cpp: 132 (WebCore::CSSValueList::removeAll): 133 (WebCore::CSSValueList::hasValue): 134 (WebCore::CSSValueList::equals): 135 (WebCore): 136 * css/CSSValueList.h: 137 (CSSValueList): 138 * css/CSSVariableValue.h: 139 (WebCore::CSSVariableValue::equals): 140 (CSSVariableValue): 141 * css/Counter.h: 142 (Counter): 143 (WebCore::Counter::equals): 144 * css/DashboardRegion.h: 145 (WebCore::DashboardRegion::equals): 146 * css/FontFeatureValue.cpp: 147 (WebCore::FontFeatureValue::equals): 148 (WebCore): 149 * css/FontFeatureValue.h: 150 (FontFeatureValue): 151 * css/FontValue.cpp: 152 (WebCore::FontValue::equals): 153 (WebCore): 154 * css/FontValue.h: 155 (FontValue): 156 * css/MediaQueryExp.h: 157 (WebCore::MediaQueryExp::operator==): 158 * css/Pair.h: 159 (WebCore::Pair::equals): 160 (Pair): 161 * css/Rect.h: 162 (WebCore::RectBase::equals): 163 (RectBase): 164 * css/ShadowValue.cpp: 165 (WebCore::ShadowValue::equals): 166 (WebCore): 167 * css/ShadowValue.h: 168 (ShadowValue): 169 * css/StylePropertySet.cpp: 170 (WebCore::StylePropertySet::get4Values): 171 (WebCore::StylePropertySet::propertyMatches): 172 * css/WebKitCSSArrayFunctionValue.cpp: 173 (WebCore::WebKitCSSArrayFunctionValue::equals): 174 (WebCore): 175 * css/WebKitCSSArrayFunctionValue.h: 176 (WebKitCSSArrayFunctionValue): 177 * css/WebKitCSSFilterValue.cpp: 178 (WebCore::WebKitCSSFilterValue::equals): 179 (WebCore): 180 * css/WebKitCSSFilterValue.h: 181 (WebKitCSSFilterValue): 182 * css/WebKitCSSMixFunctionValue.cpp: 183 (WebCore::WebKitCSSMixFunctionValue::equals): 184 (WebCore): 185 * css/WebKitCSSMixFunctionValue.h: 186 (WebKitCSSMixFunctionValue): 187 * css/WebKitCSSSVGDocumentValue.cpp: 188 (WebCore::WebKitCSSSVGDocumentValue::equals): 189 (WebCore): 190 * css/WebKitCSSSVGDocumentValue.h: 191 (WebKitCSSSVGDocumentValue): 192 * css/WebKitCSSShaderValue.cpp: 193 (WebCore::WebKitCSSShaderValue::equals): 194 (WebCore): 195 * css/WebKitCSSShaderValue.h: 196 (WebKitCSSShaderValue): 197 * css/WebKitCSSTransformValue.h: 198 (WebCore::WebKitCSSTransformValue::equals): 199 * editing/EditingStyle.cpp: 200 (WebCore::HTMLAttributeEquivalent::valueIsPresentInStyle): 201 * svg/SVGColor.cpp: 202 (WebCore::SVGColor::equals): 203 (WebCore): 204 * svg/SVGColor.h: 205 (SVGColor): 206 * svg/SVGPaint.cpp: 207 (WebCore::SVGPaint::equals): 208 (WebCore): 209 * svg/SVGPaint.h: 210 (SVGPaint): 211 1 212 2013-02-11 Pan Deng <pan.deng@intel.com> 2 213 -
trunk/Source/WebCore/css/CSSAspectRatioValue.cpp
r128204 r142444 40 40 } 41 41 42 bool CSSAspectRatioValue::equals(const CSSAspectRatioValue& other) const 43 { 44 return m_numeratorValue == other.m_numeratorValue && m_denominatorValue == other.m_denominatorValue; 45 } 46 42 47 void CSSAspectRatioValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 43 48 { -
trunk/Source/WebCore/css/CSSAspectRatioValue.h
r124768 r142444 47 47 float denominatorValue() const { return m_denominatorValue; } 48 48 49 bool equals(const CSSAspectRatioValue&) const; 50 49 51 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 50 52 -
trunk/Source/WebCore/css/CSSBasicShapes.cpp
r129831 r142444 31 31 32 32 #include "CSSBasicShapes.h" 33 #include "CSSPrimitiveValueMappings.h" 33 34 34 35 #include <wtf/text/StringBuilder.h> … … 75 76 } 76 77 78 bool CSSBasicShapeRectangle::equals(const CSSBasicShape& shape) const 79 { 80 if (shape.type() != CSS_BASIC_SHAPE_RECTANGLE) 81 return false; 82 83 const CSSBasicShapeRectangle& other = static_cast<const CSSBasicShapeRectangle&>(shape); 84 return compareCSSValuePtr(m_x, other.m_x) 85 && compareCSSValuePtr(m_y, other.m_y) 86 && compareCSSValuePtr(m_width, other.m_width) 87 && compareCSSValuePtr(m_height, other.m_height) 88 && compareCSSValuePtr(m_radiusX, other.m_radiusX) 89 && compareCSSValuePtr(m_radiusY, other.m_radiusY); 90 } 91 77 92 #if ENABLE(CSS_VARIABLES) 78 93 String CSSBasicShapeRectangle::serializeResolvingVariables(const HashMap<AtomicString, String>& variables) const … … 107 122 } 108 123 124 bool CSSBasicShapeCircle::equals(const CSSBasicShape& shape) const 125 { 126 if (shape.type() != CSS_BASIC_SHAPE_CIRCLE) 127 return false; 128 129 const CSSBasicShapeCircle& other = static_cast<const CSSBasicShapeCircle&>(shape); 130 return compareCSSValuePtr(m_centerX, other.m_centerX) 131 && compareCSSValuePtr(m_centerY, other.m_centerY) 132 && compareCSSValuePtr(m_radius, other.m_radius); 133 } 134 109 135 #if ENABLE(CSS_VARIABLES) 110 136 String CSSBasicShapeCircle::serializeResolvingVariables(const HashMap<AtomicString, String>& variables) const … … 131 157 { 132 158 return buildEllipseString(m_centerX->cssText(), m_centerY->cssText(), m_radiusX->cssText(), m_radiusY->cssText()); 159 } 160 161 bool CSSBasicShapeEllipse::equals(const CSSBasicShape& shape) const 162 { 163 if (shape.type() != CSS_BASIC_SHAPE_ELLIPSE) 164 return false; 165 166 const CSSBasicShapeEllipse& other = static_cast<const CSSBasicShapeEllipse&>(shape); 167 return compareCSSValuePtr(m_centerX, other.m_centerX) 168 && compareCSSValuePtr(m_centerY, other.m_centerY) 169 && compareCSSValuePtr(m_radiusX, other.m_radiusX) 170 && compareCSSValuePtr(m_radiusY, other.m_radiusY); 133 171 } 134 172 … … 200 238 } 201 239 240 bool CSSBasicShapePolygon::equals(const CSSBasicShape& shape) const 241 { 242 if (shape.type() != CSS_BASIC_SHAPE_POLYGON) 243 return false; 244 245 const CSSBasicShapePolygon& rhs = static_cast<const CSSBasicShapePolygon&>(shape); 246 return compareCSSValueVector<CSSPrimitiveValue>(m_values, rhs.m_values); 247 } 248 202 249 #if ENABLE(CSS_VARIABLES) 203 250 String CSSBasicShapePolygon::serializeResolvingVariables(const HashMap<AtomicString, String>& variables) const -
trunk/Source/WebCore/css/CSSBasicShapes.h
r129579 r142444 50 50 virtual Type type() const = 0; 51 51 virtual String cssText() const = 0; 52 virtual bool equals(const CSSBasicShape&) const = 0; 52 53 53 54 #if ENABLE(CSS_VARIABLES) … … 83 84 virtual Type type() const { return CSS_BASIC_SHAPE_RECTANGLE; } 84 85 virtual String cssText() const; 86 virtual bool equals(const CSSBasicShape&) const; 85 87 86 88 #if ENABLE(CSS_VARIABLES) … … 114 116 virtual Type type() const { return CSS_BASIC_SHAPE_CIRCLE; } 115 117 virtual String cssText() const; 118 virtual bool equals(const CSSBasicShape&) const; 116 119 117 120 #if ENABLE(CSS_VARIABLES) … … 144 147 virtual Type type() const { return CSS_BASIC_SHAPE_ELLIPSE; } 145 148 virtual String cssText() const; 149 virtual bool equals(const CSSBasicShape&) const; 146 150 147 151 #if ENABLE(CSS_VARIABLES) … … 178 182 virtual Type type() const { return CSS_BASIC_SHAPE_POLYGON; } 179 183 virtual String cssText() const; 180 184 virtual bool equals(const CSSBasicShape&) const; 181 185 #if ENABLE(CSS_VARIABLES) 182 186 virtual String serializeResolvingVariables(const HashMap<AtomicString, String>&) const; -
trunk/Source/WebCore/css/CSSBorderImageSliceValue.cpp
r141570 r142444 51 51 } 52 52 53 bool CSSBorderImageSliceValue::equals(const CSSBorderImageSliceValue& other) const 54 { 55 return m_fill == other.m_fill && compareCSSValuePtr(m_slices, other.m_slices); 56 } 57 53 58 void CSSBorderImageSliceValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 54 59 { -
trunk/Source/WebCore/css/CSSBorderImageSliceValue.h
r124768 r142444 46 46 Quad* slices() { return m_slices ? m_slices->getQuadValue() : 0; } 47 47 48 bool equals(const CSSBorderImageSliceValue&) const; 49 48 50 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 49 51 -
trunk/Source/WebCore/css/CSSCalculationValue.cpp
r142434 r142444 96 96 } 97 97 98 bool CSSCalcValue::equals(const CSSCalcValue& other) const 99 { 100 return compareCSSValuePtr(m_expression, other.m_expression); 101 } 102 98 103 #if ENABLE(CSS_VARIABLES) 99 104 String CSSCalcValue::customSerializeResolvingVariables(const HashMap<AtomicString, String>& variables) const … … 224 229 } 225 230 231 virtual bool equals(const CSSCalcExpressionNode& other) const 232 { 233 if (type() != other.type()) 234 return false; 235 236 return compareCSSValuePtr(m_value, static_cast<const CSSCalcPrimitiveValue&>(other).m_value); 237 } 238 226 239 virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const OVERRIDE 227 240 { … … 229 242 info.addMember(m_value, "value"); 230 243 } 244 245 virtual Type type() const { return CssCalcPrimitiveValue; } 231 246 232 247 private: … … 360 375 #endif 361 376 377 virtual bool equals(const CSSCalcExpressionNode& exp) const 378 { 379 if (type() != exp.type()) 380 return false; 381 382 const CSSCalcBinaryOperation& other = static_cast<const CSSCalcBinaryOperation&>(exp); 383 return compareCSSValuePtr(m_leftSide, other.m_leftSide) 384 && compareCSSValuePtr(m_rightSide, other.m_rightSide) 385 && m_operator == other.m_operator; 386 } 387 388 virtual Type type() const { return CssCalcBinaryOperation; } 389 362 390 private: 363 391 CSSCalcBinaryOperation(PassRefPtr<CSSCalcExpressionNode> leftSide, PassRefPtr<CSSCalcExpressionNode> rightSide, CalcOperator op, CalculationCategory category) -
trunk/Source/WebCore/css/CSSCalculationValue.h
r131826 r142444 61 61 class CSSCalcExpressionNode : public RefCounted<CSSCalcExpressionNode> { 62 62 public: 63 63 enum Type { 64 CssCalcPrimitiveValue = 1, 65 CssCalcBinaryOperation 66 }; 67 64 68 virtual ~CSSCalcExpressionNode() = 0; 65 69 virtual bool isZero() const = 0; … … 72 76 virtual bool hasVariableReference() const = 0; 73 77 #endif 78 virtual bool equals(const CSSCalcExpressionNode& other) const { return m_category == other.m_category && m_isInteger == other.m_isInteger; } 79 virtual void reportMemoryUsage(MemoryObjectInfo*) const = 0; 80 virtual Type type() const = 0; 74 81 75 virtual void reportMemoryUsage(MemoryObjectInfo*) const = 0;76 77 82 CalculationCategory category() const { return m_category; } 78 83 bool isInteger() const { return m_isInteger; } … … 105 110 106 111 String customCssText() const; 112 bool equals(const CSSCalcValue&) const; 107 113 #if ENABLE(CSS_VARIABLES) 108 114 String customSerializeResolvingVariables(const HashMap<AtomicString, String>&) const; -
trunk/Source/WebCore/css/CSSCanvasValue.cpp
r141570 r142444 97 97 } 98 98 99 bool CSSCanvasValue::equals(const CSSCanvasValue& other) const 100 { 101 return m_name == other.m_name; 102 } 103 99 104 void CSSCanvasValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 100 105 { -
trunk/Source/WebCore/css/CSSCanvasValue.h
r124768 r142444 47 47 bool isPending() const { return false; } 48 48 void loadSubimages(CachedResourceLoader*) { } 49 50 bool equals(const CSSCanvasValue&) const; 49 51 50 52 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r142215 r142444 2649 2649 CSSPropertyBorderLeft }; 2650 2650 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { 2651 if ( value->cssText() != getPropertyCSSValue(properties[i], DoNotUpdateLayout)->cssText())2651 if (!compareCSSValuePtr<CSSValue>(value, getPropertyCSSValue(properties[i], DoNotUpdateLayout))) 2652 2652 return 0; 2653 2653 } … … 2873 2873 } 2874 2874 RefPtr<CSSValue> value = getPropertyCSSValue(property.id()); 2875 return value && value->cssText() == property.value()->cssText();2875 return value && property.value() && value->equals(*property.value()); 2876 2876 } 2877 2877 … … 2909 2909 return 0; 2910 2910 2911 bool showLeft = rightValue->cssText() != leftValue->cssText();2912 bool showBottom = (topValue->cssText() != bottomValue->cssText()) || showLeft;2913 bool showRight = (topValue->cssText() != rightValue->cssText()) || showBottom;2911 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); 2912 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; 2913 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; 2914 2914 2915 2915 list->append(topValue); -
trunk/Source/WebCore/css/CSSCrossfadeValue.cpp
r141637 r142444 230 230 } 231 231 232 bool CSSCrossfadeValue::equals(const CSSCrossfadeValue& other) const 233 { 234 return compareCSSValuePtr(m_fromValue, other.m_fromValue) 235 && compareCSSValuePtr(m_toValue, other.m_toValue) 236 && compareCSSValuePtr(m_percentageValue, other.m_percentageValue); 237 } 238 232 239 } // namespace WebCore -
trunk/Source/WebCore/css/CSSCrossfadeValue.h
r141637 r142444 67 67 bool hasFailedOrCanceledSubresources() const; 68 68 69 bool equals(const CSSCrossfadeValue&) const; 70 69 71 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 70 72 -
trunk/Source/WebCore/css/CSSCursorImageValue.cpp
r141570 r142444 218 218 #endif 219 219 220 bool CSSCursorImageValue::equals(const CSSCursorImageValue& other) const 221 { 222 return m_hasHotSpot ? other.m_hasHotSpot && m_hotSpot == other.m_hotSpot : !other.m_hasHotSpot 223 && compareCSSValuePtr(m_imageValue, other.m_imageValue); 224 } 225 220 226 void CSSCursorImageValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 221 227 { -
trunk/Source/WebCore/css/CSSCursorImageValue.h
r136919 r142444 60 60 #endif 61 61 62 bool equals(const CSSCursorImageValue&) const; 63 62 64 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 63 65 -
trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp
r141570 r142444 105 105 } 106 106 107 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const 108 { 109 return m_isLocal == other.m_isLocal && m_format == other.m_format && m_resource == other.m_resource; 110 } 111 107 112 void CSSFontFaceSrcValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 108 113 { -
trunk/Source/WebCore/css/CSSFontFaceSrcValue.h
r127757 r142444 72 72 CachedFont* cachedFont(Document*); 73 73 74 bool equals(const CSSFontFaceSrcValue&) const; 75 74 76 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 75 77 -
trunk/Source/WebCore/css/CSSFunctionValue.cpp
r141570 r142444 60 60 } 61 61 62 bool CSSFunctionValue::equals(const CSSFunctionValue& other) const 63 { 64 return m_name == other.m_name && compareCSSValuePtr(m_args, other.m_args); 65 } 66 62 67 void CSSFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 63 68 { -
trunk/Source/WebCore/css/CSSFunctionValue.h
r136588 r142444 48 48 String customCssText() const; 49 49 50 bool equals(const CSSFunctionValue&) const; 51 50 52 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 51 53 -
trunk/Source/WebCore/css/CSSGradientValue.cpp
r141637 r142444 724 724 } 725 725 726 bool CSSLinearGradientValue::equals(const CSSLinearGradientValue& other) const 727 { 728 if (m_gradientType == CSSDeprecatedLinearGradient) 729 return other.m_gradientType == m_gradientType 730 && compareCSSValuePtr(m_firstX, other.m_firstX) 731 && compareCSSValuePtr(m_firstY, other.m_firstY) 732 && compareCSSValuePtr(m_secondX, other.m_secondX) 733 && compareCSSValuePtr(m_secondY, other.m_secondY) 734 && m_stops == other.m_stops; 735 736 if (m_repeating != other.m_repeating) 737 return false; 738 739 if (m_angle) 740 return compareCSSValuePtr(m_angle, other.m_angle) && m_stops == other.m_stops; 741 742 if (other.m_angle) 743 return false; 744 745 bool equalXorY = false; 746 if (m_firstX && m_firstY) 747 equalXorY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY); 748 else if (m_firstX) 749 equalXorY =compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY; 750 else if (m_firstY) 751 equalXorY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX; 752 else 753 equalXorY = !other.m_firstX || !other.m_firstY; 754 755 return equalXorY && m_stops == other.m_stops; 756 } 757 726 758 void CSSLinearGradientValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 727 759 { … … 1113 1145 } 1114 1146 1147 bool CSSRadialGradientValue::equals(const CSSRadialGradientValue& other) const 1148 { 1149 if (m_gradientType == CSSDeprecatedRadialGradient) 1150 return other.m_gradientType == m_gradientType 1151 && compareCSSValuePtr(m_firstX, other.m_firstX) 1152 && compareCSSValuePtr(m_firstY, other.m_firstY) 1153 && compareCSSValuePtr(m_secondX, other.m_secondX) 1154 && compareCSSValuePtr(m_secondY, other.m_secondY) 1155 && compareCSSValuePtr(m_firstRadius, other.m_firstRadius) 1156 && compareCSSValuePtr(m_secondRadius, other.m_secondRadius) 1157 && m_stops == other.m_stops; 1158 1159 if (m_repeating != other.m_repeating) 1160 return false; 1161 1162 bool equalXorY = false; 1163 if (m_firstX && m_firstY) 1164 equalXorY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY); 1165 else if (m_firstX) 1166 equalXorY = compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY; 1167 else if (m_firstY) 1168 equalXorY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX; 1169 else 1170 equalXorY == !other.m_firstX || !other.m_firstY; 1171 1172 if (!equalXorY) 1173 return false; 1174 1175 bool equalShape = true; 1176 bool equalSizingBehavior = true; 1177 bool equalHorizontalAndVerticalSize = true; 1178 1179 if (m_shape) 1180 equalShape = compareCSSValuePtr(m_shape, other.m_shape); 1181 else if (m_sizingBehavior) 1182 equalSizingBehavior = compareCSSValuePtr(m_sizingBehavior, other.m_sizingBehavior); 1183 else if (m_endHorizontalSize && m_endVerticalSize) 1184 equalHorizontalAndVerticalSize = compareCSSValuePtr(m_endHorizontalSize, other.m_endHorizontalSize) && compareCSSValuePtr(m_endVerticalSize, other.m_endVerticalSize); 1185 else { 1186 equalShape = !other.m_shape; 1187 equalSizingBehavior = !other.m_sizingBehavior; 1188 equalHorizontalAndVerticalSize = !other.m_endHorizontalSize && !other.m_endVerticalSize; 1189 } 1190 return equalShape && equalSizingBehavior && equalHorizontalAndVerticalSize && m_stops == other.m_stops; 1191 } 1192 1115 1193 void CSSRadialGradientValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 1116 1194 { -
trunk/Source/WebCore/css/CSSGradientValue.h
r141637 r142444 54 54 bool m_colorIsDerivedFromElement; 55 55 void reportMemoryUsage(MemoryObjectInfo*) const; 56 bool operator==(const CSSGradientColorStop& other) const 57 { 58 return compareCSSValuePtr(m_color, other.m_color) 59 && compareCSSValuePtr(m_position, other.m_position); 60 } 56 61 }; 57 62 … … 153 158 } 154 159 160 bool equals(const CSSLinearGradientValue&) const; 161 155 162 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 156 163 … … 195 202 // Create the gradient for a given size. 196 203 PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&); 204 205 bool equals(const CSSRadialGradientValue&) const; 197 206 198 207 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; -
trunk/Source/WebCore/css/CSSImageValue.cpp
r141637 r142444 94 94 } 95 95 96 bool CSSImageValue::equals(const CSSImageValue& other) const 97 { 98 return m_url == other.m_url; 99 } 100 96 101 String CSSImageValue::customCssText() const 97 102 { -
trunk/Source/WebCore/css/CSSImageValue.h
r141637 r142444 51 51 bool hasFailedOrCanceledSubresources() const; 52 52 53 bool equals(const CSSImageValue&) const; 54 53 55 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 54 56 -
trunk/Source/WebCore/css/CSSInheritedValue.h
r124768 r142444 36 36 String customCssText() const; 37 37 38 bool equals(const CSSInheritedValue&) const { return true; } 39 38 40 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 39 41 -
trunk/Source/WebCore/css/CSSInitialValue.h
r124768 r142444 42 42 bool isImplicit() const { return m_isImplicit; } 43 43 44 bool equals(const CSSInitialValue&) const { return true; } 45 44 46 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 45 47 -
trunk/Source/WebCore/css/CSSLineBoxContainValue.h
r124768 r142444 48 48 49 49 String customCssText() const; 50 50 bool equals(const CSSLineBoxContainValue& other) const { return m_value == other.m_value; } 51 51 LineBoxContain value() const { return m_value; } 52 52 -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r142021 r142444 1275 1275 } 1276 1276 1277 bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const 1278 { 1279 if (m_primitiveUnitType != other.m_primitiveUnitType) 1280 return false; 1281 1282 switch (m_primitiveUnitType) { 1283 case CSS_UNKNOWN: 1284 return false; 1285 case CSS_NUMBER: 1286 case CSS_PARSER_INTEGER: 1287 case CSS_PERCENTAGE: 1288 case CSS_EMS: 1289 case CSS_EXS: 1290 case CSS_REMS: 1291 case CSS_PX: 1292 case CSS_CM: 1293 #if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY) 1294 case CSS_DPPX: 1295 case CSS_DPI: 1296 case CSS_DPCM: 1297 #endif 1298 case CSS_MM: 1299 case CSS_IN: 1300 case CSS_PT: 1301 case CSS_PC: 1302 case CSS_DEG: 1303 case CSS_RAD: 1304 case CSS_GRAD: 1305 case CSS_MS: 1306 case CSS_S: 1307 case CSS_HZ: 1308 case CSS_KHZ: 1309 case CSS_TURN: 1310 case CSS_VW: 1311 case CSS_VH: 1312 case CSS_VMIN: 1313 case CSS_DIMENSION: 1314 return m_value.num == other.m_value.num; 1315 case CSS_IDENT: 1316 return valueOrPropertyName(m_value.ident) == valueOrPropertyName(other.m_value.ident); 1317 case CSS_STRING: 1318 case CSS_URI: 1319 case CSS_ATTR: 1320 case CSS_COUNTER_NAME: 1321 case CSS_PARSER_IDENTIFIER: 1322 case CSS_PARSER_HEXCOLOR: 1323 #if ENABLE(CSS_VARIABLES) 1324 case CSS_VARIABLE_NAME: 1325 #endif 1326 return equal(m_value.string, other.m_value.string); 1327 case CSS_COUNTER: 1328 return m_value.counter && other.m_value.counter && m_value.counter->equals(*other.m_value.counter); 1329 case CSS_RECT: 1330 return m_value.rect && other.m_value.rect && m_value.rect->equals(*other.m_value.rect); 1331 case CSS_QUAD: 1332 return m_value.quad && other.m_value.quad && m_value.quad->equals(*other.m_value.quad); 1333 case CSS_RGBCOLOR: 1334 return m_value.rgbcolor == other.m_value.rgbcolor; 1335 case CSS_PAIR: 1336 return m_value.pair && other.m_value.pair && m_value.pair->equals(*other.m_value.pair); 1337 #if ENABLE(DASHBOARD_SUPPORT) 1338 case CSS_DASHBOARD_REGION: { 1339 DashboardRegion* region = getDashboardRegionValue(); 1340 DashboardRegion* otherRegion = other.getDashboardRegionValue(); 1341 return region ? otherRegion && region->equals(*otherRegion) : !otherRegion; 1342 } 1343 #endif 1344 case CSS_PARSER_OPERATOR: 1345 return m_value.ident == other.m_value.ident; 1346 case CSS_CALC: 1347 return m_value.calc && other.m_value.calc && m_value.calc->equals(*other.m_value.calc); 1348 case CSS_SHAPE: 1349 return m_value.shape && other.m_value.shape && m_value.shape->equals(*other.m_value.shape); 1350 } 1351 return false; 1352 } 1353 1277 1354 void CSSPrimitiveValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 1278 1355 { -
trunk/Source/WebCore/css/CSSPrimitiveValue.h
r142021 r142444 317 317 void setCSSOMSafe() { m_isCSSOMSafe = true; } 318 318 319 bool equals(const CSSPrimitiveValue&) const; 320 319 321 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 320 322 -
trunk/Source/WebCore/css/CSSReflectValue.cpp
r141570 r142444 57 57 } 58 58 59 bool CSSReflectValue::equals(const CSSReflectValue& other) const 60 { 61 return m_direction == other.m_direction 62 && compareCSSValuePtr(m_offset, other.m_offset) 63 && compareCSSValuePtr(m_mask, other.m_mask); 64 } 65 59 66 void CSSReflectValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 60 67 { -
trunk/Source/WebCore/css/CSSReflectValue.h
r140642 r142444 55 55 void addSubresourceStyleURLs(ListHashSet<KURL>&, const StyleSheetContents*) const; 56 56 57 bool equals(const CSSReflectValue&) const; 58 57 59 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 58 60 -
trunk/Source/WebCore/css/CSSTimingFunctionValue.cpp
r127869 r142444 51 51 } 52 52 53 bool CSSCubicBezierTimingFunctionValue::equals(const CSSCubicBezierTimingFunctionValue& other) const 54 { 55 return m_x1 == other.m_x1 && m_x2 == other.m_x2 && m_y1 == other.m_y1 && m_y2 == other.m_y2; 56 } 57 58 53 59 void CSSCubicBezierTimingFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 54 60 { … … 61 67 } 62 68 69 bool CSSStepsTimingFunctionValue::equals(const CSSStepsTimingFunctionValue& other) const 70 { 71 return m_steps == other.m_steps && m_stepAtStart == other.m_stepAtStart; 72 } 73 74 63 75 void CSSStepsTimingFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 64 76 { -
trunk/Source/WebCore/css/CSSTimingFunctionValue.h
r124768 r142444 41 41 String customCssText() const; 42 42 43 bool equals(const CSSLinearTimingFunctionValue&) const { return true; } 44 43 45 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 44 46 … … 63 65 double x2() const { return m_x2; } 64 66 double y2() const { return m_y2; } 67 68 bool equals(const CSSCubicBezierTimingFunctionValue&) const; 65 69 66 70 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; … … 94 98 String customCssText() const; 95 99 100 bool equals(const CSSStepsTimingFunctionValue&) const; 101 96 102 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 97 103 -
trunk/Source/WebCore/css/CSSUnicodeRangeValue.cpp
r127869 r142444 39 39 } 40 40 41 bool CSSUnicodeRangeValue::equals(const CSSUnicodeRangeValue& other) const 42 { 43 return m_from == other.m_from && m_to == other.m_to; 44 } 45 41 46 void CSSUnicodeRangeValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 42 47 { -
trunk/Source/WebCore/css/CSSUnicodeRangeValue.h
r124768 r142444 45 45 String customCssText() const; 46 46 47 bool equals(const CSSUnicodeRangeValue&) const; 48 47 49 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 48 50 -
trunk/Source/WebCore/css/CSSValue.cpp
r141570 r142444 74 74 75 75 COMPILE_ASSERT(sizeof(CSSValue) == sizeof(SameSizeAsCSSValue), CSS_value_should_stay_small); 76 76 77 77 class TextCloneCSSValue : public CSSValue { 78 78 public: … … 275 275 } 276 276 ASSERT_NOT_REACHED(); 277 } 278 279 template<class ChildClassType> 280 inline static bool compareCSSValues(const CSSValue& first, const CSSValue& second) 281 { 282 return static_cast<const ChildClassType&>(first).equals(static_cast<const ChildClassType&>(second)); 283 } 284 285 bool CSSValue::equals(const CSSValue& other) const 286 { 287 if (m_isTextClone) { 288 ASSERT(isCSSOMSafe()); 289 return static_cast<const TextCloneCSSValue*>(this)->cssText() == other.cssText(); 290 } 291 292 if (m_classType == other.m_classType) { 293 switch (m_classType) { 294 case AspectRatioClass: 295 return compareCSSValues<CSSAspectRatioValue>(*this, other); 296 case BorderImageSliceClass: 297 return compareCSSValues<CSSBorderImageSliceValue>(*this, other); 298 case CanvasClass: 299 return compareCSSValues<CSSCanvasValue>(*this, other); 300 case CursorImageClass: 301 return compareCSSValues<CSSCursorImageValue>(*this, other); 302 case FontClass: 303 return compareCSSValues<FontValue>(*this, other); 304 case FontFaceSrcClass: 305 return compareCSSValues<CSSFontFaceSrcValue>(*this, other); 306 case FontFeatureClass: 307 return compareCSSValues<FontFeatureValue>(*this, other); 308 case FunctionClass: 309 return compareCSSValues<CSSFunctionValue>(*this, other); 310 case LinearGradientClass: 311 return compareCSSValues<CSSLinearGradientValue>(*this, other); 312 case RadialGradientClass: 313 return compareCSSValues<CSSRadialGradientValue>(*this, other); 314 case CrossfadeClass: 315 return compareCSSValues<CSSCrossfadeValue>(*this, other); 316 case ImageClass: 317 return compareCSSValues<CSSImageValue>(*this, other); 318 case InheritedClass: 319 return compareCSSValues<CSSInheritedValue>(*this, other); 320 case InitialClass: 321 return compareCSSValues<CSSInitialValue>(*this, other); 322 case PrimitiveClass: 323 return compareCSSValues<CSSPrimitiveValue>(*this, other); 324 case ReflectClass: 325 return compareCSSValues<CSSReflectValue>(*this, other); 326 case ShadowClass: 327 return compareCSSValues<ShadowValue>(*this, other); 328 case LinearTimingFunctionClass: 329 return compareCSSValues<CSSLinearTimingFunctionValue>(*this, other); 330 case CubicBezierTimingFunctionClass: 331 return compareCSSValues<CSSCubicBezierTimingFunctionValue>(*this, other); 332 case StepsTimingFunctionClass: 333 return compareCSSValues<CSSStepsTimingFunctionValue>(*this, other); 334 case UnicodeRangeClass: 335 return compareCSSValues<CSSUnicodeRangeValue>(*this, other); 336 case ValueListClass: 337 return compareCSSValues<CSSValueList>(*this, other); 338 case WebKitCSSTransformClass: 339 return compareCSSValues<WebKitCSSTransformValue>(*this, other); 340 case LineBoxContainClass: 341 return compareCSSValues<CSSLineBoxContainValue>(*this, other); 342 case CalculationClass: 343 return compareCSSValues<CSSCalcValue>(*this, other); 344 #if ENABLE(CSS_IMAGE_SET) 345 case ImageSetClass: 346 return compareCSSValues<CSSImageSetValue>(*this, other); 347 #endif 348 #if ENABLE(CSS_FILTERS) 349 case WebKitCSSFilterClass: 350 return compareCSSValues<WebKitCSSFilterValue>(*this, other); 351 #if ENABLE(CSS_SHADERS) 352 case WebKitCSSArrayFunctionValueClass: 353 return compareCSSValues<WebKitCSSArrayFunctionValue>(*this, other); 354 case WebKitCSSMixFunctionValueClass: 355 return compareCSSValues<WebKitCSSMixFunctionValue>(*this, other); 356 case WebKitCSSShaderClass: 357 return compareCSSValues<WebKitCSSShaderValue>(*this, other); 358 #endif 359 #endif 360 #if ENABLE(CSS_VARIABLES) 361 case VariableClass: 362 return compareCSSValues<CSSVariableValue>(*this, other); 363 #endif 364 #if ENABLE(SVG) 365 case SVGColorClass: 366 return compareCSSValues<SVGColor>(*this, other); 367 case SVGPaintClass: 368 return compareCSSValues<SVGPaint>(*this, other); 369 case WebKitCSSSVGDocumentClass: 370 return compareCSSValues<WebKitCSSSVGDocumentValue>(*this, other); 371 } 372 #endif 373 ASSERT_NOT_REACHED(); 374 } else if (m_classType == ValueListClass && other.m_classType != ValueListClass) 375 return static_cast<const CSSValueList*>(this)->equals(other); 376 else if (m_classType != ValueListClass && other.m_classType == ValueListClass) 377 return static_cast<const CSSValueList&>(other).equals(*this); 378 return false; 277 379 } 278 380 -
trunk/Source/WebCore/css/CSSValue.h
r136919 r142444 127 127 void reportMemoryUsage(MemoryObjectInfo*) const; 128 128 129 bool equals(const CSSValue&) const; 130 129 131 protected: 130 132 … … 237 239 }; 238 240 241 template<typename CSSValueType> 242 inline bool compareCSSValueVector(const Vector<RefPtr<CSSValueType> >& firstVector, const Vector<RefPtr<CSSValueType> >& secondVector) 243 { 244 size_t size = firstVector.size(); 245 if (size != secondVector.size()) 246 return false; 247 248 for (size_t i = 0; i < size; i++) { 249 const RefPtr<CSSValueType>& firstPtr = firstVector[i]; 250 const RefPtr<CSSValueType>& secondPtr = secondVector[i]; 251 if (firstPtr == secondPtr || (firstPtr && secondPtr && firstPtr->equals(*secondPtr))) 252 continue; 253 return false; 254 } 255 return true; 256 } 257 258 template<typename CSSValueType> 259 inline bool compareCSSValuePtr(const RefPtr<CSSValueType>& first, const RefPtr<CSSValueType>& second) 260 { 261 return first ? second && first->equals(*second) : !second; 262 } 263 239 264 } // namespace WebCore 240 265 -
trunk/Source/WebCore/css/CSSValueList.cpp
r141570 r142444 56 56 { 57 57 bool found = false; 58 // FIXME: we should be implementing operator== to CSSValue and its derived classes59 // to make comparison more flexible and fast.60 58 for (size_t index = 0; index < m_values.size(); index++) { 61 if (m_values.at(index)->cssText() == val->cssText()) { 59 RefPtr<CSSValue>& value = m_values.at(index); 60 if (value && val && value->equals(*val)) { 62 61 m_values.remove(index); 63 62 found = true; … … 70 69 bool CSSValueList::hasValue(CSSValue* val) const 71 70 { 72 // FIXME: we should be implementing operator== to CSSValue and its derived classes73 // to make comparison more flexible and fast.74 71 for (size_t index = 0; index < m_values.size(); index++) { 75 if (m_values.at(index)->cssText() == val->cssText()) 72 const RefPtr<CSSValue>& value = m_values.at(index); 73 if (value && val && value->equals(*val)) 76 74 return true; 77 75 } … … 128 126 } 129 127 128 bool CSSValueList::equals(const CSSValueList& other) const 129 { 130 return m_valueListSeparator == other.m_valueListSeparator && compareCSSValueVector<CSSValue>(m_values, other.m_values); 131 } 132 133 bool CSSValueList::equals(const CSSValue& other) const 134 { 135 if (m_values.size() != 1) 136 return false; 137 138 const RefPtr<CSSValue>& value = m_values[0]; 139 return value && value->equals(other); 140 } 141 130 142 #if ENABLE(CSS_VARIABLES) 131 143 String CSSValueList::customSerializeResolvingVariables(const HashMap<AtomicString, String>& variables) const -
trunk/Source/WebCore/css/CSSValueList.h
r141816 r142444 61 61 62 62 String customCssText() const; 63 bool equals(const CSSValueList&) const; 64 bool equals(const CSSValue&) const; 63 65 #if ENABLE(CSS_VARIABLES) 64 66 String customSerializeResolvingVariables(const HashMap<AtomicString, String>&) const; -
trunk/Source/WebCore/css/CSSVariableValue.h
r141570 r142444 49 49 const String& value() const { return m_value; } 50 50 51 bool equals(const CSSVariableValue& other) const { return m_name == other.m_name && m_value == other.m_value; } 52 51 53 void reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 52 54 { -
trunk/Source/WebCore/css/Counter.h
r127757 r142444 43 43 void setListStyle(PassRefPtr<CSSPrimitiveValue> listStyle) { m_listStyle = listStyle; } 44 44 void setSeparator(PassRefPtr<CSSPrimitiveValue> separator) { m_separator = separator; } 45 46 bool equals(const Counter& other) const 47 { 48 return identifier() == other.identifier() 49 && listStyle() == other.listStyle() 50 && separator() == other.separator(); 51 } 45 52 46 53 PassRefPtr<Counter> cloneForCSSOM() const -
trunk/Source/WebCore/css/DashboardRegion.h
r130829 r142444 31 31 public: 32 32 static PassRefPtr<DashboardRegion> create() { return adoptRef(new DashboardRegion); } 33 bool equals(const DashboardRegion& other) const 34 { 35 return m_label == other.m_label && m_geometryType == other.m_geometryType 36 && m_isCircle == other.m_isCircle && m_isRectangle == other.m_isRectangle 37 && m_next ? other.m_next && m_next->equals(*other.m_next) : !other.m_next; 38 } 33 39 34 40 RefPtr<DashboardRegion> m_next; -
trunk/Source/WebCore/css/FontFeatureValue.cpp
r141570 r142444 51 51 } 52 52 53 bool FontFeatureValue::equals(const FontFeatureValue& other) const 54 { 55 return m_tag == other.m_tag && m_value == other.m_value; 56 } 57 53 58 void FontFeatureValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 54 59 { -
trunk/Source/WebCore/css/FontFeatureValue.h
r127757 r142444 43 43 String customCssText() const; 44 44 45 bool equals(const FontFeatureValue&) const; 46 45 47 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 46 48 -
trunk/Source/WebCore/css/FontValue.cpp
r141570 r142444 66 66 } 67 67 68 bool FontValue::equals(const FontValue& other) const 69 { 70 return compareCSSValuePtr(style, other.style) 71 && compareCSSValuePtr(variant, other.variant) 72 && compareCSSValuePtr(weight, other.weight) 73 && compareCSSValuePtr(size, other.size) 74 && compareCSSValuePtr(lineHeight, other.lineHeight) 75 && compareCSSValuePtr(family, other.family); 76 } 77 68 78 void FontValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 69 79 { -
trunk/Source/WebCore/css/FontValue.h
r124768 r142444 40 40 String customCssText() const; 41 41 42 bool equals(const FontValue&) const; 43 42 44 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 43 45 -
trunk/Source/WebCore/css/MediaQueryExp.h
r128418 r142444 53 53 return (other.m_mediaFeature == m_mediaFeature) 54 54 && ((!other.m_value && !m_value) 55 || (other.m_value && m_value && other.m_value-> cssText() == m_value->cssText()));55 || (other.m_value && m_value && other.m_value->equals(*m_value))); 56 56 } 57 57 -
trunk/Source/WebCore/css/Pair.h
r129579 r142444 57 57 } 58 58 59 bool equals(const Pair& other) const { return compareCSSValuePtr(m_first, other.m_first) && compareCSSValuePtr(m_second, other.m_second); } 60 59 61 #if ENABLE(CSS_VARIABLES) 60 62 String serializeResolvingVariables(const HashMap<AtomicString, String>& variables) const -
trunk/Source/WebCore/css/Rect.h
r129831 r142444 39 39 void setBottom(PassRefPtr<CSSPrimitiveValue> bottom) { m_bottom = bottom; } 40 40 void setLeft(PassRefPtr<CSSPrimitiveValue> left) { m_left = left; } 41 42 bool equals(const RectBase& other) const 43 { 44 return compareCSSValuePtr(m_top, other.m_top) 45 && compareCSSValuePtr(m_right, other.m_right) 46 && compareCSSValuePtr(m_left, other.m_left) 47 && compareCSSValuePtr(m_bottom, other.m_bottom); 48 } 41 49 42 50 #if ENABLE(CSS_VARIABLES) -
trunk/Source/WebCore/css/ShadowValue.cpp
r141570 r142444 80 80 } 81 81 82 bool ShadowValue::equals(const ShadowValue& other) const 83 { 84 return compareCSSValuePtr(color, other.color) 85 && compareCSSValuePtr(x, other.x) 86 && compareCSSValuePtr(y, other.y) 87 && compareCSSValuePtr(blur, other.blur) 88 && compareCSSValuePtr(spread, other.spread) 89 && compareCSSValuePtr(style, other.style); 90 } 91 82 92 void ShadowValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 83 93 { -
trunk/Source/WebCore/css/ShadowValue.h
r124768 r142444 45 45 String customCssText() const; 46 46 47 bool equals(const ShadowValue&) const; 48 47 49 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 48 50 -
trunk/Source/WebCore/css/StylePropertySet.cpp
r141570 r142444 323 323 return String(); 324 324 325 bool showLeft = right.value()->cssText() != left.value()->cssText();326 bool showBottom = (top.value()->cssText() != bottom.value()->cssText()) || showLeft;327 bool showRight = (top.value()->cssText() != right.value()->cssText()) || showBottom;325 bool showLeft = !right.value()->equals(*left.value()); 326 bool showBottom = !top.value()->equals(*bottom.value()) || showLeft; 327 bool showRight = !top.value()->equals(*right.value()) || showBottom; 328 328 329 329 StringBuilder result; … … 1115 1115 if (foundPropertyIndex == -1) 1116 1116 return false; 1117 return propertyAt(foundPropertyIndex).value()-> cssText() == property.value()->cssText();1117 return propertyAt(foundPropertyIndex).value()->equals(*property.value()); 1118 1118 } 1119 1119 -
trunk/Source/WebCore/css/WebKitCSSArrayFunctionValue.cpp
r127869 r142444 57 57 } 58 58 59 bool WebKitCSSArrayFunctionValue::equals(const WebKitCSSArrayFunctionValue& other) const 60 { 61 return CSSValueList::equals(other); 62 } 63 59 64 void WebKitCSSArrayFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 60 65 { -
trunk/Source/WebCore/css/WebKitCSSArrayFunctionValue.h
r127682 r142444 49 49 PassRefPtr<WebKitCSSArrayFunctionValue> cloneForCSSOM() const; 50 50 51 bool equals(const WebKitCSSArrayFunctionValue&) const; 52 51 53 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 52 54 -
trunk/Source/WebCore/css/WebKitCSSFilterValue.cpp
r127869 r142444 112 112 } 113 113 114 bool WebKitCSSFilterValue::equals(const WebKitCSSFilterValue& other) const 115 { 116 return m_type == other.m_type && CSSValueList::equals(other); 117 } 118 114 119 void WebKitCSSFilterValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 115 120 { -
trunk/Source/WebCore/css/WebKitCSSFilterValue.h
r124768 r142444 69 69 PassRefPtr<WebKitCSSFilterValue> cloneForCSSOM() const; 70 70 71 bool equals(const WebKitCSSFilterValue&) const; 72 71 73 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 72 74 -
trunk/Source/WebCore/css/WebKitCSSMixFunctionValue.cpp
r127869 r142444 57 57 } 58 58 59 bool WebKitCSSMixFunctionValue::equals(const WebKitCSSMixFunctionValue& other) const 60 { 61 return CSSValueList::equals(other); 62 } 63 59 64 void WebKitCSSMixFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 60 65 { -
trunk/Source/WebCore/css/WebKitCSSMixFunctionValue.h
r128418 r142444 49 49 PassRefPtr<WebKitCSSMixFunctionValue> cloneForCSSOM() const; 50 50 51 bool equals(const WebKitCSSMixFunctionValue&) const; 52 51 53 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 52 54 -
trunk/Source/WebCore/css/WebKitCSSSVGDocumentValue.cpp
r141570 r142444 68 68 } 69 69 70 bool WebKitCSSSVGDocumentValue::equals(const WebKitCSSSVGDocumentValue& other) const 71 { 72 return m_url == other.m_url; 73 } 74 70 75 void WebKitCSSSVGDocumentValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 71 76 { -
trunk/Source/WebCore/css/WebKitCSSSVGDocumentValue.h
r124768 r142444 45 45 const String& url() const { return m_url; } 46 46 bool loadRequested() const { return m_loadRequested; } 47 bool equals(const WebKitCSSSVGDocumentValue&) const; 47 48 48 49 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; -
trunk/Source/WebCore/css/WebKitCSSShaderValue.cpp
r141570 r142444 84 84 } 85 85 86 bool WebKitCSSShaderValue::equals(const WebKitCSSShaderValue& other) const 87 { 88 return m_url == other.m_url; 89 } 90 86 91 void WebKitCSSShaderValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 87 92 { -
trunk/Source/WebCore/css/WebKitCSSShaderValue.h
r124768 r142444 51 51 String customCssText() const; 52 52 53 bool equals(const WebKitCSSShaderValue&) const; 54 53 55 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 54 56 -
trunk/Source/WebCore/css/WebKitCSSTransformValue.h
r124768 r142444 67 67 68 68 String customCssText() const; 69 bool equals(const WebKitCSSTransformValue& other) const { return m_type == other.m_type && CSSValueList::equals(other); } 69 70 #if ENABLE(CSS_VARIABLES) 70 71 String customSerializeResolvingVariables(const HashMap<AtomicString, String>&) const; -
trunk/Source/WebCore/editing/EditingStyle.cpp
r142375 r142444 246 246 RefPtr<CSSValue> styleValue = style->getPropertyCSSValue(m_propertyID); 247 247 248 // FIXME: This is very inefficient way of comparing values 249 // but we can't string compare attribute value and CSS property value. 250 return value && styleValue && value->cssText() == styleValue->cssText(); 248 return compareCSSValuePtr(value, styleValue); 251 249 } 252 250 -
trunk/Source/WebCore/svg/SVGColor.cpp
r127869 r142444 106 106 } 107 107 108 bool SVGColor::equals(const SVGColor& other) const 109 { 110 return m_colorType == other.m_colorType && m_color == other.m_color; 111 } 112 108 113 void SVGColor::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 109 114 { -
trunk/Source/WebCore/svg/SVGColor.h
r124768 r142444 76 76 PassRefPtr<SVGColor> cloneForCSSOM() const; 77 77 78 bool equals(const SVGColor&) const; 79 78 80 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 79 81 -
trunk/Source/WebCore/svg/SVGPaint.cpp
r141570 r142444 113 113 } 114 114 115 bool SVGPaint::equals(const SVGPaint& other) const 116 { 117 return m_paintType == other.m_paintType && m_uri == other.m_uri && SVGColor::equals(other); 118 } 119 115 120 void SVGPaint::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 116 121 { -
trunk/Source/WebCore/svg/SVGPaint.h
r124768 r142444 96 96 PassRefPtr<SVGPaint> cloneForCSSOM() const; 97 97 98 bool equals(const SVGPaint&) const; 99 98 100 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 99 101
Note: See TracChangeset
for help on using the changeset viewer.