1. 17 Oct, 2013 1 commit
  2. 11 Feb, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Implement CSSValue::equals(const CSSValue&) to optimise CSSValue comparison · b4b784a2
      commit-queue@webkit.org authored
      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.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b4b784a2
  3. 29 Oct, 2012 1 commit
    • commit-queue@webkit.org's avatar
      [CSSOM] Extraneous whitespace in CSSImportRule.cssText · 759404aa
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=100657
      
      Patch by Glenn Adams <glenn@skynav.com> on 2012-10-29
      Reviewed by Simon Fraser.
      
      Source/WebCore:
      
      Remove extraneous whitespace when serializing CSSImportRule.cssText when
      media list is empty.
      
      Test: cssom/cssimportrule-media.html
      
      * css/CSSImportRule.cpp:
      (WebCore::CSSImportRule::cssText):
      Don't append extra whitespace if mediaText is empty.
      
      LayoutTests:
      
      Test (from CSS WG) that checks serializion of CSSImportRule.cssText.
      
      * http/tests/css/shared-stylesheet-mutation-expected.txt:
      * http/tests/css/shared-stylesheet-mutation-preconstruct-expected.txt:
      Fix expected output to match removal of extraneous space.
      
      * cssom/cssimportrule-media-expected.txt: Added.
      * cssom/cssimportrule-media.html: Added.
      * cssom/resources/import.css: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      759404aa
  4. 24 Aug, 2012 1 commit
    • commit-queue@webkit.org's avatar
      CSSStyleDeclaration.cssText should not contain extraneous whitespace in final delimiter · 1ac47abc
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=94633
      
      Patch by Glenn Adams <glenn@skynav.com> on 2012-08-24
      Reviewed by Benjamin Poulain.
      
      Ensure cssText final delimiter does not contain extraneous space character after semicolon.
      
      Source/WebCore:
      
      Test: cssom/cssstyledeclaration-csstext-final-delimiter.html
      
      * css/CSSFontFaceRule.cpp:
      (WebCore::CSSFontFaceRule::cssText):
      Conditionally add SPACE in serialized rule since asText() no longer
      contains extra space.
      Construct result using StringBuilder.
      
      * css/CSSPageRule.cpp:
      (WebCore::CSSPageRule::cssText):
      Conditionally add SPACE in serialized rule since asText() no longer
      contains extra space.
      Construct result using StringBuilder.
      
      * css/CSSProperty.cpp:
      (WebCore::CSSProperty::cssText):
      Ensure serialized property does longer contains extra space in cssText.
      Construct result using StringBuilder.
      
      * css/CSSStyleRule.cpp:
      (WebCore::CSSStyleRule::cssText):
      Conditionally add SPACE in serialized rule since asText() no longer
      contains extra space.
      Construct result using StringBuilder.
      
      * css/CSSStyleSheet.cpp:
      (WebCore::CSSStyleSheet::addRule):
      Conditionally add SPACE in reserialized rule in case passed style no
      longer contains extra space.  Note that if it does already contain an
      extra space that inserting an extra space here is harmless (i.e., is
      effectively normalized during parse).
      Construct result using StringBuilder.
      
      * css/StylePropertySet.cpp:
      (WebCore::StylePropertySet::asText):
      Ensure serialized property set does longer contains extra space in final
      delimiter.
      Construct result using StringBuilder.
      
      * css/WebKitCSSKeyframeRule.cpp:
      (WebCore::StyleKeyframe::cssText):
      Conditionally add SPACE in serialized rule since asText() no longer
      contains extra space.
      Construct result using StringBuilder.
      
      * editing/ApplyStyleCommand.cpp:
      (WebCore::ApplyStyleCommand::addBlockStyle):
      Conditionally add SPACE in block style since cssText no longer contains
      extra space.
      Construct result using StringBuilder.
      (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
      Conditionally add SPACE in pre-existing inline style since cssText no
      longer contains extra space.
      Construct result using StringBuilder.
      
      LayoutTests:
      
      * cssom/README.txt: Added.
      * cssom/cssstyledeclaration-csstext-final-delimiter-expected.txt: Added.
      * cssom/cssstyledeclaration-csstext-final-delimiter.html: Added.
      * editing/deleting/delete-line-break-before-underlined-content-expected.txt: Remove extraneous space.
      * editing/deleting/delete-line-break-between-paragraphs-with-same-style-expected.txt: ditto
      * editing/deleting/deleting-line-break-preserves-underline-color-expected.txt: ditto
      * editing/deleting/merge-paragraph-from-h6-with-style-2-expected.txt: ditto
      * editing/deleting/merge-paragraph-from-h6-with-style-expected.txt: ditto
      * editing/deleting/merge-paragraph-from-p-with-style-3-expected.txt: ditto
      * editing/deleting/merge-paragraph-from-p-with-style-expected.txt: ditto
      * editing/deleting/paste-with-transparent-background-color-expected.txt: ditto
      * editing/execCommand/insert-list-with-noneditable-content-expected.txt: ditto
      * editing/execCommand/script-tests/toggle-link.js: ditto
      * editing/execCommand/script-tests/toggle-unlink.js: ditto
      * editing/execCommand/toggle-link-expected.txt: ditto
      * editing/execCommand/toggle-unlink-expected.txt: ditto
      * editing/inserting/page-zoom-font-size-expected.txt: ditto
      * editing/pasteboard/19644-2-expected.txt: ditto
      * editing/pasteboard/5761530-1-expected.txt: ditto
      * editing/pasteboard/5780697-2-expected.txt: ditto
      * editing/pasteboard/copy-null-characters-expected.txt: ditto
      * editing/pasteboard/copy-paste-bidi-expected.txt: ditto
      * editing/pasteboard/copy-text-with-backgroundcolor-expected.txt: ditto
      * editing/pasteboard/data-transfer-items-expected.txt: ditto
      * editing/pasteboard/display-block-on-spans-expected.txt: ditto
      * editing/pasteboard/do-not-copy-unnecessary-styles-2-expected.txt: ditto
      * editing/pasteboard/do-not-copy-unnecessary-styles-expected.txt: ditto
      * editing/pasteboard/drag-drop-url-with-style-expected.txt: ditto
      * editing/pasteboard/onpaste-text-html-expected.txt: ditto
      * editing/pasteboard/paste-4039777-fix-expected.txt: ditto
      * editing/pasteboard/paste-and-sanitize-expected.txt: ditto
      * editing/pasteboard/paste-and-sanitize.html: ditto
      * editing/pasteboard/paste-list-003-expected.txt: ditto
      * editing/pasteboard/paste-noscript-expected.txt: ditto
      * editing/pasteboard/paste-noscript-xhtml-expected.txt: ditto
      * editing/pasteboard/paste-table-002-expected.txt: ditto
      * editing/pasteboard/paste-text-with-style-4-expected.txt: ditto
      * editing/pasteboard/paste-text-with-style-5-expected.txt: ditto
      * editing/pasteboard/paste-with-redundant-style-expected.txt: ditto
      * editing/pasteboard/preserve-underline-color-expected.txt: ditto
      * editing/pasteboard/style-from-rules-expected.txt: ditto
      * editing/pasteboard/testcase-9507-expected.txt: ditto
      * editing/style/non-inheritable-styles-expected.txt: ditto
      * editing/style/push-down-font-styles-expected.txt: ditto
      * editing/style/push-down-implicit-styles-around-list-expected.txt: ditto
      * editing/style/push-down-implicit-styles-expected.txt: ditto
      * editing/style/push-down-inline-styles-expected.txt: ditto
      * editing/style/script-tests/push-down-font-styles.js: ditto
      * editing/style/script-tests/push-down-implicit-styles-around-list.js: ditto
      * editing/style/script-tests/push-down-implicit-styles.js: ditto
      * editing/style/script-tests/push-down-inline-styles.js: ditto
      * editing/undo/remove-css-property-and-remove-style-expected.txt: ditto
      * editing/undo/replace-by-span-then-remove-expected.txt: ditto
      * editing/undo/replace-by-span-then-remove.html: ditto
      * fast/css/background-position-serialize.html: ditto
      * fast/css/counters/counter-cssText-expected.txt: ditto
      * fast/css/counters/counter-cssText.html: ditto
      * fast/css/parse-border-image-repeat-null-crash-expected.txt: ditto
      * fast/css/remove-shorthand.html: ditto
      * fast/dom/Element/scrollWidth.html: ditto
      * fast/dom/HTMLMeterElement/meter-element-markup-expected.txt: ditto
      * fast/dom/HTMLProgressElement/progress-element-markup-expected.txt: ditto
      * fast/dom/attr-style-too-lazy-expected.txt: ditto
      * fast/dom/attr-style-too-lazy.html: ditto
      * fast/dom/css-set-property-exception-expected.txt: ditto
      * fast/fast/events/ondrop-text-html-expected.txt: ditto
      * fast/mutation/observe-attributes-expected.txt: ditto
      * fast/mutation/observe-attributes.html: ditto
      * inspector/elements/insert-node-expected.txt: ditto
      * inspector/styles/styles-update-from-js-expected.txt: ditto
      * platform/chromium-win/editing/pasteboard/5780697-2-expected.txt: ditto
      * platform/efl/fast/dom/HTMLMeterElement/meter-element-markup-expected.txt: ditto
      * platform/mac/editing/pasteboard/5761530-1-expected.txt: ditto
      * platform/qt/editing/pasteboard/5761530-1-expected.txt: ditto
      * platform/qt/editing/pasteboard/5780697-2-expected.txt: ditto
      * svg/webarchive/svg-script-subresouces-expected.webarchive: ditto
      * webarchive/test-link-rel-icon-beforeload-expected.webarchive: ditto
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1ac47abc