Implement CSSValue::equals(const CSSValue&) to optimise CSSValue comparison
https://bugs.webkit.org/show_bug.cgi?id=102901
Patch by Alexander Shalamov <[email protected]> on 2013-02-11
Reviewed by Antti Koivisto.
Source/WebCore:
Added comparison method to CSSValue and its children, so that the
css values could be compared efficiently. Before this patch, CSSValue
objects were compared using strings that were generated by the cssText() method.
Test: cssom/cssvalue-comparison.html
- css/CSSAspectRatioValue.cpp:
(WebCore::CSSAspectRatioValue::equals):
(WebCore):
- css/CSSAspectRatioValue.h:
(CSSAspectRatioValue):
(WebCore::CSSBasicShapeRectangle::equals):
(WebCore):
(WebCore::CSSBasicShapeCircle::equals):
(WebCore::CSSBasicShapeEllipse::equals):
(WebCore::CSSBasicShapePolygon::equals):
(CSSBasicShapeRectangle):
(CSSBasicShapeCircle):
(CSSBasicShapeEllipse):
(CSSBasicShapePolygon):
- css/CSSBorderImageSliceValue.cpp:
(WebCore::CSSBorderImageSliceValue::equals):
(WebCore):
- css/CSSBorderImageSliceValue.h:
(CSSBorderImageSliceValue):
- css/CSSCalculationValue.cpp:
(WebCore::CSSCalcValue::equals):
(WebCore):
(WebCore::CSSCalcPrimitiveValue::equals):
(CSSCalcPrimitiveValue):
(WebCore::CSSCalcPrimitiveValue::type):
(WebCore::CSSCalcBinaryOperation::equals):
(CSSCalcBinaryOperation):
(WebCore::CSSCalcBinaryOperation::type):
- css/CSSCalculationValue.h:
(WebCore::CSSCalcExpressionNode::equals):
(CSSCalcExpressionNode):
(CSSCalcValue):
(WebCore::CSSCanvasValue::equals):
(WebCore):
(CSSCanvasValue):
- css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
(WebCore::CSSComputedStyleDeclaration::cssPropertyMatches):
(WebCore::CSSComputedStyleDeclaration::getCSSPropertyValuesForSidesShorthand):
- css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::equals):
(WebCore):
(CSSCrossfadeValue):
- css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::equals):
(WebCore):
- css/CSSCursorImageValue.h:
(CSSCursorImageValue):
- css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::equals):
(WebCore):
- css/CSSFontFaceSrcValue.h:
(CSSFontFaceSrcValue):
- css/CSSFunctionValue.cpp:
(WebCore::CSSFunctionValue::equals):
(WebCore):
(CSSFunctionValue):
- css/CSSGradientValue.cpp:
(WebCore::CSSLinearGradientValue::equals):
(WebCore):
(WebCore::CSSRadialGradientValue::equals):
(WebCore::CSSGradientColorStop::operator==):
(CSSLinearGradientValue):
(CSSRadialGradientValue):
(WebCore::CSSImageValue::equals):
(WebCore):
(CSSImageValue):
(WebCore::CSSInheritedValue::equals):
(CSSInheritedValue):
(WebCore::CSSInitialValue::equals):
(CSSInitialValue):
- css/CSSLineBoxContainValue.h:
(WebCore::CSSLineBoxContainValue::equals):
- css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::equals):
(WebCore):
(CSSPrimitiveValue):
(WebCore::CSSReflectValue::equals):
(WebCore):
(CSSReflectValue):
- css/CSSTimingFunctionValue.cpp:
(WebCore::CSSCubicBezierTimingFunctionValue::equals):
(WebCore):
(WebCore::CSSStepsTimingFunctionValue::equals):
- css/CSSTimingFunctionValue.h:
(WebCore::CSSLinearTimingFunctionValue::equals):
(CSSLinearTimingFunctionValue):
(CSSCubicBezierTimingFunctionValue):
(CSSStepsTimingFunctionValue):
- css/CSSUnicodeRangeValue.cpp:
(WebCore::CSSUnicodeRangeValue::equals):
(WebCore):
- css/CSSUnicodeRangeValue.h:
(CSSUnicodeRangeValue):
(WebCore):
(WebCore::compareCSSValues):
(WebCore::CSSValue::equals):
(CSSValue):
(WebCore):
(WebCore::compareCSSValueVector):
(WebCore::compareCSSValuePtr):
(WebCore::CSSValueList::removeAll):
(WebCore::CSSValueList::hasValue):
(WebCore::CSSValueList::equals):
(WebCore):
(CSSValueList):
(WebCore::CSSVariableValue::equals):
(CSSVariableValue):
(Counter):
(WebCore::Counter::equals):
(WebCore::DashboardRegion::equals):
- css/FontFeatureValue.cpp:
(WebCore::FontFeatureValue::equals):
(WebCore):
(FontFeatureValue):
(WebCore::FontValue::equals):
(WebCore):
(FontValue):
(WebCore::MediaQueryExp::operator==):
(WebCore::Pair::equals):
(Pair):
(WebCore::RectBase::equals):
(RectBase):
(WebCore::ShadowValue::equals):
(WebCore):
(ShadowValue):
- css/StylePropertySet.cpp:
(WebCore::StylePropertySet::get4Values):
(WebCore::StylePropertySet::propertyMatches):
- css/WebKitCSSArrayFunctionValue.cpp:
(WebCore::WebKitCSSArrayFunctionValue::equals):
(WebCore):
- css/WebKitCSSArrayFunctionValue.h:
(WebKitCSSArrayFunctionValue):
- css/WebKitCSSFilterValue.cpp:
(WebCore::WebKitCSSFilterValue::equals):
(WebCore):
- css/WebKitCSSFilterValue.h:
(WebKitCSSFilterValue):
- css/WebKitCSSMixFunctionValue.cpp:
(WebCore::WebKitCSSMixFunctionValue::equals):
(WebCore):
- css/WebKitCSSMixFunctionValue.h:
(WebKitCSSMixFunctionValue):
- css/WebKitCSSSVGDocumentValue.cpp:
(WebCore::WebKitCSSSVGDocumentValue::equals):
(WebCore):
- css/WebKitCSSSVGDocumentValue.h:
(WebKitCSSSVGDocumentValue):
- css/WebKitCSSShaderValue.cpp:
(WebCore::WebKitCSSShaderValue::equals):
(WebCore):
- css/WebKitCSSShaderValue.h:
(WebKitCSSShaderValue):
- css/WebKitCSSTransformValue.h:
(WebCore::WebKitCSSTransformValue::equals):
- editing/EditingStyle.cpp:
(WebCore::HTMLAttributeEquivalent::valueIsPresentInStyle):
(WebCore::SVGColor::equals):
(WebCore):
(SVGColor):
(WebCore::SVGPaint::equals):
(WebCore):
(SVGPaint):
LayoutTests:
New layout test to verify that CSSValue objects comparison works properly.
- cssom/cssvalue-comparison-expected.txt: Added.
- cssom/cssvalue-comparison.html: Added.