[webkit-changes] [WebKit/WebKit] f5fc58: Add CSSCounterValue, CSSQuadValue, and CSSRectValu...

Darin Adler noreply at github.com
Sun Feb 12 20:37:47 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f5fc580b14bdbfec2007ccf0c4653bd27f775275
      https://github.com/WebKit/WebKit/commit/f5fc580b14bdbfec2007ccf0c4653bd27f775275
  Author: Darin Adler <darin at apple.com>
  Date:   2023-02-12 (Sun, 12 Feb 2023)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/css/BasicShapeFunctions.cpp
    M Source/WebCore/css/BasicShapeFunctions.h
    M Source/WebCore/css/CSSBasicShapes.cpp
    M Source/WebCore/css/CSSBasicShapes.h
    M Source/WebCore/css/CSSBorderImageSliceValue.cpp
    M Source/WebCore/css/CSSBorderImageSliceValue.h
    M Source/WebCore/css/CSSBorderImageWidthValue.cpp
    M Source/WebCore/css/CSSBorderImageWidthValue.h
    M Source/WebCore/css/CSSComputedStyleDeclaration.cpp
    M Source/WebCore/css/CSSContentDistributionValue.cpp
    M Source/WebCore/css/CSSCounterStyleDescriptors.cpp
    M Source/WebCore/css/CSSCounterStyleRule.cpp
    M Source/WebCore/css/CSSCounterStyleRule.h
    A Source/WebCore/css/CSSCounterValue.cpp
    A Source/WebCore/css/CSSCounterValue.h
    M Source/WebCore/css/CSSFontVariantLigaturesParser.h
    M Source/WebCore/css/CSSFontVariantNumericParser.h
    M Source/WebCore/css/CSSFunctionValue.cpp
    M Source/WebCore/css/CSSFunctionValue.h
    M Source/WebCore/css/CSSGradientValue.cpp
    M Source/WebCore/css/CSSGradientValue.h
    M Source/WebCore/css/CSSGridAutoRepeatValue.cpp
    M Source/WebCore/css/CSSGridAutoRepeatValue.h
    M Source/WebCore/css/CSSGridIntegerRepeatValue.cpp
    M Source/WebCore/css/CSSGridIntegerRepeatValue.h
    M Source/WebCore/css/CSSGridLineNamesValue.cpp
    M Source/WebCore/css/CSSGridLineNamesValue.h
    M Source/WebCore/css/CSSGridTemplateAreasValue.cpp
    M Source/WebCore/css/CSSGridTemplateAreasValue.h
    M Source/WebCore/css/CSSImageSetValue.cpp
    M Source/WebCore/css/CSSImageSetValue.h
    M Source/WebCore/css/CSSImageValue.cpp
    M Source/WebCore/css/CSSPrimitiveValue.cpp
    M Source/WebCore/css/CSSPrimitiveValue.h
    M Source/WebCore/css/CSSPrimitiveValueMappings.h
    A Source/WebCore/css/CSSQuadValue.cpp
    A Source/WebCore/css/CSSQuadValue.h
    A Source/WebCore/css/CSSRectValue.cpp
    A Source/WebCore/css/CSSRectValue.h
    M Source/WebCore/css/CSSReflectValue.cpp
    M Source/WebCore/css/CSSReflectValue.h
    M Source/WebCore/css/CSSSubgridValue.cpp
    M Source/WebCore/css/CSSSubgridValue.h
    M Source/WebCore/css/CSSToStyleMap.cpp
    M Source/WebCore/css/CSSToStyleMap.h
    M Source/WebCore/css/CSSTransformListValue.cpp
    M Source/WebCore/css/CSSTransformListValue.h
    M Source/WebCore/css/CSSUnits.cpp
    M Source/WebCore/css/CSSUnits.h
    M Source/WebCore/css/CSSValue.cpp
    M Source/WebCore/css/CSSValue.h
    M Source/WebCore/css/CSSValueList.cpp
    M Source/WebCore/css/CSSValueList.h
    M Source/WebCore/css/CSSValuePair.cpp
    M Source/WebCore/css/CSSValuePair.h
    M Source/WebCore/css/CSSValuePool.cpp
    M Source/WebCore/css/ComputedStyleExtractor.cpp
    M Source/WebCore/css/ComputedStyleExtractor.h
    M Source/WebCore/css/Counter.h
    M Source/WebCore/css/DeprecatedCSSOMCounter.h
    M Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.cpp
    M Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.h
    M Source/WebCore/css/DeprecatedCSSOMRGBColor.h
    M Source/WebCore/css/DeprecatedCSSOMRect.h
    M Source/WebCore/css/DeprecatedCSSOMValueList.cpp
    M Source/WebCore/css/DeprecatedCSSOMValueList.h
    R Source/WebCore/css/Pair.h
    A Source/WebCore/css/Quad.h
    M Source/WebCore/css/Rect.h
    A Source/WebCore/css/RectBase.h
    M Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
    M Source/WebCore/css/ShorthandSerializer.cpp
    M Source/WebCore/css/StyleProperties.cpp
    M Source/WebCore/css/TransformFunctions.cpp
    M Source/WebCore/css/calc/CSSCalcCategoryMapping.cpp
    M Source/WebCore/css/calc/CSSCalcExpressionNode.h
    M Source/WebCore/css/calc/CSSCalcOperationNode.cpp
    M Source/WebCore/css/calc/CSSCalcOperationNode.h
    M Source/WebCore/css/calc/CSSCalcValue.cpp
    M Source/WebCore/css/calc/CSSCalcValue.h
    M Source/WebCore/css/color/CSSUnresolvedColor.h
    M Source/WebCore/css/parser/CSSParser.cpp
    M Source/WebCore/css/parser/CSSParser.h
    M Source/WebCore/css/parser/CSSParserFastPaths.cpp
    M Source/WebCore/css/parser/CSSParserImpl.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.cpp
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.h
    M Source/WebCore/css/process-css-properties.py
    M Source/WebCore/css/query/GenericMediaQueryEvaluator.cpp
    M Source/WebCore/css/typedom/CSSKeywordValue.cpp
    M Source/WebCore/css/typedom/CSSStyleValue.cpp
    M Source/WebCore/css/typedom/CSSStyleValueFactory.cpp
    M Source/WebCore/css/typedom/CSSUnitValue.cpp
    M Source/WebCore/css/typedom/MainThreadStylePropertyMapReadOnly.cpp
    M Source/WebCore/css/typedom/StylePropertyMap.cpp
    M Source/WebCore/css/typedom/numeric/CSSMathValue.h
    M Source/WebCore/css/typedom/transform/CSSMatrixComponent.cpp
    M Source/WebCore/editing/EditingStyle.cpp
    M Source/WebCore/editing/cocoa/HTMLConverter.mm
    M Source/WebCore/html/HTMLElement.cpp
    M Source/WebCore/html/HTMLHRElement.cpp
    M Source/WebCore/platform/graphics/WindRule.h
    M Source/WebCore/rendering/EventRegion.h
    M Source/WebCore/rendering/style/BasicShapes.h
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/rendering/style/StyleCrossfadeImage.cpp
    M Source/WebCore/rendering/style/StyleGradientImage.cpp
    M Source/WebCore/style/ColorFromPrimitiveValue.cpp
    M Source/WebCore/style/StyleBuilderConverter.h
    M Source/WebCore/style/StyleBuilderCustom.h
    M Source/WebCore/style/StyleResolver.cpp
    M Source/WebCore/style/StyleResolver.h
    M Source/WebCore/svg/SVGFontFaceSrcElement.cpp
    M Source/WebCore/svg/SVGPathUtilities.cpp
    M Source/WebCore/svg/SVGPathUtilities.h
    M Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Tools/TestWebKitAPI/Tests/WebCore/CSSParser.cpp

  Log Message:
  -----------
  Add CSSCounterValue, CSSQuadValue, and CSSRectValue, and use CSSValuePair
https://bugs.webkit.org/show_bug.cgi?id=251568
rdar://problem/104946560

Reviewed by Sam Weinig.

CSSPrimitiveValue and CSSValue both support polymorphic values. In the future
new types of CSS value should derive from CSSValue, not CSSPrimitiveValue.
This patch breaks out counters, pairs, quads, shapes, and rects, and stops using
CSSPrimitiveValue for them. One benefit here is memory saving; these new
objects are smaller than the corresponding CSSPrimitiveValue objects were.

The main risk here is that CSSPrimitiveValue::customCSSText has a serialization
memoizing scheme that these other classes do not. It would be easy to make them
do this optimization if needed. Performance testing should be used to prove we
do not need that.

Because more value types, particularly CSSValuePair, are not CSSPrimitiveValue,
this means changing many call sites that use CSSPrimitiveValue to use CSSValue
instead. For a few of the most used types, added functions to CSSValue so we
can use them without doing type casts; these functions require that the caller
first do a type check like isPair before using the first and second functions.

Besides breaking out the new classes, this changes most CSS value classes to
use create functions and be immutable after creation, and makes simpler create
functions for CSSPrimitiveValue. We'll finish this work in future patches.

One of the patterns the new code follows is for types that we want to move,
in create functions and constructors we just use the straight types rather
than rvalue references. This idiom was suggested by Sam Weinig. We still use
move when appropriate to optimize.

This also fixes a bug in parsing of container and container-name noticed
while updating the parser functions to be more consistent and use the new
create functions.

* Source/WebCore/Headers.cmake: Added the source files.
* Source/WebCore/Sources.txt: Ditto.
* Source/WebCore/WebCore.xcodeproj/project.pbxproj: Ditto.

* Source/WebCore/css/BasicShapeFunctions.cpp:
(WebCore::valueForCenterCoordinate): Use CSSValuePair.
(WebCore::copySVGPathByteStream): Return the SVGPathByteStream vector instead
of a unique_ptr.
(WebCore::valueForBasicShape): Use CSSCircleValue, CSSEllipseValue,
CSSPolygonValue, CSSPathValue, and CSSInsetShapeValue.
(WebCore::convertToLength): Take CSSValue.
(WebCore::convertToLengthSize): Take CSSValue and use CSSValue::first and
CSSValue::secont.
(WebCore::convertToCenterCoordinate): Take CSSValue and use CSSValue::isPair,
CSSValue::first, and CSSValue::second.
(WebCore::cssValueToBasicShapeRadius): Take CSSValue.
(WebCore::basicShapeForValue): Take CSSValue and use CSSCircleValue,
CSSEllipseValue, CSSPolygonValue, CSSPathValue, and CSSInsetShapeValue.

* Source/WebCore/css/BasicShapeFunctions.h: Removed unneeded includes and
forward declarations. Use CSSValue.

* Source/WebCore/css/CSSBasicShapes.cpp:
(WebCore::CSSCircleValue::CSSCircleValue): Added.
(WebCore::CSSCircleValue::create): Added.
(WebCore::serializePositionOffset): Use SerializablePositionOffset.
(WebCore::isZeroLength): Added.
(WebCore::buildSerializablePositionOffset): Return SerializablePositionOffset.
(WebCore::buildCircleString): Deleted.
(WebCore::CSSCircleValue::customCSSText const): Updated.
(WebCore::CSSCircleValue::equals const): Updated.
(WebCore::CSSEllipseValue::CSSEllipseValue): Added.
(WebCore::CSSEllipseValue::create): Added.
(WebCore::CSSEllipseValue::customCSSText const): Updated.
(WebCore::CSSEllipseValue::equals const): Updated.
(WebCore::CSSPathValue::CSSPathValue): Added.
(WebCore::CSSPathValue::create): Added.
(WebCore::buildPathString): Deleted.
(WebCore::CSSPathValue::customCSSText const): Updated.
(WebCore::CSSPathValue::equals const): Updated.
(WebCore::CSSPolygonValue::CSSPolygonValue): Added.
(WebCore::CSSPolygonValue::create): Added.
(WebCore::buildPolygonString): Deleted.
(WebCore::CSSPolygonValue::customCSSText const): Updated.
(WebCore::CSSPolygonValue::equals const): Updated.
(WebCore::CSSInsetShapeValue::CSSInsetShapeValue): Added.
(WebCore::CSSInsetShapeValue::create): Added.
(WebCore::updateCornerRadiusWidthAndHeight): Use CSSValue. Removed null checks
since pairs can't contain nulls, and nno null was actually used here anyway.
(WebCore::CSSInsetShapeValue::customCSSText const) Updated.
(WebCore::CSSInsetShapeValue::equals const): Updated.

* Source/WebCore/css/CSSBasicShapes.h: Deleted CSSBasicShape, and
instead derive each shape's class from CSSValue. Rename them to reflect that,
now named CSSInsetShapeValue, CSSCircleValue, CSSEllipseValue, CSSPolygonValue,
and CSSPathValue.

* Source/WebCore/css/CSSBorderImageSliceValue.cpp:
(WebCore::CSSBorderImageSliceValue::CSSBorderImageSliceValue): Use Quad.
(WebCore::CSSBorderImageSliceValue::create): Added. Use Quad.
(WebCore::CSSBorderImageSliceValue::customCSSText const): Updated.
(WebCore::CSSBorderImageSliceValue::equals const): Updated.

* Source/WebCore/css/CSSBorderImageSliceValue.h: Store a Quad instead of
a RefPtr<Quad>. Use private data members.

* Source/WebCore/css/CSSBorderImageWidthValue.cpp:
(WebCore::CSSBorderImageWidthValue::CSSBorderImageWidthValue): Use Quad.
(WebCore::CSSBorderImageWidthValue::create): Added. Use Quad.
(WebCore::CSSBorderImageWidthValue::customCSSText const): Updated.
(WebCore::CSSBorderImageWidthValue::equals const): Updated.

* Source/WebCore/css/CSSBorderImageWidthValue.h: Store a Quad instead of
a RefPtr<Quad>. Use private data members.

* Source/WebCore/css/CSSComputedStyleDeclaration.cpp: Removed unneeded
include.

* Source/WebCore/css/CSSContentDistributionValue.cpp:
(WebCore::CSSContentDistributionValue::CSSContentDistributionValue):
Updated name of ContentDistributionClass.

* Source/WebCore/css/CSSCounterStyleDescriptors.cpp:
(WebCore::translateRangeFromStyleProperties): Update for CSSValuePair.
(WebCore::extractDataFromSystemDescriptor): Ditto.

* Source/WebCore/css/CSSCounterStyleRule.cpp:
(WebCore::toCounterStyleSystemEnum): Update for CSSValuePair.
(WebCore::StyleRuleCounterStyle::newValueInvalidOrEqual const): Dito.
* Source/WebCore/css/CSSCounterStyleRule.h: Ditto.

* Source/WebCore/css/CSSCounterValue.cpp: Added.
* Source/WebCore/css/CSSCounterValue.h: Added.

* Source/WebCore/css/CSSFontVariantLigaturesParser.h:
(WebCore::CSSFontVariantLigaturesParser::consumeLigature): Use
CSSValueListBuilder and create the CSSValueList only at the end.
(WebCore::CSSFontVariantLigaturesParser::finalizeValue): Ditto.
* Source/WebCore/css/CSSFontVariantNumericParser.h:
(WebCore::CSSFontVariantNumericParser::consumeNumeric): Ditto.
(WebCore::CSSFontVariantNumericParser::finalizeValue): Ditto.

* Source/WebCore/css/CSSFunctionValue.cpp:
(WebCore::CSSFunctionValue::CSSFunctionValue): Moved from header.
(WebCore::CSSFunctionValue::create): Ditto.
(WebCore::CSSFunctionValue::customCSSText const): Use serializeItems.
* Source/WebCore/css/CSSFunctionValue.h: Derive from CSSValueContainingVector.

* Source/WebCore/css/CSSGradientValue.cpp:
(WebCore::isCenterPosition): Moved from CSSPrimitiveValue member function
because the function is needed only here, and in future not all valid values
will be CSSPrimitiveValue.
(WebCore::CSSRadialGradientValue::customCSSText const): Use isCenterPosition.
(WebCore::CSSConicGradientValue::customCSSText const): Ditto.

* Source/WebCore/css/CSSGradientValue.h: Use CSSValue.

* Source/WebCore/css/CSSGridAutoRepeatValue.cpp:
(WebCore::CSSGridAutoRepeatValue::CSSGridAutoRepeatValue): Moved from header.
(WebCore::CSSGridAutoRepeatValue::create): Ditto.
(WebCore::CSSGridAutoRepeatValue::autoRepeatID const): Ditto, use boolean.
(WebCore::CSSGridAutoRepeatValue::customCSSText const): Use serializeItems.
(WebCore::CSSGridAutoRepeatValue::equals const): Use itemsEqual.
* Source/WebCore/css/CSSGridAutoRepeatValue.h: Derive from CSSValueContainingVector.

* Source/WebCore/css/CSSGridIntegerRepeatValue.cpp:
(WebCore::CSSGridIntegerRepeatValue::CSSGridIntegerRepeatValue): Moved from header.
(WebCore::CSSGridIntegerRepeatValue::create): Ditto.
(WebCore::CSSGridIntegerRepeatValue::customCSSText const): Use serializeItems.
(WebCore::CSSGridIntegerRepeatValue::equals const): Use itemsEqual.
* Source/WebCore/css/CSSGridIntegerRepeatValue.h: Derive from CSSValueContainingVector.

* Source/WebCore/css/CSSGridLineNamesValue.cpp:
(WebCore::CSSGridLineNamesValue::customCSSText const): Use serializeItems.
(WebCore::CSSGridLineNamesValue::CSSGridLineNamesValue): Use CSSValueContainingVector.
(WebCore::CSSGridLineNamesValue::create): Moved from header.
* Source/WebCore/css/CSSGridLineNamesValue.h: Derive from CSSValueContainingVector.

* Source/WebCore/css/CSSGridTemplateAreasValue.cpp:
(WebCore::CSSGridTemplateAreasValue::CSSGridTemplateAreasValue): Take the map
by value instead of reference and use WTFMove.
(WebCore::CSSGridTemplateAreasValue::create): Added.
(WebCore::stringForPosition): Use auto.
(WebCore::CSSGridTemplateAreasValue::stringForRow const): Made const.
Tweaked StringBuilder use for single characters. Use FixedVector. Use auto.
(WebCore::CSSGridTemplateAreasValue::customCSSText const): Tweaked style.
(WebCore::CSSGridTemplateAreasValue::equals const): Updated for m_map change.
* Source/WebCore/css/CSSGridTemplateAreasValue.h: Updated for the above.
Renamed m_gridAreaMap to m_map.

* Source/WebCore/css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::CSSImageSetValue): Use CSSValueContainingVector.
(WebCore::CSSImageSetValue::customCSSText const): Use ASCIILiteral.
* Source/WebCore/css/CSSImageSetValue.h: Derive from CSSValueContainingVector.

* Source/WebCore/css/CSSImageValue.cpp:
(WebCore::CSSImageValue::createDeprecatedCSSOMWrapper const):
Use CSSPrimitiveValue::createURI.

* Source/WebCore/css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion): Removed CSS_COUNTER,
CSS_PAIR, CSS_QUAD, CSS_RECT, CSS_SHAPE, CSS_UNICODE_RANGE.
(WebCore::isStringType): Ditto.
(WebCore::CSSPrimitiveValue::primitiveType const): Use isCalculated.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Updated Color, CSSCalcValue,
and CSSUnresolvedColor constructors to take values instead of rvalue references.
Removed Counter, Rect, Quad, Pair, CSSBasicShape constructors.
(WebCore::CSSPrimitiveValue::~CSSPrimitiveValue): Removed CSS_COUNTER,
CSS_PAIR, CSS_QUAD, CSS_RECT, CSS_SHAPE, CSS_UNICODE_RANGE. Updated
CSS_UNRESOLVED_COLOR to use new/delete instead of reference counting.
(WebCore::valueFromPool): Added. Helper for the CSSPrimitive::create.
(WebCore::CSSPrimitiveValue::create): Added overloads that take a number
without an explicit type (meaning CSS_NUMBER), a string without an explicit
type (meaning CSS_STRING), and updated the types create functions for
CSSUnresolvedColor. Removed the create function that takes LengthSize and
RenderStyle and creates a pair, moving that to the one place it is used.
Removed the create functions for Counter, Pair, Quad, and Rect.
(WebCore::CSSPrimitiveValue::createAttr): Added.
(WebCore::CSSPrimitiveValue::createCounterName): Added.
(WebCore::CSSPrimitiveValue::createCustomIdent): Added.
(WebCore::CSSPrimitiveValue::createFontFamily): Added.
(WebCore::CSSPrimitiveValue::createInteger): Added.
(WebCore::CSSPrimitiveValue::createURI): Added.
(WebCore::CSSPrimitiveValue::computeLengthDouble const): Use isCalculated.
(WebCore::CSSPrimitiveValue::doubleValue const): Ditto.
(WebCore::CSSPrimitiveValue::doubleValueDividingBy100IfPercentage const):
Use isCalculated and isPercentage.
(WebCore::CSSPrimitiveValue::isZero const): Use isCalculated.
(WebCore::CSSPrimitiveValue::isPositive const): Ditto.
(WebCore::CSSPrimitiveValue::isNegative const): Ditto.
(WebCore::CSSPrimitiveValue::isCenterPosition const): Deleted.
(WebCore::CSSPrimitiveValue::unitTypeString): Removed CSS_COUNTER,
CSS_PAIR, CSS_QUAD, CSS_RECT, CSS_SHAPE, CSS_UNICODE_RANGE.
(WebCore::CSSPrimitiveValue::serializeInternal const): Removed unneeded
null check of m_value.calc, CSS_COUNTER, CSS_PAIR, CSS_QUAD, CSS_RECT,
CSS_SHAPE, CSS_UNICODE_RANGE
(WebCore::CSSPrimitiveValue::equals const): Ditto.
(WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper const):
Deleted.
(WebCore::CSSPrimitiveValue::collectComputedStyleDependencies const): Removed
CSS_COUNTER, CSS_PAIR, CSS_QUAD, CSS_RECT, CSS_SHAPE, CSS_UNICODE_RANGE.

* Source/WebCore/css/CSSPrimitiveValue.h: Removed unneeded includes and
forward declarations. Separated out the mechanical type checks that work
based on primitiveUnitType from the numeric type checks that are mostly
based on primitiveType, and grouped them with the corresponding create
functions. This is in preparation for likely making most or all separate
classes, not part of CSSPrimitiveValue. Removed the functions relating
to counter, pair, quad, rect, and shapes, since those are now separate.
Made the other changes as described above.
(WebCore::CSSValue::isValueID const): Added. Inline function definition
for member declared in the CSSValue class.
(WebCore::CSSValue::valueID const): Ditto.
(WebCore::CSSValue::isColor const): Ditto.
(WebCore::CSSValue::color const): Ditto.
(WebCore::CSSValue::isCustomIdent const): Ditto.
(WebCore::CSSValue::customIdent const): Ditto.
(WebCore::CSSValue::isInteger const): Ditto.
(WebCore::CSSValue::integer const): Ditto.

* Source/WebCore/css/CSSPrimitiveValueMappings.h: Removed the create
function that takes a LineClampValue; this was not used.

* Source/WebCore/css/CSSQuadValue.cpp: Added.
* Source/WebCore/css/CSSQuadValue.h: Added.
* Source/WebCore/css/CSSRectValue.cpp: Added.
* Source/WebCore/css/CSSRectValue.h: Added.

* Source/WebCore/css/CSSReflectValue.cpp:
(WebCore::CSSReflectValue::CSSReflectValue): Moved here from the header.
Updated to use CSSValueID for m_direction.
(WebCore::CSSReflectValue::create): Ditto.
(WebCore::CSSReflectValue::customCSSText const): Updated for m_direction.
(WebCore::CSSReflectValue::equals const): Ditto.

* Source/WebCore/css/CSSReflectValue.h: Use CSSValueID for direction,
no reason to allocate an object for it.

* Source/WebCore/css/CSSSubgridValue.cpp:
(WebCore::CSSSubgridValue::customCSSText const): Use serializeItems.
(WebCore::CSSSubgridValue::CSSSubgridValue): Use CSSValueContainingVector.
(WebCore::CSSSubgridValue::create): Moved from header.
* Source/WebCore/css/CSSSubgridValue.h: Derive from CSSValueContainingVector.

* Source/WebCore/css/CSSToStyleMap.cpp: Updated inlcudes.
(WebCore::CSSToStyleMap::styleImage): Take const CSSValue&.
(WebCore::convertToLengthSize): Update for CSSValuePair.
(WebCore::CSSToStyleMap::mapFillSize): Ditto.
(WebCore::CSSToStyleMap::mapFillXPosition): Ditto.
(WebCore::CSSToStyleMap::mapFillYPosition): Ditto.
(WebCore::CSSToStyleMap::mapNinePieceImage): Ditto.
(WebCore::CSSToStyleMap::mapNinePieceImageSlice): Refactor to cut down
on repeated code.
(WebCore::CSSToStyleMap::mapNinePieceImageWidth): Update for change to
CSSBorderImageWidthValue.
(WebCore::CSSToStyleMap::mapNinePieceImageQuad): Update for CSSQuadValue
and refactor to cut down on repeated code.
(WebCore::CSSToStyleMap::mapNinePieceImageSide): Added. Factors out the
single side part of mapNinePieceImageQuad so it can be reused.
(WebCore::fromCSSValueID): Added specialization for NinePieceImageRule.
(WebCore::CSSToStyleMap::mapNinePieceImageRepeat): Update for CSSValuePair,
and use fromCSSValueID to cut down on repeated code.

* Source/WebCore/css/CSSToStyleMap.h: Removed unneeded includes. Changed
argument types as neeeded to accept CSSValue. Use more const. Use static
for functions that don't access BuilderState. Added mapNinePieceImageSide.

* Source/WebCore/css/CSSTransformListValue.cpp:
(WebCore::CSSTransformListValue::CSSTransformListValue): Use CSSValueContainingVector.
(WebCore::CSSTransformListValue::create): Moved from header.
* Source/WebCore/css/CSSTransformListValue.h: Derive from CSSValueContainingVector.

* Source/WebCore/css/CSSUnits.cpp:
(WebCore::unitCategory): Removed CSS_COUNTER, CSS_PAIR, CSS_QUAD, CSS_RECT,
CSS_SHAPE, CSS_UNICODE_RANGE.
(WebCore::operator<<): Ditto.
* Source/WebCore/css/CSSUnits.h: Ditto.

* Source/WebCore/css/CSSValue.cpp: Updated includes.
(WebCore::CSSValue::visitDerived): Renamed CSSContentDistributionClass to
ContentDistributionClass. Added CircleClass, CounterClass, EllipseClass,
InsetShapeClass, PathClass, PolygonClass, QuadClass, RectClass.
(WebCore::CSSValue::collectComputedStyleDependencies const): Simplified by
using CSSValueContainingVector. Added comments about the many dependencies
this function currently misses.
(WebCore::CSSValue::equals const): Added an assertion to catch derived
classes that do not override the equals function. Simplified the code
implementing the rule for comparing CSSValueList with single values,
and limited to actual CSSValueList, not other things containing vectors.
(WebCore::CSSValue::createDeprecatedCSSOMWrapper const): Continue using
DeprecatedCSSOMPrimitiveValue for pair, rect, quad, and counter. Use
DeprecatedCSSOMValueList only for specific CSSValue classes that are derived
from CSSValueContainingVector, rather than for all of them. Also added FIXME
comments since it's clear, to me at least, that some classes are accidentally
being exposed as DeprecatedCSSOMValueList.

* Source/WebCore/css/CSSValue.h: Sorted the class type isXXX functions
alphabetically. Split out the special ones that are not about a single class
into a separate list afterward. Renamed isBaseValueList to isValueList and
the old isValueList to containsVector, since these other value types are no
longer derived from CSSValueList. Renamed isValuePair to isPair. Added
isColor, isCustomIdent, isInteger, isValueID, color, customIdent, integer,
first, second, quad, rect, and valueID functions. Sorted the main list of
class names alphabetically. Renamed CSSContentDistributionClass to
ContentDistributionClass. Added CircleClass, CounterClass, EllipseClass,
InsetShapeClass, PathClass, PolygonClass, QuadClass, RectClass. Updated the
list of classes derived from CSSValueList to include FunctionClass since
we no longer need it excluded to make the correct type of wrapper in
CSSValue::createDeprecatedCSSOMWrapper.

* Source/WebCore/css/CSSValueList.cpp:
(WebCore::CSSValueContainingVector::CSSValueContainingVector): Added.
(WebCore::CSSValueList::CSSValueList): Added a constructor that takes an
already-built vector of values. In the future we may use this for a better
memory allocation scheme, and to obviate the need for non-const functions
like append, prepend, and remove.
(WebCore::CSSValueList::createCommaSeparated): Added new overload that takes
the already-built vector.
(WebCore::CSSValueList::createSpaceSeparated): Ditto.
(WebCore::CSSValueList::createSlashSeparated): Ditto.
(WebCore::CSSValueContainingVector::removeAll): Moved from CSSValueList
and updated use of isValueID.
(WebCore::CSSValueContainingVector::hasValue const): Ditto.
(WebCore::CSSValueList::copy): Use the new constructor.
(WebCore::CSSValueList::equals const): Tweaked coding style.
(WebCore::CSSValueContainingVector::serializeItems const): Added.
(WebCore::CSSValueList::customCSSText const): Use serializeItems.
(WebCore::CSSValueContainingVector::itemsEqual const): Added.
(WebCore::CSSValueList::equals const): Use itemsEqual.
(WebCore::CSSValueContainingVector::containsSingleEqualItem const): Added.
(WebCore::CSSValueContainingVector::customTraverseSubresources const): Moved
from CSSValueList.

* Source/WebCore/css/CSSValueList.h: Factored CSSValueList into the abstract
CSSValueContainerVector class an the concrete CSSValueList class. Added
CSSValueListBuilder. Added operator[]. Removed unneeded private constructor.
Updated functions as described above.

* Source/WebCore/css/CSSValuePair.cpp:
(WebCore::CSSValuePair::CSSValuePair): Moved out of header.
(WebCore::CSSValuePair::create): Ditto.
(WebCore::CSSValuePair::createNoncoalescing): Added.
(WebCore::CSSValuePair::customCSSText const): Tweaked coding style.
(WebCore::CSSValuePair::equals const): Ditto.

* Source/WebCore/css/CSSValuePair.h: Removed comment that says exactly what
the class name does. Added createNoncoalescing function to replace the
IdenticalValueEncoding argument. Changed return types of first and second
to return references. Moved constructors out of header. Use a bool instead
of an enum class for m_coalesceIdenticalValues. Removed unused feature where
you can pass a non-space separator to the create function. We can add that
back if a caller needs it.

* Source/WebCore/css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createFontFamilyValue): Use
CSSPrimitiveValue::createFontFamily.

* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::createConvertingToCSSValueID): Added. This eliminates the need for
the automatic mapping function that used to be built into CSSPrimitiveValue.
(WebCore::valueForImageSliceSide): Use simpler create function.
(WebCore::valueForNinePieceImageSlice): Update to make Quad all at once.
(WebCore::valueForNinePieceImageQuad): Ditto.
(WebCore::valueForNinePieceImageRepeat): Ditto.
(WebCore::fontSizeAdjustFromStyle): Ditto.
(WebCore::valueForReflection): Simplify using toCSSValueID.
(WebCore::createPositionListForLayer): Use simpler create function.
(WebCore::createSingleAxisPositionValueForLayer): Ditto.
(WebCore::valueForQuotes): Ditto.
(WebCore::borderRadiusCornerValues): Ditto.
(WebCore::borderRadiusCornerValue): Return a std::pair instead of
a Ref<Pair>, since there is no reason for heap allocation or reference
counting of a temporary. Also, we can destructure.
(WebCore::borderRadiusShorthandValue): Updated for the above.
(WebCore::matrixTransformValue): Use simpler create function.
(WebCore::transformOperationAsCSSValue): Ditto.
(WebCore::computedScale): Ditto.
(WebCore::computedRotate): Ditto.
(WebCore::ComputedStyleExtractor::valueForFilter): Ditto.
(WebCore::valueForGridTrackList): Use CSSValueContainingVector.
(WebCore::valueForGridPosition): Use simpler create function.
(WebCore::valueForScrollSnapType): Ditto.
(WebCore::valueForScrollSnapAlignment): Ditto.
(WebCore::valueForTextEdge): Ditto.
(WebCore::valueForAnimationIterationCount): Ditto.
(WebCore::valueForAnimationName): Ditto.
(WebCore::valueForPathOperation): Ditto.
(WebCore::ComputedStyleExtractor::ComputedStyleExtractor): Simplify these
by calling each other, and move them all out of the header.
(WebCore::valueForTextEmphasisStyle): Use simpler create function.
(WebCore::fillRepeatToCSSValue): Ditto.
(WebCore::altTextToCSSValue): Ditto.
(WebCore::contentToCSSValue): Ditto.
(WebCore::counterToCSSValue): Ditto.
(WebCore::optionalLineHeight): Ditto.
(WebCore::fontWeight): Ditto.
(WebCore::shapePropertyValue): Ditto.
(WebCore::valueForItemPositionWithOverflowAlignment): Ditto.
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment): Ditto.
(WebCore::fontShorthandValue): Ditto.
(WebCore::ComputedStyleExtractor::hasProperty): Moved here from the header.
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle): Use simpler create
function.
(WebCore::ComputedStyleExtractor::copyProperties): Ditto.

* Source/WebCore/css/ComputedStyleExtractor.h: Removed unneeded includes.
Added overload of propertyMatches that takes a CSSValueID so we don't have
to construct a CSSValue for that case. Added hasProperty function. Use bool
instead of uint8_t for underlying type.

* Source/WebCore/css/Counter.h: Removed reference counting, create function,
constructor, made data members non-const since we can make the whole thing
const instead when we want to.

* Source/WebCore/css/DeprecatedCSSOMCounter.h: Removed unneeded includes.
Changed create function and constructor to take the three pieces of data
instead of a Counter object.

* Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.cpp:
(WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType const): Made counter
still return CSS_COUNTER and rect still return CSS_RECT. Removed unneeded
cases for types that are unknown.
(WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue const): Refactored
to cut down on repeated code.
(WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue const): Updated
since m_value is now a CSSValue.
(WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue const): Updated
to use CSSCounterValue.
(WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue const): Updated
to use CSSRectValue.
(WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue const): Updated
since m_value is now a CSSValue.

* Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.h: Take a CSSValue
instead of CSSPrimitiveValue, since types like pairs are no longer
CSSPrimitiveValue, but we still want to wrap them as one in the deprecated
CSS object model. Removed stringValue.

* Source/WebCore/css/DeprecatedCSSOMRGBColor.h: Use simpler create function,
plus call DeprecatedCSSOMPrimitiveValue::create directly instead of using
CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper.

* Source/WebCore/css/DeprecatedCSSOMRect.h: Use Ref instead of RefPtr, and
remove unneeded null checks.

* Source/WebCore/css/DeprecatedCSSOMValueList.cpp:
(WebCore::DeprecatedCSSOMValueList::cssText const): Added a FIXME comment
since this function probably should not exist.

* Source/WebCore/css/DeprecatedCSSOMValueList.h:
(WebCore::DeprecatedCSSOMValueList::create): Use CSSValueContainingVector.
(WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList): Ditto.

* Source/WebCore/css/Pair.h: Removed.

* Source/WebCore/css/Quad.h: Added. Moved the Quad class here from Rect.h.
Also added a handy single-value constructor for making a Quad from a repeated
value. Also made the serialize function that takes 4 strings public so it can
be shared with the shorthand serialier.

* Source/WebCore/css/Rect.h: Moved RectBase and Quad out of here into their
own separate headers.

* Source/WebCore/css/RectBase.h: Added. Moved the RectBase class here from
Rect.h. Removed all the set functions; instead we construct the objects with
all values from the outset.

* Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::createCSSValue): Renamed from glyphOrientationToCSSPrimitiveValue
and strokeDashArrayToCSSValueList. Use CSSValueListBuilder.
(WebCore::ComputedStyleExtractor::adjustSVGPaint const): Ditto.
(WebCore::ComputedStyleExtractor::svgPropertyValue): Use simpler create
functions.

* Source/WebCore/css/ShorthandSerializer.cpp:
(WebCore::ShorthandSerializer::serializeQuad const): Call Quad::serialize
so we can share the code.
(WebCore::LayerValues::isPair const): Update for CSSValuePair.
(WebCore::ShorthandSerializer::serializeLayered const): Use is<CSSValueList>.
(WebCore::ShorthandSerializer::serializeBorderImage const): Updated since
Quad now holds references, not pointers.
(WebCore::ShorthandSerializer::serializeBorderRadius const): Updated for
CSSValuePair.

* Source/WebCore/css/StyleProperties.cpp:
(WebCore::serializeLonghandValue): Use dynamicDowncast<CSSValueList>.
(WebCore::StyleProperties::propertyAsColor const): Use CSSValue::isColor
and CSSValue::color.

* Source/WebCore/css/TransformFunctions.cpp: Added include.
(WebCore::transformsForValue): USe CSSTransformListValue.

* Source/WebCore/css/calc/CSSCalcCategoryMapping.cpp:
(WebCore::hasDoubleValue): Removed CSS_COUNTER, CSS_PAIR, CSS_QUAD,
CSS_SHAPE, CSS_RECT, CSS_UNICODE_RANGE.

* Source/WebCore/css/calc/CSSCalcExpressionNode.h: Removed include
of CalculationValue.h and forward declared CalcExpressionNode instead.

* Source/WebCore/css/calc/CSSCalcOperationNode.h: Use std::isnan
instead of isnan so we keep building with changes to includes.

* Source/WebCore/css/calc/CSSCalcOperationNode.cpp:
(WebCore::CSSCalcOperationNode::combineChildren): Use simpler create
functions.
* Source/WebCore/css/calc/CSSCalcValue.cpp:
(WebCore::createBlendHalf): Ditto.
(WebCore::createCSS): Ditto.
(WebCore::CSSCalcValue::CSSCalcValue): Use bool for constructor arguent.
(WebCore::CSSCalcValue::create): Ditto. Also return Ref instead of RefPtr.

* Source/WebCore/css/calc/CSSCalcValue.h: Removed unneeded includes, and
tweak the type of the create function.

* Source/WebCore/css/color/CSSUnresolvedColor.h: Removed the reference
counting from this class so it can eventually be stored as a member of
another class rather than requiring it be on the heap.

* Source/WebCore/css/parser/CSSParser.cpp:
(WebCore::color): Added. Helper to simplify the code below. Use
CSSValue::isColor/color.
(WebCore::CSSParser::parseColor): Use color.
(WebCore::CSSParser::parseColorWithoutContext): Ditto.

* Source/WebCore/css/parser/CSSParser.h: Removed unneeded forward declarations.

* Source/WebCore/css/parser/CSSParserFastPaths.cpp:
(WebCore::parseSimpleTransformList): Use CSSValue.

* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeFontPaletteValuesRule): Updated to use
CSSValue::isColor/color.

* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): Add code for
CSSTransformListValue since it's the only other type that is treated the
way CSSValueList is. Also simplified resolveSyntaxValue lambda a tiny bit.
(WebCore::isValueIDPair): Updated to work on CSSValuePair.
(WebCore::pairValue): Deleted.
(WebCore::quadValue): Deleted.
(WebCore::isNumericQuad): Updated for CSSQuadValue.
(WebCore::isInitialValueForLonghand): Updated to not use data members that
are now private.
(WebCore::CSSPropertyParser::consumeFlex): Use simpler create functions.
(WebCore::CSSPropertyParser::parseShorthand): Use std::array since that is now
what consumeRadii requires.

* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::value const): Renamed
m_calcValue to m_value.
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue): Ditto.
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeValueIfCategory):
Ditto. Also call consumeValue to avoid repeating code.
(WebCore::CSSPropertyParserHelpers::consumeCalcRawWithKnownTokenTypeFunction):
Use simplified create functions.
(WebCore::CSSPropertyParserHelpers::IntegerTypeKnownTokenTypeFunctionConsumer::consume):
Ditto.
(WebCore::CSSPropertyParserHelpers::IntegerTypeKnownTokenTypeNumberConsumer::consume):
Ditto.
(WebCore::CSSPropertyParserHelpers::consumeNumberOrPercent): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeString): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeURL): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeOriginColorRaw): Use isColor.
(WebCore::CSSPropertyParserHelpers::parseColorMixFunctionParameters): Use
CSSUnresolvedColor constructor instead of create function.
(WebCore::CSSPropertyParserHelpers::consumeColor): Update to work on
CSSUnresolvedColor rather than Ref<CSSUnresolvedColor>.
(WebCore::CSSPropertyParserHelpers::backgroundPositionFromThreeValues):
Use CSSValuePair.
(WebCore::CSSPropertyParserHelpers::positionFromFourValues): Ditto.
(WebCore::CSSPropertyParserHelpers::consumePosition): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeSingleAxisPosition): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop): Use
simplified create functions.
(WebCore::CSSPropertyParserHelpers::computeGradientColorInterpolationMethod):
Use isColor.
(WebCore::CSSPropertyParserHelpers::consumeCrossFade): Use simplified create
functions.
(WebCore::CSSPropertyParserHelpers::consumeImageSet): Use auto.
(WebCore::CSSPropertyParserHelpers::consumeAspectRatioValue): Use simplified
create functions.
(WebCore::CSSPropertyParserHelpers::consumeFontWeight): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeCounter): Use CSSValuePair.
(WebCore::CSSPropertyParserHelpers::consumeSize): Use auto.
(WebCore::CSSPropertyParserHelpers::consumeTextIndent): Renamed cssParserMode
to mode. Use auto.
(WebCore::CSSPropertyParserHelpers::consumeAutoOrLengthOrPercent): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeMarginSide): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeSide): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeClipComponent): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeClip): Ditto. Use CSSRectValue.
(WebCore::CSSPropertyParserHelpers::consumeKeyframesName): Use auto and
simplified create functions.
(WebCore::CSSPropertyParserHelpers::consumeTextEmphasisStyle): Use auto.
(WebCore::CSSPropertyParserHelpers::consumeTranslate3d): Renamed cssParserMode
to mode.
(WebCore::CSSPropertyParserHelpers::consumeTransform): Use auto.
(WebCore::CSSPropertyParserHelpers::consumeTranslate): Renamed cssParserMode
to mode. Use auto. Removed unneeded type check for CSSPrimitiveValue.
Simplified logic for building the list to not check the list length.
(WebCore::CSSPropertyParserHelpers::consumeScale): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeRotate): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeAttr): Use createAttr.
(WebCore::CSSPropertyParserHelpers::consumeCounterContent): Use CSSCounterValue.
(WebCore::CSSPropertyParserHelpers::consumeBorderRadiusCorner): Use auto
and CSSValuePair. Renamed cssParserMode to mode.
(WebCore::CSSPropertyParserHelpers::consumeShapeRadius): Renamed cssParserMode
to mode.
(WebCore::CSSPropertyParserHelpers::consumeBasicShapeCircle): Use
CSSCircleValue.
(WebCore::CSSPropertyParserHelpers::consumeBasicShapeEllipse): Use
CSSEllipseValue.
(WebCore::CSSPropertyParserHelpers::consumeBasicShapePolygon): Use
CSSPolygonValue.
(WebCore::CSSPropertyParserHelpers::consumeBasicShapePath): Use CSSPathValue.
(WebCore::CSSPropertyParserHelpers::complete4Sides): Changed this to a template
that takes std::array for easier use on a mix of CSSValue and
CSSPrimitiveValue and for more robust type checking of array length.
Simplified logic.
(WebCore::CSSPropertyParserHelpers::consumeRadii): Use std::array. Use
CSSValue so we can handle CSSValuePair. Renamed cssParserMode to mode.
(WebCore::CSSPropertyParserHelpers::consumeBasicShapeInset): Use
CSSInsetShapeValue, std::array, and complete4Sides.
(WebCore::CSSPropertyParserHelpers::consumeBasicShape): Update for the changes
to all the basic shape functions above, now using CSSValue.
(WebCore::CSSPropertyParserHelpers::consumeBasicShapeOrBox): Use auto.
(WebCore::CSSPropertyParserHelpers::consumeShapeOutside): Use auto.
(WebCore::CSSPropertyParserHelpers::consumeBaselineKeywordRaw): Added.
(WebCore::CSSPropertyParserHelpers::getBaselineKeyword): Deleted.
(WebCore::CSSPropertyParserHelpers::consumeBaselineKeyword): Use auto and
consumeBaselineKeywordRaw and CSSValuePair.
(WebCore::CSSPropertyParserHelpers::consumeContentDistributionOverflowPosition):
Use auto and consumeBaselineKeywordRaw to avoid creating a temporary CSSValue
just to hold a CSSValueID.
(WebCore::CSSPropertyParserHelpers::consumeBorderImageRepeat): Use auto
and CSSValuePair.
(WebCore::CSSPropertyParserHelpers::consumeBorderImageSlice): Use
consumeIdentRaw, std::array, and update CSSBorderImageSliceValue use.
(WebCore::CSSPropertyParserHelpers::consumeBorderImageOutset): Use std::array
and CSSQuadValue.
(WebCore::CSSPropertyParserHelpers::consumeBorderImageWidth): Use std::array
and update CSSBorderImageWidthValue use.
(WebCore::CSSPropertyParserHelpers::consumeReflect): Use consumeIdentRaw
and pass the CSSValueID when creating CSSReflectValue.
(WebCore::CSSPropertyParserHelpers::consumeBackgroundSize): Use CSSValuePair.
(WebCore::CSSPropertyParserHelpers::consumeAlignTracks): Use auto and early
return.
(WebCore::CSSPropertyParserHelpers::consumeJustifyTracks): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeGridAutoFlow): Use auto.
(WebCore::CSSPropertyParserHelpers::consumeMasonryAutoFlow): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeRepeatStyle): Use consumeIdentRaw
when we are checking for a single identifier and not using the value. This
is more effcient than consumeIdent which will create and discard a
CSSPrimitiveValue object.
(WebCore::CSSPropertyParserHelpers::consumeSelfPositionOverflowPosition):
Use auto and CSSValuePair.
(WebCore::CSSPropertyParserHelpers::consumeJustifyItems): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeFitContent): Rename cssParserMode
to mode. Use auto.
(WebCore::CSSPropertyParserHelpers::consumeGridLine): Use auto. Remove
assertion since the code above makes it very clear it's not needed.
(WebCore::CSSPropertyParserHelpers::isGridTrackFixedSized): Removed
assertion that repeats what downcast already asserts. Removed local
varables.
(WebCore::CSSPropertyParserHelpers::parseGridTemplateAreasColumnNames):
Use auto.
(WebCore::CSSPropertyParserHelpers::parseGridTemplateAreasRow): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeGridBreadth): Rename cssParserMode
to mode.
(WebCore::CSSPropertyParserHelpers::consumeGridTrackSize): Ditto. Use auto.
(WebCore::CSSPropertyParserHelpers::consumeGridTrackRepeatFunction): Use
CSSValueContainingVector.
(WebCore::CSSPropertyParserHelpers::consumeGridLineNames): Use auto.
(WebCore::CSSPropertyParserHelpers::consumeGridTrackRepeatFunction): Rename
cssParserMode to mode. Use auto.
(WebCore::CSSPropertyParserHelpers::consumeSubgridNameRepeatFunction): Use
CSSValueContainingVector.
(WebCore::CSSPropertyParserHelpers::consumeGridTrackList): Use auto.
(WebCore::CSSPropertyParserHelpers::consumeGridTemplateAreas): Move the map
when calling CSSGridTemplateAreasValue::create. Removed the assertion that
is also checked by CSSGridTemplateAreasValue::create.
(WebCore::CSSPropertyParserHelpers::consumeLineBoxContain): Map the
CSSValue to LineBoxContain using a function rather than repeating code.
(WebCore::CSSPropertyParserHelpers::consumeContainerName): Fix bug where we
would return an empty list if there was no valid name. Parsing must fail
int that case.
(WebCore::CSSPropertyParserHelpers::consumeWebkitInitialLetter): Use auto
and CSSValuePair.
(WebCore::CSSPropertyParserHelpers::consumeSpeakAs): Use auto.
(WebCore::CSSPropertyParserHelpers::consumeHangingPunctuation): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeContain): Use auto for the list
and build the list with a loop.
(WebCore::CSSPropertyParserHelpers::consumeTextEmphasisPosition): Simplify
logic using std::optional. Use auto.
(WebCore::CSSPropertyParserHelpers::consumeColorScheme): Add FIXME comments
about bugs noticed by code inspection.
(WebCore::CSSPropertyParserHelpers::consumeOffsetRotate): Use auto and
simplify logic.
(WebCore::CSSPropertyParserHelpers::consumeFontFaceFontFamily): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeCounterStyleSystem): Use
CSSValuePair.
(WebCore::CSSPropertyParserHelpers::consumeCounterStyleNegative): Tweak
coding style. Use auto.
(WebCore::CSSPropertyParserHelpers::consumeCounterStyleRange): Use CSSValuePair.
(WebCore::CSSPropertyParserHelpers::consumeCounterStylePad): Use
CSSPrimitiveValue.

* Source/WebCore/css/parser/CSSPropertyParserHelpers.h: Made
PositionCoordinates hold CSSValue rather than CSSPrimitiveValue so it can
hold a CSSValuePair.
(WebCore::CSSPropertyParserHelpers::assignOrDowngradeToListAndAppend):
Use is<CSSValueList>.
(WebCore::CSSPropertyParserHelpers::createPrimitiveValuePair): Deleted.
Callers now use CSSValuePair::create.

* Source/WebCore/css/process-css-properties.py: Removed check for
CSSImageSetValue since it is no longer a CSSValueList.

* Source/WebCore/css/query/GenericMediaQueryEvaluator.cpp: Removed
unneeded include.

* Source/WebCore/css/typedom/CSSKeywordValue.cpp:
(WebCore::CSSKeywordValue::toCSSValue const): Use
CSSPrimitiveValue::createCustomIdent.

* Source/WebCore/css/typedom/CSSStyleValue.cpp: Removed unneeded include.

* Source/WebCore/css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::parseStyleValue): Use CSSValueContainingVector.
(WebCore::CSSStyleValueFactory::constructStyleValueForCustomPropertySyntaxValue):
Use CSSPrimitiveValue::createURI.

* Source/WebCore/css/typedom/CSSUnitValue.cpp:
(WebCore::CSSUnitValue::toCSSValueWithProperty const): Simplified since
CSSCalcValue::create now returns a Ref.

* Source/WebCore/css/typedom/MainThreadStylePropertyMapReadOnly.cpp:
Removed unneeded include.

* Source/WebCore/css/typedom/StylePropertyMap.cpp:
(WebCore::StylePropertyMap::append): Use dynamicDowncast.

* Source/WebCore/css/typedom/numeric/CSSMathValue.h: Simplified since
CSSCalcValue::create now returns a Ref.

* Source/WebCore/css/typedom/transform/CSSMatrixComponent.cpp:
(WebCore::CSSMatrixComponent::toCSSValue const): Use simpler create function.

* Source/WebCore/editing/EditingStyle.cpp:
(WebCore::cssValueToColor): Use CSSValue::isColor/color.
(WebCore::EditingStyle::styleWithResolvedTextDecorations const): Use
CSSValueListBuilder.
(WebCore::isTransparentColorValue): Use CSSValue functions for color and
valueID.
(WebCore::backgroundColorInEffect): Simplify, taking advantage of the null
check in isTransparentColorValue.

* Source/WebCore/editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::colorPropertyValueForNode): Use CSSValue::isColor/color
instead of casting to CSSPrimitiveValue.

* Source/WebCore/html/HTMLElement.cpp:
(WebCore::HTMLElement::addParsedWidthAndHeightToAspectRatioList): Use
simplified create.

* Source/WebCore/html/HTMLHRElement.cpp:
(WebCore::HTMLHRElement::collectPresentationalHintsForAttribute):
Use WTFMove to cut down on reference count churn a tiny bit.

* Source/WebCore/platform/graphics/WindRule.h: Use bool instead of uint8_t.
* Source/WebCore/rendering/EventRegion.h: Ditto.
* Source/WebCore/rendering/style/BasicShapes.h: Ditto.

* Source/WebCore/rendering/style/RenderStyle.h: Reemoved unneeded forward
declaration of Pair.

* Source/WebCore/rendering/style/StyleCrossfadeImage.cpp:
(WebCore::StyleCrossfadeImage::computedStyleValue const): Use simplified
create.

* Source/WebCore/rendering/style/StyleGradientImage.cpp:
(WebCore::positionFromValue): Use CSSValuePair.
(WebCore::computeEndPoint): Ditto.

* Source/WebCore/style/ColorFromPrimitiveValue.cpp:
(WebCore::Style::colorFromPrimitiveValue): Use isColor.

* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertToRadiusLength): Use const&.
(WebCore::Style::BuilderConverter::convertRadius): Use CSSValuePair.
(WebCore::Style::BuilderConverter::convertPositionComponentX): Use CSSValue.
(WebCore::Style::BuilderConverter::convertPositionComponentY): Ditto.
(WebCore::Style::BuilderConverter::convertPositionComponent): Use CSSValuePair.
(WebCore::Style::BuilderConverter::convertPosition): Ditto.
(WebCore::Style::BuilderConverter::convertPositionOrAuto): Ditto.
(WebCore::Style::BuilderConverter::convertPathOperation): Ditto. Also removed
code that unnecessarily repeats the assertions done by fromCSSValue.
(WebCore::Style::BuilderConverter::convertReflection): Update for changes
to CSSReflectValue.
(WebCore::Style::BuilderConverter::convertInitialLetter): Use CSSValuePair.
(WebCore::Style::BuilderConverter::convertShapeValue): Ditto.
(WebCore::Style::BuilderConverter::createGridTrackList):
Use CSSValueContainingVector.
(WebCore::Style::BuilderConverter::convertSelfOrDefaultAlignmentData):
Use CSSValuePair.

* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueClip): Use CSSRectValue.
(WebCore::Style::BuilderCustom::applyTextOrBoxShadowValue): Removed unnneeded
copy of the CSSToLengthConversionData.
(WebCore::Style::BuilderCustom::applyValueCounter): Use CSSValuePair.
(WebCore::Style::BuilderCustom::applyValueContent): Ditto.

* Source/WebCore/style/StyleResolver.cpp: Removed unneeded include.
* Source/WebCore/style/StyleResolver.h: Ditto.

* Source/WebCore/svg/SVGFontFaceSrcElement.cpp:
(WebCore::SVGFontFaceSrcElement::createSrcValue const): Use
CSSValueListBuilder.

* Source/WebCore/svg/SVGPathUtilities.cpp:
(WebCore::convertSVGPathByteStreamToAbsoluteCoordinates): Return a
std::optional instead of a std::unique_ptr so we don't put the vector
contaning the path bytes onto the heap.

* Source/WebCore/svg/SVGPathUtilities.h: Updated for the above.

* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in:
Updated since WindRule is now based on bool rather than uint8_t.

* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
Updated since BasicShapeCenterCoordinate::Direction is now based on bool
rather than uint8_t.

* Tools/TestWebKitAPI/Tests/WebCore/CSSParser.cpp:
(TestWebKitAPI::computeNumberOfTracks): Use CSSValueContainingVector.
(TestWebKitAPI::TEST): Ditto.

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




More information about the webkit-changes mailing list