haikuwebkit/LayoutTests/cssom/cssvalue-comparison.html

87 lines
5.7 KiB
HTML
Raw Permalink Normal View History

Implement CSSValue::equals(const CSSValue&) to optimise CSSValue comparison https://bugs.webkit.org/show_bug.cgi?id=102901 Patch by Alexander Shalamov <alexander.shalamov@intel.com> 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): * css/CSSBasicShapes.cpp: (WebCore::CSSBasicShapeRectangle::equals): (WebCore): (WebCore::CSSBasicShapeCircle::equals): (WebCore::CSSBasicShapeEllipse::equals): (WebCore::CSSBasicShapePolygon::equals): * css/CSSBasicShapes.h: (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): * css/CSSCanvasValue.cpp: (WebCore::CSSCanvasValue::equals): (WebCore): * css/CSSCanvasValue.h: (CSSCanvasValue): * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): (WebCore::CSSComputedStyleDeclaration::cssPropertyMatches): (WebCore::CSSComputedStyleDeclaration::getCSSPropertyValuesForSidesShorthand): * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::equals): (WebCore): * css/CSSCrossfadeValue.h: (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): * css/CSSFunctionValue.h: (CSSFunctionValue): * css/CSSGradientValue.cpp: (WebCore::CSSLinearGradientValue::equals): (WebCore): (WebCore::CSSRadialGradientValue::equals): * css/CSSGradientValue.h: (WebCore::CSSGradientColorStop::operator==): (CSSLinearGradientValue): (CSSRadialGradientValue): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::equals): (WebCore): * css/CSSImageValue.h: (CSSImageValue): * css/CSSInheritedValue.h: (WebCore::CSSInheritedValue::equals): (CSSInheritedValue): * css/CSSInitialValue.h: (WebCore::CSSInitialValue::equals): (CSSInitialValue): * css/CSSLineBoxContainValue.h: (WebCore::CSSLineBoxContainValue::equals): * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::equals): (WebCore): * css/CSSPrimitiveValue.h: (CSSPrimitiveValue): * css/CSSReflectValue.cpp: (WebCore::CSSReflectValue::equals): (WebCore): * css/CSSReflectValue.h: (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): * css/CSSValue.cpp: (WebCore): (WebCore::compareCSSValues): (WebCore::CSSValue::equals): * css/CSSValue.h: (CSSValue): (WebCore): (WebCore::compareCSSValueVector): (WebCore::compareCSSValuePtr): * css/CSSValueList.cpp: (WebCore::CSSValueList::removeAll): (WebCore::CSSValueList::hasValue): (WebCore::CSSValueList::equals): (WebCore): * css/CSSValueList.h: (CSSValueList): * css/CSSVariableValue.h: (WebCore::CSSVariableValue::equals): (CSSVariableValue): * css/Counter.h: (Counter): (WebCore::Counter::equals): * css/DashboardRegion.h: (WebCore::DashboardRegion::equals): * css/FontFeatureValue.cpp: (WebCore::FontFeatureValue::equals): (WebCore): * css/FontFeatureValue.h: (FontFeatureValue): * css/FontValue.cpp: (WebCore::FontValue::equals): (WebCore): * css/FontValue.h: (FontValue): * css/MediaQueryExp.h: (WebCore::MediaQueryExp::operator==): * css/Pair.h: (WebCore::Pair::equals): (Pair): * css/Rect.h: (WebCore::RectBase::equals): (RectBase): * css/ShadowValue.cpp: (WebCore::ShadowValue::equals): (WebCore): * css/ShadowValue.h: (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): * svg/SVGColor.cpp: (WebCore::SVGColor::equals): (WebCore): * svg/SVGColor.h: (SVGColor): * svg/SVGPaint.cpp: (WebCore::SVGPaint::equals): (WebCore): * svg/SVGPaint.h: (SVGPaint): LayoutTests: New layout test to verify that CSSValue objects comparison works properly. * cssom/cssvalue-comparison-expected.txt: Added. * cssom/cssvalue-comparison.html: Added. Canonical link: https://commits.webkit.org/127685@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-11 11:00:54 +00:00
<!DOCTYPE HTML>
<html>
<head>
<title>CSSValue comparison test</title>
<script type="text/javascript" src="../resources/testharness.js"></script>
<script type="text/javascript" src="../resources/testharnessreport.js"></script>
</head>
<body onload="run()">
<p>This test verifies that CSSValue objects comparison works correctly.</p>
<div id="test" contenteditable></div>
<script type="text/javascript">
setup({ "explicit_done": true });
function run() {
var styleElement = document.createElement("style");
styleElement.type = "text/css";
var styleTextNode = document.createTextNode("");
styleElement.appendChild(styleTextNode);
document.getElementsByTagName("head")[0].appendChild(styleElement);
var div = document.getElementById("test");
div.focus();
function runTest(propertyName, styleSheetPropertyValue, inlineStylePropertyValue, expectedResult) {
styleTextNode.data = "div { " + propertyName + " : " + styleSheetPropertyValue + "; }";
document.execCommand('insertHTML', false, "<div id=\"insertedDiv\" style=\"" + propertyName + " : " + inlineStylePropertyValue + "; \"></div>");
var insertedDiv = document.getElementById('insertedDiv');
var result = expectedResult;
if (propertyName in insertedDiv.style)
result = insertedDiv.style[propertyName] === "";
insertedDiv.remove();
return result;
}
var tests = [ {"width" : ["20%", "2em", "2rem", "20px", "2cm", "20mm", "4in", "20pt", "10pc", "6vw", "6vh", "4vmin", "-webkit-calc(-100px + 100%)"]}, // lengths, calc
{"-webkit-transform" : ["rotate(15deg)", "rotate(1.55rad)", "rotate(200grad)", "rotate(0.5turn)"]}, // angle
Specifying a longhand property should not serialize to a shorthand property https://bugs.webkit.org/show_bug.cgi?id=157180 Patch by Antoine Quint <graouts@apple.com> on 2016-05-02 Reviewed by Dean Jackson. Source/WebCore: Ensure that we don't serialize to a shorthand property when the required longhand components are not specified, per http://www.w3.org/TR/cssom-1/#serialize-a-css-declaration-block. Test: fast/css/no-shorthand-with-incomplete-longhands.html * css/StyleProperties.cpp: (WebCore::StyleProperties::getLayeredShorthandValue): Returning an empty string here means that calling getPropertyValue() with the shorthand property matching the currently processed longhand property in asText() will return an empty string as well and the shorthand property will be disregarded. LayoutTests: A fair few tests relied on reading from a shorthand value when it was incorrect to produce one, so we fix those incorrect assertions. We also add a new test that goes through all the longhand properties for a given shorthand property and checks that none of the longhand properties will yield a shorthand value. * cssom/cssvalue-comparison-expected.txt: * cssom/cssvalue-comparison.html: * fast/css/background-position-serialize-expected.txt: * fast/css/background-position-serialize.html: * fast/css/no-shorthand-with-incomplete-longhands-expected.txt: Added. * fast/css/no-shorthand-with-incomplete-longhands.html: Added. * fast/css/remove-shorthand-expected.txt: * fast/css/script-tests/image-set-setting.js: (testComputedStyle): * fast/css/uri-token-parsing-expected.txt: * fast/css/uri-token-parsing.html: * fast/css/webkit-mask-crash-implicit-expected.txt: * fast/css/webkit-mask-crash-implicit.html: * fast/dom/Element/setAttributeNode-for-existing-attribute.html: * fast/dom/background-shorthand-csstext-expected.txt: * fast/dom/background-shorthand-csstext.html: * http/tests/security/contentSecurityPolicy/inline-style-allowed-while-cloning-objects-expected.txt: * http/tests/security/contentSecurityPolicy/inline-style-allowed-while-cloning-objects.html: Canonical link: https://commits.webkit.org/175393@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-03 02:25:31 +00:00
{"background-image" : ["url(dummy://test.png)", "url(dummy://green.png)"]}, // uri
Implement CSSValue::equals(const CSSValue&) to optimise CSSValue comparison https://bugs.webkit.org/show_bug.cgi?id=102901 Patch by Alexander Shalamov <alexander.shalamov@intel.com> 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): * css/CSSBasicShapes.cpp: (WebCore::CSSBasicShapeRectangle::equals): (WebCore): (WebCore::CSSBasicShapeCircle::equals): (WebCore::CSSBasicShapeEllipse::equals): (WebCore::CSSBasicShapePolygon::equals): * css/CSSBasicShapes.h: (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): * css/CSSCanvasValue.cpp: (WebCore::CSSCanvasValue::equals): (WebCore): * css/CSSCanvasValue.h: (CSSCanvasValue): * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): (WebCore::CSSComputedStyleDeclaration::cssPropertyMatches): (WebCore::CSSComputedStyleDeclaration::getCSSPropertyValuesForSidesShorthand): * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::equals): (WebCore): * css/CSSCrossfadeValue.h: (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): * css/CSSFunctionValue.h: (CSSFunctionValue): * css/CSSGradientValue.cpp: (WebCore::CSSLinearGradientValue::equals): (WebCore): (WebCore::CSSRadialGradientValue::equals): * css/CSSGradientValue.h: (WebCore::CSSGradientColorStop::operator==): (CSSLinearGradientValue): (CSSRadialGradientValue): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::equals): (WebCore): * css/CSSImageValue.h: (CSSImageValue): * css/CSSInheritedValue.h: (WebCore::CSSInheritedValue::equals): (CSSInheritedValue): * css/CSSInitialValue.h: (WebCore::CSSInitialValue::equals): (CSSInitialValue): * css/CSSLineBoxContainValue.h: (WebCore::CSSLineBoxContainValue::equals): * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::equals): (WebCore): * css/CSSPrimitiveValue.h: (CSSPrimitiveValue): * css/CSSReflectValue.cpp: (WebCore::CSSReflectValue::equals): (WebCore): * css/CSSReflectValue.h: (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): * css/CSSValue.cpp: (WebCore): (WebCore::compareCSSValues): (WebCore::CSSValue::equals): * css/CSSValue.h: (CSSValue): (WebCore): (WebCore::compareCSSValueVector): (WebCore::compareCSSValuePtr): * css/CSSValueList.cpp: (WebCore::CSSValueList::removeAll): (WebCore::CSSValueList::hasValue): (WebCore::CSSValueList::equals): (WebCore): * css/CSSValueList.h: (CSSValueList): * css/CSSVariableValue.h: (WebCore::CSSVariableValue::equals): (CSSVariableValue): * css/Counter.h: (Counter): (WebCore::Counter::equals): * css/DashboardRegion.h: (WebCore::DashboardRegion::equals): * css/FontFeatureValue.cpp: (WebCore::FontFeatureValue::equals): (WebCore): * css/FontFeatureValue.h: (FontFeatureValue): * css/FontValue.cpp: (WebCore::FontValue::equals): (WebCore): * css/FontValue.h: (FontValue): * css/MediaQueryExp.h: (WebCore::MediaQueryExp::operator==): * css/Pair.h: (WebCore::Pair::equals): (Pair): * css/Rect.h: (WebCore::RectBase::equals): (RectBase): * css/ShadowValue.cpp: (WebCore::ShadowValue::equals): (WebCore): * css/ShadowValue.h: (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): * svg/SVGColor.cpp: (WebCore::SVGColor::equals): (WebCore): * svg/SVGColor.h: (SVGColor): * svg/SVGPaint.cpp: (WebCore::SVGPaint::equals): (WebCore): * svg/SVGPaint.h: (SVGPaint): LayoutTests: New layout test to verify that CSSValue objects comparison works properly. * cssom/cssvalue-comparison-expected.txt: Added. * cssom/cssvalue-comparison.html: Added. Canonical link: https://commits.webkit.org/127685@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-11 11:00:54 +00:00
{"font-weight" : ["bold", "inherit"]}, // ident
{"content" : ["counter(a)", "counters(a, '.')"]}, // counter
{"content" : ["attr(a)", "attr(p)"]}, // attr
{"clip" : ["rect(40px, 0, 45px, -5px)", "rect(10px, 5px, 15px, -10px)"]}, // rect
{"border-radius" : ["30px 75px 15px 15px", "164px / 82px", "40px"]}, // quads
{"stop-color" : ["rgb(255,0,0)", "#FF5566"]}, // hex, rgb color
{"-webkit-clip-path" : ["polygon(evenodd, 10px 75px, 180px 180px, 100px 10px, 10px 180px, 180px 75px, 10px 75px)", "polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%)"]}, // shape value
{"-webkit-animation-duration" : ["10s", "100ms"]}, // seconds, milliseconds
{"color" : ["red", "blue"]}, // ident
{"border-image-source" : ["url(resources/greenbox.png)", "url(resources/redbox.png)"]}, // image
{"border-image-slice" : ["1 2 3 4", "2 3 4 5"]}, // border image slice
{"cursor" : ["url(resources/greenbox.png) 0 0, pointer", "url(resources/cursor.png) 1 1, wait"]}, // cursor
{"font" : ["italic bold 12px/30px arial", "italic bold 8px/16px helvetica"]}, // font
Specifying a longhand property should not serialize to a shorthand property https://bugs.webkit.org/show_bug.cgi?id=157180 Patch by Antoine Quint <graouts@apple.com> on 2016-05-02 Reviewed by Dean Jackson. Source/WebCore: Ensure that we don't serialize to a shorthand property when the required longhand components are not specified, per http://www.w3.org/TR/cssom-1/#serialize-a-css-declaration-block. Test: fast/css/no-shorthand-with-incomplete-longhands.html * css/StyleProperties.cpp: (WebCore::StyleProperties::getLayeredShorthandValue): Returning an empty string here means that calling getPropertyValue() with the shorthand property matching the currently processed longhand property in asText() will return an empty string as well and the shorthand property will be disregarded. LayoutTests: A fair few tests relied on reading from a shorthand value when it was incorrect to produce one, so we fix those incorrect assertions. We also add a new test that goes through all the longhand properties for a given shorthand property and checks that none of the longhand properties will yield a shorthand value. * cssom/cssvalue-comparison-expected.txt: * cssom/cssvalue-comparison.html: * fast/css/background-position-serialize-expected.txt: * fast/css/background-position-serialize.html: * fast/css/no-shorthand-with-incomplete-longhands-expected.txt: Added. * fast/css/no-shorthand-with-incomplete-longhands.html: Added. * fast/css/remove-shorthand-expected.txt: * fast/css/script-tests/image-set-setting.js: (testComputedStyle): * fast/css/uri-token-parsing-expected.txt: * fast/css/uri-token-parsing.html: * fast/css/webkit-mask-crash-implicit-expected.txt: * fast/css/webkit-mask-crash-implicit.html: * fast/dom/Element/setAttributeNode-for-existing-attribute.html: * fast/dom/background-shorthand-csstext-expected.txt: * fast/dom/background-shorthand-csstext.html: * http/tests/security/contentSecurityPolicy/inline-style-allowed-while-cloning-objects-expected.txt: * http/tests/security/contentSecurityPolicy/inline-style-allowed-while-cloning-objects.html: Canonical link: https://commits.webkit.org/175393@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-03 02:25:31 +00:00
{"background-image" : ["-webkit-gradient(linear, left top, left bottom, from(#ccc), to(#000))", "-webkit-gradient(radial, 45 45, 0, 52 50, 0, from(#A7D30C), to(rgba(1,159,98,0)), color-stop(90%, #019F62))"]}, // gradients
{"background-image" : ["radial-gradient(circle, #ccc, #000)"]}, // gradients
{"background-image" : ["linear-gradient(#000, #234)", "linear-gradient(to top, #000, #234)"]}, // gradients
Implement CSSValue::equals(const CSSValue&) to optimise CSSValue comparison https://bugs.webkit.org/show_bug.cgi?id=102901 Patch by Alexander Shalamov <alexander.shalamov@intel.com> 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): * css/CSSBasicShapes.cpp: (WebCore::CSSBasicShapeRectangle::equals): (WebCore): (WebCore::CSSBasicShapeCircle::equals): (WebCore::CSSBasicShapeEllipse::equals): (WebCore::CSSBasicShapePolygon::equals): * css/CSSBasicShapes.h: (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): * css/CSSCanvasValue.cpp: (WebCore::CSSCanvasValue::equals): (WebCore): * css/CSSCanvasValue.h: (CSSCanvasValue): * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): (WebCore::CSSComputedStyleDeclaration::cssPropertyMatches): (WebCore::CSSComputedStyleDeclaration::getCSSPropertyValuesForSidesShorthand): * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::equals): (WebCore): * css/CSSCrossfadeValue.h: (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): * css/CSSFunctionValue.h: (CSSFunctionValue): * css/CSSGradientValue.cpp: (WebCore::CSSLinearGradientValue::equals): (WebCore): (WebCore::CSSRadialGradientValue::equals): * css/CSSGradientValue.h: (WebCore::CSSGradientColorStop::operator==): (CSSLinearGradientValue): (CSSRadialGradientValue): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::equals): (WebCore): * css/CSSImageValue.h: (CSSImageValue): * css/CSSInheritedValue.h: (WebCore::CSSInheritedValue::equals): (CSSInheritedValue): * css/CSSInitialValue.h: (WebCore::CSSInitialValue::equals): (CSSInitialValue): * css/CSSLineBoxContainValue.h: (WebCore::CSSLineBoxContainValue::equals): * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::equals): (WebCore): * css/CSSPrimitiveValue.h: (CSSPrimitiveValue): * css/CSSReflectValue.cpp: (WebCore::CSSReflectValue::equals): (WebCore): * css/CSSReflectValue.h: (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): * css/CSSValue.cpp: (WebCore): (WebCore::compareCSSValues): (WebCore::CSSValue::equals): * css/CSSValue.h: (CSSValue): (WebCore): (WebCore::compareCSSValueVector): (WebCore::compareCSSValuePtr): * css/CSSValueList.cpp: (WebCore::CSSValueList::removeAll): (WebCore::CSSValueList::hasValue): (WebCore::CSSValueList::equals): (WebCore): * css/CSSValueList.h: (CSSValueList): * css/CSSVariableValue.h: (WebCore::CSSVariableValue::equals): (CSSVariableValue): * css/Counter.h: (Counter): (WebCore::Counter::equals): * css/DashboardRegion.h: (WebCore::DashboardRegion::equals): * css/FontFeatureValue.cpp: (WebCore::FontFeatureValue::equals): (WebCore): * css/FontFeatureValue.h: (FontFeatureValue): * css/FontValue.cpp: (WebCore::FontValue::equals): (WebCore): * css/FontValue.h: (FontValue): * css/MediaQueryExp.h: (WebCore::MediaQueryExp::operator==): * css/Pair.h: (WebCore::Pair::equals): (Pair): * css/Rect.h: (WebCore::RectBase::equals): (RectBase): * css/ShadowValue.cpp: (WebCore::ShadowValue::equals): (WebCore): * css/ShadowValue.h: (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): * svg/SVGColor.cpp: (WebCore::SVGColor::equals): (WebCore): * svg/SVGColor.h: (SVGColor): * svg/SVGPaint.cpp: (WebCore::SVGPaint::equals): (WebCore): * svg/SVGPaint.h: (SVGPaint): LayoutTests: New layout test to verify that CSSValue objects comparison works properly. * cssom/cssvalue-comparison-expected.txt: Added. * cssom/cssvalue-comparison.html: Added. Canonical link: https://commits.webkit.org/127685@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-11 11:00:54 +00:00
{"background-image" : ["-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 50%)", "-webkit-cross-fade(url(dummy://background.png), url(dummy://foreground.png), 80%)"]}, // crossfade
{"-webkit-box-reflect" : ["below 10px", "below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), to(rgba(10, 55, 234, 1)))"]}, // reflect
{"-webkit-box-shadow" : ["0 -20px 10px red, 0 20px 10px blue", "0 20px 10px blue", "5px 5px 5px rgba(0, 0, 0, 0.3)"]}, // shadow
{"-webkit-transition-timing-function" : ["cubic-bezier(0.25, 0.1, 0.25, 1)", "linear", "steps(3, end)"]}, // timing functions
{"-webkit-transform" : ["rotate(30deg)", "translate(50px,50px)", "scale(2,4)", "skew(30deg,20deg)", "matrix(0.4,0.5,-0.5,0.4,0,0)"]}, // transforms
{"-webkit-line-box-contain" : ["inline-box", "font", "glyphs", "replaced"]}, // line-box-contain
{"background-image" : ["-webkit-image-set(url(dummy://test.png) 1x, url(dummy://test.png) 2x)", "-webkit-image-set(url(dummy://small.png) 2x, url(dummy://big.png) 3x)"]}, // image set
{"background-image" : ["image-set(url(dummy://test.png) 1x, url(dummy://test.png) 2x)", "image-set(url(dummy://small.png) 2x, url(dummy://big.png) 3x)"]}, // image set
Remove Dashboard support https://bugs.webkit.org/show_bug.cgi?id=198615 Reviewed by Ryosuke Niwa. .: * Source/cmake/OptionsMac.cmake: * Source/cmake/WebKitFeatures.cmake: Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Source/WebCore: * Configurations/FeatureDefines.xcconfig: * WebCore.xcodeproj/project.pbxproj: * css/CSSCalculationValue.cpp: (WebCore::hasDoubleValue): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValue.cpp: (WebCore::isValidCSSUnitTypeForDoubleConversion): (WebCore::isStringType): (WebCore::CSSPrimitiveValue::cleanup): (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): (WebCore::CSSPrimitiveValue::equals const): * css/CSSPrimitiveValue.h: * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/DashboardRegion.h: Removed. * css/StyleBuilderCustom.h: (WebCore::convertToIntLength): Deleted. (WebCore::StyleBuilderCustom::applyValueWebkitDashboardRegion): Deleted. * css/StyleResolver.cpp: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): (WebCore::consumeWebkitDashboardRegion): Deleted. * dom/DataTransfer.cpp: (WebCore::DataTransfer::createForUpdatingDropTarget): * dom/Document.cpp: (WebCore::Document::invalidateRenderingDependentRegions): (WebCore::Document::annotatedRegions const): Deleted. (WebCore::Document::setAnnotatedRegions): Deleted. (WebCore::Document::updateAnnotatedRegions): Deleted. (WebCore::Document::invalidateScrollbarDependentRegions): Deleted. (WebCore::Document::updateZOrderDependentRegions): Deleted. * dom/Document.h: (WebCore::Document::setHasAnnotatedRegions): Deleted. (WebCore::Document::setAnnotatedRegionsDirty): Deleted. (WebCore::Document::annotatedRegionsDirty const): Deleted. (WebCore::Document::hasAnnotatedRegions const): Deleted. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createContext2d): * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::rendererIsNeeded): * html/HTMLImageLoader.cpp: (WebCore::HTMLImageLoader::sourceURI const): * html/canvas/CanvasGradient.cpp: (WebCore::CanvasGradient::addColorStop): * html/canvas/CanvasGradient.h: (WebCore::CanvasGradient::setDashboardCompatibilityMode): Deleted. (): Deleted. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::create): (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D): * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::CanvasRenderingContext2DBase): (WebCore::CanvasRenderingContext2DBase::fill): (WebCore::CanvasRenderingContext2DBase::stroke): (WebCore::CanvasRenderingContext2DBase::clip): (WebCore::CanvasRenderingContext2DBase::createLinearGradient): (WebCore::CanvasRenderingContext2DBase::createRadialGradient): (WebCore::CanvasRenderingContext2DBase::prepareGradientForDashboard const): Deleted. (WebCore::CanvasRenderingContext2DBase::clearPathForDashboardBackwardCompatibilityMode): Deleted. * html/canvas/CanvasRenderingContext2DBase.h: * html/canvas/OffscreenCanvasRenderingContext2D.cpp: (WebCore::OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D): * html/canvas/PaintRenderingContext2D.cpp: (WebCore::PaintRenderingContext2D::PaintRenderingContext2D): * page/Chrome.cpp: (WebCore::ChromeClient::annotatedRegionsChanged): Deleted. * page/ChromeClient.h: * page/FrameView.cpp: (WebCore::FrameView::didLayout): (WebCore::FrameView::didPaintContents): * page/Settings.yaml: * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::needsKeyboardEventDisambiguationQuirks const): * rendering/RenderInline.cpp: (WebCore::RenderInline::addAnnotatedRegions): Deleted. * rendering/RenderInline.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollTo): (WebCore::RenderLayer::setHasHorizontalScrollbar): (WebCore::RenderLayer::setHasVerticalScrollbar): (WebCore::RenderLayer::updateScrollbarsAfterLayout): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::setHasVerticalScrollbar): * rendering/RenderObject.cpp: (WebCore::RenderObject::addAnnotatedRegions): Deleted. (WebCore::RenderObject::collectAnnotatedRegions): Deleted. * rendering/RenderObject.h: (WebCore::AnnotatedRegionValue::operator== const): Deleted. (WebCore::AnnotatedRegionValue::operator!= const): Deleted. * rendering/style/RenderStyle.cpp: (WebCore::rareNonInheritedDataChangeRequiresLayout): (WebCore::RenderStyle::initialDashboardRegions): Deleted. (WebCore::RenderStyle::noneDashboardRegions): Deleted. (WebCore::RenderStyle::setDashboardRegion): Deleted. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::dashboardRegions const): Deleted. (WebCore::RenderStyle::setDashboardRegions): Deleted. * rendering/style/StyleDashboardRegion.h: Removed. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::send): (WebCore::XMLHttpRequest::setRequestHeader): (WebCore::XMLHttpRequest::usesDashboardBackwardCompatibilityMode const): Deleted. * xml/XMLHttpRequest.h: Source/WebCore/PAL: * Configurations/FeatureDefines.xcconfig: Source/WebKit: * Configurations/FeatureDefines.xcconfig: * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetUseDashboardCompatibilityMode): Deleted. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setUseDashboardCompatibilityMode): Deleted. * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::annotatedRegionsChanged): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: Source/WebKitLegacy/mac: Removes implementation, but keeps privatly exported interfaces and enums around until we can confirm there are no more users of them. * Configurations/FeatureDefines.xcconfig: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:]): * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::annotatedRegionsChanged): Deleted. * WebView/WebClipView.mm: (-[WebClipView _focusRingVisibleRect]): (-[WebClipView scrollWheel:]): * WebView/WebDashboardRegion.h: * WebView/WebDashboardRegion.mm: * WebView/WebHTMLView.mm: (-[WebHTMLView _updateMouseoverWithEvent:]): (-[WebHTMLView acceptsFirstMouse:]): (-[WebHTMLView setDataSource:]): * WebView/WebPreferences.mm: (cacheModelForMainBundle): * WebView/WebUIDelegatePrivate.h: * WebView/WebView.mm: (-[WebView _needsPreHTML5ParserQuirks]): (-[WebView _preferencesChanged:]): (-[WebView _addScrollerDashboardRegions:]): (-[WebView _dashboardRegions]): (-[WebView _setDashboardBehavior:to:]): (-[WebView _dashboardBehavior:]): (-[WebView _addControlRect:clip:fromView:toDashboardRegions:]): Deleted. (-[WebView _addScrollerDashboardRegionsForFrameView:dashboardRegions:]): Deleted. (-[WebView _addScrollerDashboardRegions:from:]): Deleted. * WebView/WebViewData.h: * WebView/WebViewData.mm: (-[WebViewPrivate init]): * WebView/WebViewPrivate.h: Source/WTF: * wtf/FeatureDefines.h: Tools: * DumpRenderTree/TestRunner.cpp: (TestRunner::staticFunctions): (setUseDashboardCompatibilityModeCallback): Deleted. * DumpRenderTree/TestRunner.h: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/DumpRenderTree.mm: (resetWebViewToConsistentStateBeforeTesting): * DumpRenderTree/mac/TestRunnerMac.mm: (TestRunner::setUseDashboardCompatibilityMode): Deleted. * ImageDiff/cg/Configurations/Base.xcconfig: * Scripts/webkitperl/FeatureList.pm: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/mac/DeviceScaleFactorInDashboardRegions.mm: Removed. * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::beginTesting): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setUseDashboardCompatibilityMode): Deleted. * WebKitTestRunner/InjectedBundle/TestRunner.h: LayoutTests: * TestExpectations: * cssom/cssvalue-comparison-expected.txt: * cssom/cssvalue-comparison.html: * fast/canvas/canvas-gradient-addStop-error-expected.txt: * fast/canvas/canvas-gradient-addStop-error.html: * fast/canvas/fill-stroke-clip-reset-path-expected.txt: * fast/canvas/fill-stroke-clip-reset-path.html: * fast/css/dashboard-regions-attr-crash-expected.txt: Removed. * fast/css/dashboard-regions-attr-crash.html: Removed. * fast/css/dashboard-regions-undefined-length-assertion-expected.txt: Removed. * fast/css/dashboard-regions-undefined-length-assertion.html: Removed. * fast/xmlhttprequest/set-dangerous-headers-in-dashboard-expected.txt: Removed. * fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html: Removed. * http/tests/xmlhttprequest/default-content-type-dashboard-expected.txt: Removed. * http/tests/xmlhttprequest/default-content-type-dashboard.html: Removed. * http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard-expected.txt: Removed. * http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard.html: Removed. * legacy-animation-engine/cssom/cssvalue-comparison-expected.txt: * legacy-animation-engine/cssom/cssvalue-comparison.html: * mathml/mathml-in-dashboard-expected.txt: Removed. * mathml/mathml-in-dashboard.html: Removed. * platform/gtk/TestExpectations: * platform/ios-simulator-wk2/TestExpectations: * platform/ios-wk1/TestExpectations: * platform/ios/TestExpectations: * platform/ios/mathml/mathml-in-dashboard-expected.txt: Removed. * platform/mac/TestExpectations: * platform/mac/fast/css/dashboard-region-parser-expected.txt: Removed. * platform/mac/fast/css/dashboard-region-parser.html: Removed. * platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk-expected.txt: Removed. * platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk.html: Removed. * platform/mac/mathml/mathml-in-dashboard-expected.png: Removed. * platform/mac/mathml/mathml-in-dashboard-expected.txt: Removed. * platform/mac/svg/custom/embedded-svg-disallowed-in-dashboard-expected.png: Removed. * platform/mac/svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard-expected.png: Removed. * platform/mac/svg/custom/manually-parsed-svg-disallowed-in-dashboard-expected.png: Removed. * platform/mac/svg/custom/svg-disallowed-in-dashboard-object-expected.png: Removed. * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * svg/custom/embedded-svg-allowed-in-dashboard-expected.txt: Removed. * svg/custom/embedded-svg-allowed-in-dashboard.xml: Removed. * svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard-expected.txt: Removed. * svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard.html: Removed. * svg/custom/manually-parsed-svg-allowed-in-dashboard-expected.txt: Removed. * svg/custom/manually-parsed-svg-allowed-in-dashboard.html: Removed. * svg/custom/svg-allowed-in-dashboard-object-expected.txt: Removed. * svg/custom/svg-allowed-in-dashboard-object.html: Removed. Canonical link: https://commits.webkit.org/212711@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-06-10 22:16:37 +00:00
{"-webkit-filter" : ["grayscale(100%) sepia(100%)", "sepia(10%) grayscale(50%)"]} // filter
Implement CSSValue::equals(const CSSValue&) to optimise CSSValue comparison https://bugs.webkit.org/show_bug.cgi?id=102901 Patch by Alexander Shalamov <alexander.shalamov@intel.com> 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): * css/CSSBasicShapes.cpp: (WebCore::CSSBasicShapeRectangle::equals): (WebCore): (WebCore::CSSBasicShapeCircle::equals): (WebCore::CSSBasicShapeEllipse::equals): (WebCore::CSSBasicShapePolygon::equals): * css/CSSBasicShapes.h: (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): * css/CSSCanvasValue.cpp: (WebCore::CSSCanvasValue::equals): (WebCore): * css/CSSCanvasValue.h: (CSSCanvasValue): * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): (WebCore::CSSComputedStyleDeclaration::cssPropertyMatches): (WebCore::CSSComputedStyleDeclaration::getCSSPropertyValuesForSidesShorthand): * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::equals): (WebCore): * css/CSSCrossfadeValue.h: (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): * css/CSSFunctionValue.h: (CSSFunctionValue): * css/CSSGradientValue.cpp: (WebCore::CSSLinearGradientValue::equals): (WebCore): (WebCore::CSSRadialGradientValue::equals): * css/CSSGradientValue.h: (WebCore::CSSGradientColorStop::operator==): (CSSLinearGradientValue): (CSSRadialGradientValue): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::equals): (WebCore): * css/CSSImageValue.h: (CSSImageValue): * css/CSSInheritedValue.h: (WebCore::CSSInheritedValue::equals): (CSSInheritedValue): * css/CSSInitialValue.h: (WebCore::CSSInitialValue::equals): (CSSInitialValue): * css/CSSLineBoxContainValue.h: (WebCore::CSSLineBoxContainValue::equals): * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::equals): (WebCore): * css/CSSPrimitiveValue.h: (CSSPrimitiveValue): * css/CSSReflectValue.cpp: (WebCore::CSSReflectValue::equals): (WebCore): * css/CSSReflectValue.h: (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): * css/CSSValue.cpp: (WebCore): (WebCore::compareCSSValues): (WebCore::CSSValue::equals): * css/CSSValue.h: (CSSValue): (WebCore): (WebCore::compareCSSValueVector): (WebCore::compareCSSValuePtr): * css/CSSValueList.cpp: (WebCore::CSSValueList::removeAll): (WebCore::CSSValueList::hasValue): (WebCore::CSSValueList::equals): (WebCore): * css/CSSValueList.h: (CSSValueList): * css/CSSVariableValue.h: (WebCore::CSSVariableValue::equals): (CSSVariableValue): * css/Counter.h: (Counter): (WebCore::Counter::equals): * css/DashboardRegion.h: (WebCore::DashboardRegion::equals): * css/FontFeatureValue.cpp: (WebCore::FontFeatureValue::equals): (WebCore): * css/FontFeatureValue.h: (FontFeatureValue): * css/FontValue.cpp: (WebCore::FontValue::equals): (WebCore): * css/FontValue.h: (FontValue): * css/MediaQueryExp.h: (WebCore::MediaQueryExp::operator==): * css/Pair.h: (WebCore::Pair::equals): (Pair): * css/Rect.h: (WebCore::RectBase::equals): (RectBase): * css/ShadowValue.cpp: (WebCore::ShadowValue::equals): (WebCore): * css/ShadowValue.h: (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): * svg/SVGColor.cpp: (WebCore::SVGColor::equals): (WebCore): * svg/SVGColor.h: (SVGColor): * svg/SVGPaint.cpp: (WebCore::SVGPaint::equals): (WebCore): * svg/SVGPaint.h: (SVGPaint): LayoutTests: New layout test to verify that CSSValue objects comparison works properly. * cssom/cssvalue-comparison-expected.txt: Added. * cssom/cssvalue-comparison.html: Added. Canonical link: https://commits.webkit.org/127685@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-11 11:00:54 +00:00
];
for (var index in tests) {
var testMap = tests[index];
for (var key in testMap) {
var testValues = testMap[key];
// Tests for equality.
for(var testIndex in testValues)
test(function() {assert_true(runTest(key, testValues[testIndex], testValues[testIndex], true))}, "Two CSSValues \"" + testValues[testIndex] + "\" for property \"" + key + "\" are equal.");
// Test that comparison of non-equal cssvalues return false.
if (testValues.length > 1)
test(function() {assert_false(runTest(key, testValues[0], testValues[1], false))}, "Two CSSValues \"" + testValues[0] + "\" and \"" + testValues[1] + "\" for property \"" + key + "\" are not equal.");
}
}
done();
}
</script>
</body>
</html>