[webkit-changes] [WebKit/WebKit] 0e80c5: Refactor ComputedStyleExtractor into its own sourc...

Antoine Quint noreply at github.com
Tue Sep 20 22:53:09 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0e80c5909d7e9b50f755b49080ca50dd378ba625
      https://github.com/WebKit/WebKit/commit/0e80c5909d7e9b50f755b49080ca50dd378ba625
  Author: Antoine Quint <graouts at apple.com>
  Date:   2022-09-20 (Tue, 20 Sep 2022)

  Changed paths:
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/animation/KeyframeEffect.cpp
    M Source/WebCore/animation/WebAnimation.cpp
    M Source/WebCore/css/CSSComputedStyleDeclaration.cpp
    M Source/WebCore/css/CSSComputedStyleDeclaration.h
    A Source/WebCore/css/ComputedStyleExtractor.cpp
    A Source/WebCore/css/ComputedStyleExtractor.h
    M Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.cpp
    M Source/WebCore/html/CustomPaintImage.cpp
    M Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp
    M Source/WebCore/rendering/style/RenderStyle.cpp
    M Source/WebCore/svg/SVGElement.cpp
    M Source/WebCore/svg/properties/SVGPropertyAnimator.h

  Log Message:
  -----------
  Refactor ComputedStyleExtractor into its own source file
https://bugs.webkit.org/show_bug.cgi?id=245431

Reviewed by Antti Koivisto.

ComputedStyleExtractor has always been contained in CSSComputedStyleDeclaration.h but
it's a public class and deserves to be in its own source file. Besides, it's much of
the code previously found in CSSComputedStyleDeclaration.cpp.

* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFilter):
* Source/WebCore/animation/KeyframeEffect.cpp:
* Source/WebCore/animation/WebAnimation.cpp:
* Source/WebCore/css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::CSSComputedStyleDeclaration):
(WebCore::CSSComputedStyleDeclaration::create):
(WebCore::CSSComputedStyleDeclaration::ref):
(WebCore::CSSComputedStyleDeclaration::deref):
(WebCore::CSSComputedStyleDeclaration::cssText const):
(WebCore::CSSComputedStyleDeclaration::setCssText):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue const):
(WebCore::CSSComputedStyleDeclaration::length const):
(WebCore::valueForRepeatRule): Deleted.
(WebCore::valueForImageSliceSide): Deleted.
(WebCore::valueForNinePieceImageSlice): Deleted.
(WebCore::valueForNinePieceImageQuad): Deleted.
(WebCore::valueForNinePieceImageRepeat): Deleted.
(WebCore::valueForNinePieceImage): Deleted.
(WebCore::zoomAdjustedPixelValue): Deleted.
(WebCore::zoomAdjustedNumberValue): Deleted.
(WebCore::zoomAdjustedPixelValueForLength): Deleted.
(WebCore::valueForReflection): Deleted.
(WebCore::createPositionListForLayer): Deleted.
(WebCore::createSingleAxisPositionValueForLayer): Deleted.
(WebCore::getOffsetComputedLength): Deleted.
(WebCore::getOffsetUsedStyleRelative): Deleted.
(WebCore::getOffsetUsedStyleOutOfFlowPositioned): Deleted.
(WebCore::positionOffsetValue): Deleted.
(WebCore::ComputedStyleExtractor::currentColorOrValidColor const): Deleted.
(WebCore::percentageOrZoomAdjustedValue): Deleted.
(WebCore::autoOrZoomAdjustedValue): Deleted.
(WebCore::borderRadiusCornerValues): Deleted.
(WebCore::valueForQuotes): Deleted.
(WebCore::borderRadiusCornerValue): Deleted.
(WebCore::borderRadiusShorthandValue): Deleted.
(WebCore::sizingBox): Deleted.
(WebCore::matrixTransformValue): Deleted.
(WebCore::rendererCanBeTransformed): Deleted.
(WebCore::computedTransform): Deleted.
(WebCore::computedTranslate): Deleted.
(WebCore::computedScale): Deleted.
(WebCore::computedRotate): Deleted.
(WebCore::adjustLengthForZoom): Deleted.
(WebCore::ComputedStyleExtractor::valueForShadow): Deleted.
(WebCore::ComputedStyleExtractor::valueForFilter): Deleted.
(WebCore::specifiedValueForGridTrackBreadth): Deleted.
(WebCore::specifiedValueForGridTrackSize): Deleted.
(WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector): Deleted.
(WebCore::OrderedNamedLinesCollector::isEmpty const): Deleted.
(WebCore::OrderedNamedLinesCollector::namedGridLineCount const): Deleted.
(): Deleted.
(WebCore::OrderedNamedLinesCollectorInGridLayout::OrderedNamedLinesCollectorInGridLayout): Deleted.
(WebCore::OrderedNamedLinesCollectorInSubgridLayout::OrderedNamedLinesCollectorInSubgridLayout): Deleted.
(WebCore::OrderedNamedLinesCollector::appendLines const): Deleted.
(WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const): Deleted.
(WebCore::OrderedNamedLinesCollectorInSubgridLayout::collectLineNamesForIndex const): Deleted.
(WebCore::addValuesForNamedGridLinesAtIndex): Deleted.
(WebCore::valueForGridTrackSizeList): Deleted.
(WebCore::populateGridTrackList): Deleted.
(WebCore::populateSubgridLineNameList): Deleted.
(WebCore::valueForGridTrackList): Deleted.
(WebCore::valueForGridPosition): Deleted.
(WebCore::createTransitionPropertyValue): Deleted.
(WebCore::valueForScrollSnapType): Deleted.
(WebCore::valueForScrollSnapAlignment): Deleted.
(WebCore::willChangePropertyValue): Deleted.
(WebCore::appendLigaturesValue): Deleted.
(WebCore::fontVariantLigaturesPropertyValue): Deleted.
(WebCore::fontVariantPositionPropertyValue): Deleted.
(WebCore::fontVariantCapsPropertyValue): Deleted.
(WebCore::fontVariantNumericPropertyValue): Deleted.
(WebCore::fontVariantAlternatesPropertyValue): Deleted.
(WebCore::fontVariantEastAsianPropertyValue): Deleted.
(WebCore::valueForAnimationDuration): Deleted.
(WebCore::valueForAnimationDelay): Deleted.
(WebCore::valueForAnimationIterationCount): Deleted.
(WebCore::valueForAnimationDirection): Deleted.
(WebCore::valueForAnimationFillMode): Deleted.
(WebCore::valueForAnimationComposition): Deleted.
(WebCore::valueForAnimationPlayState): Deleted.
(WebCore::valueForAnimationName): Deleted.
(WebCore::valueForAnimationTimingFunction): Deleted.
(WebCore::ComputedStyleExtractor::addValueForAnimationPropertyToList): Deleted.
(WebCore::valueListForAnimationOrTransitionProperty): Deleted.
(WebCore::animationShorthandValue): Deleted.
(WebCore::createLineBoxContainValue): Deleted.
(WebCore::styleElementForNode): Deleted.
(WebCore::valueForPosition): Deleted.
(WebCore::valueForPositionOrAuto): Deleted.
(WebCore::valueIDForRaySize): Deleted.
(WebCore::valueForPathOperation): Deleted.
(WebCore::valueForContainIntrinsicSize): Deleted.
(WebCore::ComputedStyleExtractor::ComputedStyleExtractor): Deleted.
(WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword): Deleted.
(WebCore::ComputedStyleExtractor::useFixedFontDefaultSize): Deleted.
(WebCore::identifierForFamily): Deleted.
(WebCore::valueForFamily): Deleted.
(WebCore::touchActionFlagsToCSSValue): Deleted.
(WebCore::renderTextDecorationLineFlagsToCSSValue): Deleted.
(WebCore::renderTextDecorationStyleFlagsToCSSValue): Deleted.
(WebCore::renderTextDecorationSkipToCSSValue): Deleted.
(WebCore::textUnderlineOffsetToCSSValue): Deleted.
(WebCore::textDecorationThicknessToCSSValue): Deleted.
(WebCore::renderEmphasisPositionFlagsToCSSValue): Deleted.
(WebCore::valueForTextEmphasisStyle): Deleted.
(WebCore::speakAsToCSSValue): Deleted.
(WebCore::hangingPunctuationToCSSValue): Deleted.
(WebCore::fillRepeatToCSSValue): Deleted.
(WebCore::maskSourceTypeToCSSValue): Deleted.
(WebCore::maskModeToCSSValue): Deleted.
(WebCore::fillSizeToCSSValue): Deleted.
(WebCore::altTextToCSSValue): Deleted.
(WebCore::contentToCSSValue): Deleted.
(WebCore::counterToCSSValue): Deleted.
(WebCore::fontFamilyListFromStyle): Deleted.
(WebCore::fontFamilyFromStyle): Deleted.
(WebCore::lineHeightFromStyle): Deleted.
(WebCore::fontSizeFromStyle): Deleted.
(WebCore::fontPaletteFromStyle): Deleted.
(WebCore::ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue): Deleted.
(WebCore::fontNonKeywordWeightFromStyle): Deleted.
(WebCore::ComputedStyleExtractor::fontWeightFromStyleValue): Deleted.
(WebCore::ComputedStyleExtractor::fontNonKeywordStretchFromStyleValue): Deleted.
(WebCore::ComputedStyleExtractor::fontStretchFromStyleValue): Deleted.
(WebCore::fontStretchFromStyle): Deleted.
(WebCore::ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue): Deleted.
(WebCore::ComputedStyleExtractor::fontStyleFromStyleValue): Deleted.
(WebCore::fontStyleFromStyle): Deleted.
(WebCore::ComputedStyleExtractor::fontVariantShorthandValue): Deleted.
(WebCore::fontSynthesisFromStyle): Deleted.
(WebCore::zoomAdjustedPaddingOrMarginPixelValue): Deleted.
(WebCore::paddingOrMarginIsRendererDependent): Deleted.
(WebCore::positionOffsetValueIsRendererDependent): Deleted.
(WebCore::convertToPageBreak): Deleted.
(WebCore::convertToColumnBreak): Deleted.
(WebCore::isNonReplacedInline): Deleted.
(WebCore::isLayoutDependent): Deleted.
(WebCore::ComputedStyleExtractor::styledRenderer const): Deleted.
(WebCore::isImplicitlyInheritedGridOrFlexProperty): Deleted.
(WebCore::nonInheritedColorPropertyHasValueCurrentColor): Deleted.
(WebCore::hasValidStyleForProperty): Deleted.
(WebCore::updateStyleIfNeededForProperty): Deleted.
(WebCore::computeRenderStyleForProperty): Deleted.
(WebCore::shapePropertyValue): Deleted.
(WebCore::valueForItemPositionWithOverflowAlignment): Deleted.
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment): Deleted.
(WebCore::valueForOffsetRotate): Deleted.
(WebCore::valueForOffsetShorthand): Deleted.
(WebCore::paintOrder): Deleted.
(WebCore::isFlexOrGridItem): Deleted.
(WebCore::ComputedStyleExtractor::customPropertyValue): Deleted.
(WebCore::ComputedStyleExtractor::customPropertyText): Deleted.
(WebCore::fontShorthandValueForSelectionProperties): Deleted.
(WebCore::ComputedStyleExtractor::propertyValue): Deleted.
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle): Deleted.
(WebCore::ComputedStyleExtractor::propertyMatches): Deleted.
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties): Deleted.
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand): Deleted.
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand): Deleted.
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand): Deleted.
(WebCore::ComputedStyleExtractor::copyPropertiesInSet): Deleted.
(WebCore::ComputedStyleExtractor::copyProperties): Deleted.
(WebCore::ComputedStyleExtractor::getLayerCount): Deleted.
(WebCore::ComputedStyleExtractor::getFillLayerPropertyShorthandValue): Deleted.
(WebCore::ComputedStyleExtractor::getBackgroundShorthandValue): Deleted.
(WebCore::ComputedStyleExtractor::getMaskShorthandValue): Deleted.
* Source/WebCore/css/CSSComputedStyleDeclaration.h:
* Source/WebCore/css/ComputedStyleExtractor.cpp: Copied from Source/WebCore/css/CSSComputedStyleDeclaration.cpp.
(WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector):
(WebCore::OrderedNamedLinesCollector::isEmpty const):
(WebCore::OrderedNamedLinesCollector::namedGridLineCount const):
(WebCore::OrderedNamedLinesCollectorInGridLayout::OrderedNamedLinesCollectorInGridLayout):
(WebCore::OrderedNamedLinesCollectorInSubgridLayout::OrderedNamedLinesCollectorInSubgridLayout):
(WebCore::OrderedNamedLinesCollector::appendLines const):
(WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const):
(WebCore::OrderedNamedLinesCollectorInSubgridLayout::collectLineNamesForIndex const):
(WebCore::valueForRepeatRule):
(WebCore::valueForImageSliceSide):
(WebCore::valueForNinePieceImageSlice):
(WebCore::valueForNinePieceImageQuad):
(WebCore::valueForNinePieceImageRepeat):
(WebCore::valueForNinePieceImage):
(WebCore::ComputedStyleExtractor::zoomAdjustedPixelValue):
(WebCore::zoomAdjustedNumberValue):
(WebCore::ComputedStyleExtractor::zoomAdjustedPixelValueForLength):
(WebCore::valueForReflection):
(WebCore::createPositionListForLayer):
(WebCore::createSingleAxisPositionValueForLayer):
(WebCore::getOffsetComputedLength):
(WebCore::getOffsetUsedStyleRelative):
(WebCore::getOffsetUsedStyleOutOfFlowPositioned):
(WebCore::positionOffsetValue):
(WebCore::ComputedStyleExtractor::currentColorOrValidColor const):
(WebCore::percentageOrZoomAdjustedValue):
(WebCore::autoOrZoomAdjustedValue):
(WebCore::borderRadiusCornerValues):
(WebCore::valueForQuotes):
(WebCore::borderRadiusCornerValue):
(WebCore::borderRadiusShorthandValue):
(WebCore::sizingBox):
(WebCore::matrixTransformValue):
(WebCore::rendererCanBeTransformed):
(WebCore::computedTransform):
(WebCore::computedTranslate):
(WebCore::computedScale):
(WebCore::computedRotate):
(WebCore::adjustLengthForZoom):
(WebCore::ComputedStyleExtractor::valueForShadow):
(WebCore::ComputedStyleExtractor::valueForFilter):
(WebCore::specifiedValueForGridTrackBreadth):
(WebCore::specifiedValueForGridTrackSize):
(WebCore::addValuesForNamedGridLinesAtIndex):
(WebCore::valueForGridTrackSizeList):
(WebCore::populateGridTrackList):
(WebCore::populateSubgridLineNameList):
(WebCore::valueForGridTrackList):
(WebCore::valueForGridPosition):
(WebCore::createTransitionPropertyValue):
(WebCore::valueForScrollSnapType):
(WebCore::valueForScrollSnapAlignment):
(WebCore::willChangePropertyValue):
(WebCore::appendLigaturesValue):
(WebCore::fontVariantLigaturesPropertyValue):
(WebCore::fontVariantPositionPropertyValue):
(WebCore::fontVariantCapsPropertyValue):
(WebCore::fontVariantNumericPropertyValue):
(WebCore::fontVariantAlternatesPropertyValue):
(WebCore::fontVariantEastAsianPropertyValue):
(WebCore::valueForAnimationDuration):
(WebCore::valueForAnimationDelay):
(WebCore::valueForAnimationIterationCount):
(WebCore::valueForAnimationDirection):
(WebCore::valueForAnimationFillMode):
(WebCore::valueForAnimationComposition):
(WebCore::valueForAnimationPlayState):
(WebCore::valueForAnimationName):
(WebCore::valueForAnimationTimingFunction):
(WebCore::ComputedStyleExtractor::addValueForAnimationPropertyToList):
(WebCore::valueListForAnimationOrTransitionProperty):
(WebCore::animationShorthandValue):
(WebCore::createLineBoxContainValue):
(WebCore::styleElementForNode):
(WebCore::valueForPosition):
(WebCore::valueForPositionOrAuto):
(WebCore::valueIDForRaySize):
(WebCore::valueForPathOperation):
(WebCore::valueForContainIntrinsicSize):
(WebCore::ComputedStyleExtractor::ComputedStyleExtractor):
(WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
(WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
(WebCore::identifierForFamily):
(WebCore::valueForFamily):
(WebCore::touchActionFlagsToCSSValue):
(WebCore::renderTextDecorationLineFlagsToCSSValue):
(WebCore::renderTextDecorationStyleFlagsToCSSValue):
(WebCore::renderTextDecorationSkipToCSSValue):
(WebCore::textUnderlineOffsetToCSSValue):
(WebCore::textDecorationThicknessToCSSValue):
(WebCore::renderEmphasisPositionFlagsToCSSValue):
(WebCore::valueForTextEmphasisStyle):
(WebCore::speakAsToCSSValue):
(WebCore::hangingPunctuationToCSSValue):
(WebCore::fillRepeatToCSSValue):
(WebCore::maskSourceTypeToCSSValue):
(WebCore::maskModeToCSSValue):
(WebCore::fillSizeToCSSValue):
(WebCore::altTextToCSSValue):
(WebCore::contentToCSSValue):
(WebCore::counterToCSSValue):
(WebCore::fontFamilyListFromStyle):
(WebCore::fontFamilyFromStyle):
(WebCore::lineHeightFromStyle):
(WebCore::fontSizeFromStyle):
(WebCore::fontPaletteFromStyle):
(WebCore::ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue):
(WebCore::fontNonKeywordWeightFromStyle):
(WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
(WebCore::ComputedStyleExtractor::fontNonKeywordStretchFromStyleValue):
(WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
(WebCore::fontStretchFromStyle):
(WebCore::ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue):
(WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
(WebCore::fontStyleFromStyle):
(WebCore::ComputedStyleExtractor::fontVariantShorthandValue):
(WebCore::fontSynthesisFromStyle):
(WebCore::zoomAdjustedPaddingOrMarginPixelValue):
(WebCore::paddingOrMarginIsRendererDependent):
(WebCore::positionOffsetValueIsRendererDependent):
(WebCore::convertToPageBreak):
(WebCore::convertToColumnBreak):
(WebCore::isNonReplacedInline):
(WebCore::isLayoutDependent):
(WebCore::ComputedStyleExtractor::styledRenderer const):
(WebCore::isImplicitlyInheritedGridOrFlexProperty):
(WebCore::nonInheritedColorPropertyHasValueCurrentColor):
(WebCore::hasValidStyleForProperty):
(WebCore::ComputedStyleExtractor::updateStyleIfNeededForProperty):
(WebCore::computeRenderStyleForProperty):
(WebCore::shapePropertyValue):
(WebCore::valueForItemPositionWithOverflowAlignment):
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
(WebCore::valueForOffsetRotate):
(WebCore::valueForOffsetShorthand):
(WebCore::paintOrder):
(WebCore::isFlexOrGridItem):
(WebCore::ComputedStyleExtractor::customPropertyValue):
(WebCore::ComputedStyleExtractor::customPropertyText):
(WebCore::fontShorthandValueForSelectionProperties):
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
(WebCore::ComputedStyleExtractor::propertyMatches):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
(WebCore::ComputedStyleExtractor::copyPropertiesInSet):
(WebCore::ComputedStyleExtractor::copyProperties):
(WebCore::ComputedStyleExtractor::getLayerCount):
(WebCore::ComputedStyleExtractor::getFillLayerPropertyShorthandValue):
(WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
(WebCore::ComputedStyleExtractor::getMaskShorthandValue):
* Source/WebCore/css/ComputedStyleExtractor.h: Copied from Source/WebCore/css/CSSComputedStyleDeclaration.h.
* Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.cpp:
(WebCore::ComputedStylePropertyMapReadOnly::get const):
(WebCore::ComputedStylePropertyMapReadOnly::getAll const):
(WebCore::ComputedStylePropertyMapReadOnly::entries const):
* Source/WebCore/html/CustomPaintImage.cpp:
(WebCore::extractComputedProperty):
* Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp:
* Source/WebCore/rendering/style/RenderStyle.cpp:
* Source/WebCore/svg/SVGElement.cpp:
(WebCore::SVGElement::colorInterpolation const):
* Source/WebCore/svg/properties/SVGPropertyAnimator.h:

Canonical link: https://commits.webkit.org/254712@main




More information about the webkit-changes mailing list