Modernize SVGRenderStyleDefs.h
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 May 2018 15:20:04 +0000 (15:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 May 2018 15:20:04 +0000 (15:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186024

Patch by Sam Weinig <sam@webkit.org> on 2018-05-28
Reviewed by Daniel Bates.

Source/WebCore:

Modernized the set of enums in SVGRenderStyleDefs.h and WindRule.h by:
    - Converting them to enum classes
    - Renaming them to remove unnecessary prefix 'E's
    - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
    - Renaming to match modern conventions (e.g BNONE -> None)

Modernizes the following enums:
    SVGPaintType
    BaselineShift (renamed from EBaselineShift)
    TextAnchor (renamed from ETextAnchor)
    ColorInterpolation (renamed from EColorInterpolation)
    ColorRendering (renamed from EColorRendering)
    ShapeRendering (renamed from EShapeRendering)
    GlyphOrientation (renamed from EGlyphOrientation)
    AlignmentBaseline (renamed from EAlignmentBaseline)
    DominantBaseline (renamed from EDominantBaseline)
    VectorEffect (renamed from EVectorEffect)
    BufferedRendering (renamed from EBufferedRendering)
    MaskType (renamed from EMaskType)
    WindRule

* css/CSSBasicShapes.cpp:
(WebCore::buildPathString):
(WebCore::buildPolygonString):
* css/CSSBasicShapes.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator WindRule const):
(WebCore::CSSPrimitiveValue::operator AlignmentBaseline const):
(WebCore::CSSPrimitiveValue::operator BufferedRendering const):
(WebCore::CSSPrimitiveValue::operator ColorInterpolation const):
(WebCore::CSSPrimitiveValue::operator ColorRendering const):
(WebCore::CSSPrimitiveValue::operator DominantBaseline const):
(WebCore::CSSPrimitiveValue::operator ShapeRendering const):
(WebCore::CSSPrimitiveValue::operator TextAnchor const):
(WebCore::CSSPrimitiveValue::operator VectorEffect const):
(WebCore::CSSPrimitiveValue::operator MaskType const):
(WebCore::CSSPrimitiveValue::operator EAlignmentBaseline const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBufferedRendering const): Deleted.
(WebCore::CSSPrimitiveValue::operator EColorInterpolation const): Deleted.
(WebCore::CSSPrimitiveValue::operator EColorRendering const): Deleted.
(WebCore::CSSPrimitiveValue::operator EDominantBaseline const): Deleted.
(WebCore::CSSPrimitiveValue::operator EShapeRendering const): Deleted.
(WebCore::CSSPrimitiveValue::operator ETextAnchor const): Deleted.
(WebCore::CSSPrimitiveValue::operator EVectorEffect const): Deleted.
(WebCore::CSSPrimitiveValue::operator EMaskType const): Deleted.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::glyphOrientationToCSSPrimitiveValue):
(WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGlyphOrientation):
(WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueBaselineShift):
(WebCore::StyleBuilderCustom::applyValueFill):
(WebCore::StyleBuilderCustom::applyValueStroke):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapePolygon):
(WebCore::consumeBasicShapePath):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::toWindRule):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
* platform/graphics/FloatPolygon.cpp:
(WebCore::FloatPolygon::contains const):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::shapeLayerWindRule const):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsTypes.cpp:
(WebCore::operator<<):
* platform/graphics/Path.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::drawInsetShadow):
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
* platform/graphics/WindRule.h:
(): Deleted.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::shapeWindRule const):
(PlatformCALayerCocoa::setShapeWindRule):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::calculateDrawingMode):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::clipPath):
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::contains const):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawAnimation):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBorder):
(WebCore::RenderBoxModelObject::clipBorderSidePolygon):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintOutline):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::computeClipPath const):
* rendering/style/BasicShapes.h:
(WebCore::BasicShape::windRule const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fillPaintType const):
(WebCore::RenderStyle::setFillPaintColor):
(WebCore::RenderStyle::strokePaintType const):
(WebCore::RenderStyle::setStrokePaintColor):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialAlignmentBaseline):
(WebCore::SVGRenderStyle::initialDominantBaseline):
(WebCore::SVGRenderStyle::initialBaselineShift):
(WebCore::SVGRenderStyle::initialVectorEffect):
(WebCore::SVGRenderStyle::initialBufferedRendering):
(WebCore::SVGRenderStyle::initialClipRule):
(WebCore::SVGRenderStyle::initialColorInterpolation):
(WebCore::SVGRenderStyle::initialColorInterpolationFilters):
(WebCore::SVGRenderStyle::initialColorRendering):
(WebCore::SVGRenderStyle::initialFillRule):
(WebCore::SVGRenderStyle::initialShapeRendering):
(WebCore::SVGRenderStyle::initialTextAnchor):
(WebCore::SVGRenderStyle::initialGlyphOrientationHorizontal):
(WebCore::SVGRenderStyle::initialGlyphOrientationVertical):
(WebCore::SVGRenderStyle::initialFillPaintType):
(WebCore::SVGRenderStyle::initialStrokePaintType):
(WebCore::SVGRenderStyle::initialMaskType):
(WebCore::SVGRenderStyle::setAlignmentBaseline):
(WebCore::SVGRenderStyle::setDominantBaseline):
(WebCore::SVGRenderStyle::setBaselineShift):
(WebCore::SVGRenderStyle::setVectorEffect):
(WebCore::SVGRenderStyle::setBufferedRendering):
(WebCore::SVGRenderStyle::setClipRule):
(WebCore::SVGRenderStyle::setColorInterpolation):
(WebCore::SVGRenderStyle::setColorInterpolationFilters):
(WebCore::SVGRenderStyle::setColorRendering):
(WebCore::SVGRenderStyle::setFillRule):
(WebCore::SVGRenderStyle::setShapeRendering):
(WebCore::SVGRenderStyle::setTextAnchor):
(WebCore::SVGRenderStyle::setGlyphOrientationHorizontal):
(WebCore::SVGRenderStyle::setGlyphOrientationVertical):
(WebCore::SVGRenderStyle::setMaskType):
(WebCore::SVGRenderStyle::alignmentBaseline const):
(WebCore::SVGRenderStyle::dominantBaseline const):
(WebCore::SVGRenderStyle::baselineShift const):
(WebCore::SVGRenderStyle::vectorEffect const):
(WebCore::SVGRenderStyle::bufferedRendering const):
(WebCore::SVGRenderStyle::clipRule const):
(WebCore::SVGRenderStyle::colorInterpolation const):
(WebCore::SVGRenderStyle::colorInterpolationFilters const):
(WebCore::SVGRenderStyle::colorRendering const):
(WebCore::SVGRenderStyle::fillRule const):
(WebCore::SVGRenderStyle::shapeRendering const):
(WebCore::SVGRenderStyle::textAnchor const):
(WebCore::SVGRenderStyle::glyphOrientationHorizontal const):
(WebCore::SVGRenderStyle::glyphOrientationVertical const):
(WebCore::SVGRenderStyle::fillPaintType const):
(WebCore::SVGRenderStyle::strokePaintType const):
(WebCore::SVGRenderStyle::maskType const):
(WebCore::SVGRenderStyle::visitedLinkFillPaintType const):
(WebCore::SVGRenderStyle::visitedLinkStrokePaintType const):
(WebCore::SVGRenderStyle::hasStroke const):
(WebCore::SVGRenderStyle::hasFill const):
(WebCore::SVGRenderStyle::setBitDefaults):
* rendering/style/SVGRenderStyleDefs.h:
(WebCore::StyleFillData::create):
(WebCore::StyleFillData::operator!= const):
(WebCore::StyleStrokeData::create):
(WebCore::StyleStrokeData::operator!= const):
(WebCore::StyleStopData::create):
(WebCore::StyleStopData::operator!= const):
(WebCore::StyleTextData::create):
(WebCore::StyleTextData::operator!= const):
(WebCore::StyleMiscData::create):
(WebCore::StyleMiscData::operator!= const):
(WebCore::StyleShadowSVGData::create):
(WebCore::StyleShadowSVGData::operator!= const):
(WebCore::StyleResourceData::create):
(WebCore::StyleResourceData::operator!= const):
(WebCore::StyleInheritedResourceData::create):
(WebCore::StyleInheritedResourceData::operator!= const):
(WebCore::StyleLayoutData::create):
(WebCore::StyleLayoutData::operator!= const):
(): Deleted.
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::paint):
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::updateShapeFromElement):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::pathOnlyClipping):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::buildPrimitives const):
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
(WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::applyResource):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::paint):
* rendering/svg/RenderSVGShape.h:
(WebCore::RenderSVGShape::hasNonScalingStroke const):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeStyle):
(WebCore::writeSVGInlineTextBox):
* rendering/svg/SVGResources.cpp:
(WebCore::paintingResourceFromSVGPaint):
* rendering/svg/SVGTextChunk.cpp:
(WebCore::SVGTextChunk::SVGTextChunk):
* rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
(WebCore::SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline const):
(WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
(WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
* rendering/svg/SVGTextLayoutEngineBaseline.h:

Source/WebKit:

* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::applyPropertiesToLayer):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
Update for new enum names.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232246 268f45cc-cd09-0410-ab3c-d52691b4dbfc

55 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSBasicShapes.cpp
Source/WebCore/css/CSSBasicShapes.h
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/StyleBuilderCustom.h
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/platform/graphics/FloatPolygon.cpp
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/GraphicsTypes.cpp
Source/WebCore/platform/graphics/Path.h
Source/WebCore/platform/graphics/ShadowBlur.cpp
Source/WebCore/platform/graphics/WindRule.h
Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
Source/WebCore/platform/graphics/cairo/CairoOperations.cpp
Source/WebCore/platform/graphics/cairo/CairoOperations.h
Source/WebCore/platform/graphics/cairo/PathCairo.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/PathCG.cpp
Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp
Source/WebCore/platform/graphics/win/PathDirect2D.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebCore/rendering/FilterEffectRenderer.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/style/BasicShapes.h
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/SVGRenderStyle.h
Source/WebCore/rendering/style/SVGRenderStyleDefs.h
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGRect.cpp
Source/WebCore/rendering/svg/RenderSVGResource.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp
Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/RenderSVGShape.h
Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
Source/WebCore/rendering/svg/SVGResources.cpp
Source/WebCore/rendering/svg/SVGTextChunk.cpp
Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp
Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm

index 5746525..3f06ab0 100644 (file)
@@ -1,3 +1,229 @@
+2018-05-28  Sam Weinig  <sam@webkit.org>
+
+        Modernize SVGRenderStyleDefs.h
+        https://bugs.webkit.org/show_bug.cgi?id=186024
+
+        Reviewed by Daniel Bates.
+
+        Modernized the set of enums in SVGRenderStyleDefs.h and WindRule.h by:
+            - Converting them to enum classes
+            - Renaming them to remove unnecessary prefix 'E's
+            - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
+            - Renaming to match modern conventions (e.g BNONE -> None)
+
+        Modernizes the following enums:
+            SVGPaintType
+            BaselineShift (renamed from EBaselineShift)
+            TextAnchor (renamed from ETextAnchor)
+            ColorInterpolation (renamed from EColorInterpolation)
+            ColorRendering (renamed from EColorRendering)
+            ShapeRendering (renamed from EShapeRendering)
+            GlyphOrientation (renamed from EGlyphOrientation)
+            AlignmentBaseline (renamed from EAlignmentBaseline)
+            DominantBaseline (renamed from EDominantBaseline)
+            VectorEffect (renamed from EVectorEffect)
+            BufferedRendering (renamed from EBufferedRendering)
+            MaskType (renamed from EMaskType)
+            WindRule
+
+        * css/CSSBasicShapes.cpp:
+        (WebCore::buildPathString):
+        (WebCore::buildPolygonString):
+        * css/CSSBasicShapes.h:
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator WindRule const):
+        (WebCore::CSSPrimitiveValue::operator AlignmentBaseline const):
+        (WebCore::CSSPrimitiveValue::operator BufferedRendering const):
+        (WebCore::CSSPrimitiveValue::operator ColorInterpolation const):
+        (WebCore::CSSPrimitiveValue::operator ColorRendering const):
+        (WebCore::CSSPrimitiveValue::operator DominantBaseline const):
+        (WebCore::CSSPrimitiveValue::operator ShapeRendering const):
+        (WebCore::CSSPrimitiveValue::operator TextAnchor const):
+        (WebCore::CSSPrimitiveValue::operator VectorEffect const):
+        (WebCore::CSSPrimitiveValue::operator MaskType const):
+        (WebCore::CSSPrimitiveValue::operator EAlignmentBaseline const): Deleted.
+        (WebCore::CSSPrimitiveValue::operator EBufferedRendering const): Deleted.
+        (WebCore::CSSPrimitiveValue::operator EColorInterpolation const): Deleted.
+        (WebCore::CSSPrimitiveValue::operator EColorRendering const): Deleted.
+        (WebCore::CSSPrimitiveValue::operator EDominantBaseline const): Deleted.
+        (WebCore::CSSPrimitiveValue::operator EShapeRendering const): Deleted.
+        (WebCore::CSSPrimitiveValue::operator ETextAnchor const): Deleted.
+        (WebCore::CSSPrimitiveValue::operator EVectorEffect const): Deleted.
+        (WebCore::CSSPrimitiveValue::operator EMaskType const): Deleted.
+        * css/SVGCSSComputedStyleDeclaration.cpp:
+        (WebCore::glyphOrientationToCSSPrimitiveValue):
+        (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
+        (WebCore::ComputedStyleExtractor::svgPropertyValue):
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertGlyphOrientation):
+        (WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
+        * css/StyleBuilderCustom.h:
+        (WebCore::StyleBuilderCustom::applyValueBaselineShift):
+        (WebCore::StyleBuilderCustom::applyValueFill):
+        (WebCore::StyleBuilderCustom::applyValueStroke):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeBasicShapePolygon):
+        (WebCore::consumeBasicShapePath):
+        * html/canvas/CanvasRenderingContext2DBase.cpp:
+        (WebCore::toWindRule):
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
+        * platform/graphics/FloatPolygon.cpp:
+        (WebCore::FloatPolygon::contains const):
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::fillRectWithRoundedHole):
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::GraphicsLayer::shapeLayerWindRule const):
+        * platform/graphics/GraphicsLayer.h:
+        * platform/graphics/GraphicsTypes.cpp:
+        (WebCore::operator<<):
+        * platform/graphics/Path.h:
+        * platform/graphics/ShadowBlur.cpp:
+        (WebCore::ShadowBlur::drawInsetShadow):
+        (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
+        (WebCore::ShadowBlur::drawInsetShadowWithTiling):
+        * platform/graphics/WindRule.h:
+        (): Deleted.
+        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+        (PlatformCALayerCocoa::shapeWindRule const):
+        (PlatformCALayerCocoa::setShapeWindRule):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::calculateDrawingMode):
+        (WebCore::GraphicsContext::fillPath):
+        (WebCore::GraphicsContext::fillRectWithRoundedHole):
+        (WebCore::GraphicsContext::clipPath):
+        * platform/graphics/cg/PathCG.cpp:
+        (WebCore::Path::contains const):
+        * platform/mock/MockRealtimeVideoSource.cpp:
+        (WebCore::MockRealtimeVideoSource::drawAnimation):
+        * rendering/FilterEffectRenderer.cpp:
+        (WebCore::FilterEffectRenderer::buildReferenceFilter):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintBorder):
+        (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::paintOutline):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::computeClipPath const):
+        * rendering/style/BasicShapes.h:
+        (WebCore::BasicShape::windRule const):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::fillPaintType const):
+        (WebCore::RenderStyle::setFillPaintColor):
+        (WebCore::RenderStyle::strokePaintType const):
+        (WebCore::RenderStyle::setStrokePaintColor):
+        * rendering/style/SVGRenderStyle.h:
+        (WebCore::SVGRenderStyle::initialAlignmentBaseline):
+        (WebCore::SVGRenderStyle::initialDominantBaseline):
+        (WebCore::SVGRenderStyle::initialBaselineShift):
+        (WebCore::SVGRenderStyle::initialVectorEffect):
+        (WebCore::SVGRenderStyle::initialBufferedRendering):
+        (WebCore::SVGRenderStyle::initialClipRule):
+        (WebCore::SVGRenderStyle::initialColorInterpolation):
+        (WebCore::SVGRenderStyle::initialColorInterpolationFilters):
+        (WebCore::SVGRenderStyle::initialColorRendering):
+        (WebCore::SVGRenderStyle::initialFillRule):
+        (WebCore::SVGRenderStyle::initialShapeRendering):
+        (WebCore::SVGRenderStyle::initialTextAnchor):
+        (WebCore::SVGRenderStyle::initialGlyphOrientationHorizontal):
+        (WebCore::SVGRenderStyle::initialGlyphOrientationVertical):
+        (WebCore::SVGRenderStyle::initialFillPaintType):
+        (WebCore::SVGRenderStyle::initialStrokePaintType):
+        (WebCore::SVGRenderStyle::initialMaskType):
+        (WebCore::SVGRenderStyle::setAlignmentBaseline):
+        (WebCore::SVGRenderStyle::setDominantBaseline):
+        (WebCore::SVGRenderStyle::setBaselineShift):
+        (WebCore::SVGRenderStyle::setVectorEffect):
+        (WebCore::SVGRenderStyle::setBufferedRendering):
+        (WebCore::SVGRenderStyle::setClipRule):
+        (WebCore::SVGRenderStyle::setColorInterpolation):
+        (WebCore::SVGRenderStyle::setColorInterpolationFilters):
+        (WebCore::SVGRenderStyle::setColorRendering):
+        (WebCore::SVGRenderStyle::setFillRule):
+        (WebCore::SVGRenderStyle::setShapeRendering):
+        (WebCore::SVGRenderStyle::setTextAnchor):
+        (WebCore::SVGRenderStyle::setGlyphOrientationHorizontal):
+        (WebCore::SVGRenderStyle::setGlyphOrientationVertical):
+        (WebCore::SVGRenderStyle::setMaskType):
+        (WebCore::SVGRenderStyle::alignmentBaseline const):
+        (WebCore::SVGRenderStyle::dominantBaseline const):
+        (WebCore::SVGRenderStyle::baselineShift const):
+        (WebCore::SVGRenderStyle::vectorEffect const):
+        (WebCore::SVGRenderStyle::bufferedRendering const):
+        (WebCore::SVGRenderStyle::clipRule const):
+        (WebCore::SVGRenderStyle::colorInterpolation const):
+        (WebCore::SVGRenderStyle::colorInterpolationFilters const):
+        (WebCore::SVGRenderStyle::colorRendering const):
+        (WebCore::SVGRenderStyle::fillRule const):
+        (WebCore::SVGRenderStyle::shapeRendering const):
+        (WebCore::SVGRenderStyle::textAnchor const):
+        (WebCore::SVGRenderStyle::glyphOrientationHorizontal const):
+        (WebCore::SVGRenderStyle::glyphOrientationVertical const):
+        (WebCore::SVGRenderStyle::fillPaintType const):
+        (WebCore::SVGRenderStyle::strokePaintType const):
+        (WebCore::SVGRenderStyle::maskType const):
+        (WebCore::SVGRenderStyle::visitedLinkFillPaintType const):
+        (WebCore::SVGRenderStyle::visitedLinkStrokePaintType const):
+        (WebCore::SVGRenderStyle::hasStroke const):
+        (WebCore::SVGRenderStyle::hasFill const):
+        (WebCore::SVGRenderStyle::setBitDefaults):
+        * rendering/style/SVGRenderStyleDefs.h:
+        (WebCore::StyleFillData::create):
+        (WebCore::StyleFillData::operator!= const):
+        (WebCore::StyleStrokeData::create):
+        (WebCore::StyleStrokeData::operator!= const):
+        (WebCore::StyleStopData::create):
+        (WebCore::StyleStopData::operator!= const):
+        (WebCore::StyleTextData::create):
+        (WebCore::StyleTextData::operator!= const):
+        (WebCore::StyleMiscData::create):
+        (WebCore::StyleMiscData::operator!= const):
+        (WebCore::StyleShadowSVGData::create):
+        (WebCore::StyleShadowSVGData::operator!= const):
+        (WebCore::StyleResourceData::create):
+        (WebCore::StyleResourceData::operator!= const):
+        (WebCore::StyleInheritedResourceData::create):
+        (WebCore::StyleInheritedResourceData::operator!= const):
+        (WebCore::StyleLayoutData::create):
+        (WebCore::StyleLayoutData::operator!= const):
+        (): Deleted.
+        * rendering/svg/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::paint):
+        * rendering/svg/RenderSVGRect.cpp:
+        (WebCore::RenderSVGRect::updateShapeFromElement):
+        * rendering/svg/RenderSVGResource.cpp:
+        (WebCore::requestPaintingResource):
+        * rendering/svg/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
+        * rendering/svg/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::buildPrimitives const):
+        * rendering/svg/RenderSVGResourceGradient.cpp:
+        (WebCore::RenderSVGResourceGradient::applyResource):
+        * rendering/svg/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::applyResource):
+        (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
+        * rendering/svg/RenderSVGResourcePattern.cpp:
+        (WebCore::RenderSVGResourcePattern::applyResource):
+        * rendering/svg/RenderSVGShape.cpp:
+        (WebCore::RenderSVGShape::paint):
+        * rendering/svg/RenderSVGShape.h:
+        (WebCore::RenderSVGShape::hasNonScalingStroke const):
+        * rendering/svg/SVGRenderTreeAsText.cpp:
+        (WebCore::writeStyle):
+        (WebCore::writeSVGInlineTextBox):
+        * rendering/svg/SVGResources.cpp:
+        (WebCore::paintingResourceFromSVGPaint):
+        * rendering/svg/SVGTextChunk.cpp:
+        (WebCore::SVGTextChunk::SVGTextChunk):
+        * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
+        (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
+        (WebCore::SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline const):
+        (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
+        (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
+        * rendering/svg/SVGTextLayoutEngineBaseline.h:
+
 2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [Web Animations] Test webanimations/css-animations.html is crashing
index 24f2334..8a9cf66 100644 (file)
@@ -211,7 +211,7 @@ CSSBasicShapePath::CSSBasicShapePath(std::unique_ptr<SVGPathByteStream>&& pathDa
 static String buildPathString(const WindRule& windRule, const String& path, const String& box)
 {
     StringBuilder result;
-    if (windRule == RULE_EVENODD)
+    if (windRule == WindRule::EvenOdd)
         result.appendLiteral("path(evenodd, ");
     else
         result.appendLiteral("path(");
@@ -265,7 +265,7 @@ static String buildPolygonString(const WindRule& windRule, const Vector<String>&
 
     result.reserveCapacity(length);
 
-    if (windRule == RULE_EVENODD)
+    if (windRule == WindRule::EvenOdd)
         result.appendLiteral(evenOddOpening);
     else
         result.appendLiteral(nonZeroOpening);
index f9b1e48..105c460 100644 (file)
@@ -195,7 +195,7 @@ public:
 
 private:
     CSSBasicShapePolygon()
-        : m_windRule(RULE_NONZERO)
+        : m_windRule(WindRule::NonZero)
     {
     }
 
@@ -230,7 +230,7 @@ private:
     bool equals(const CSSBasicShape&) const final;
 
     std::unique_ptr<SVGPathByteStream> m_byteStream;
-    WindRule m_windRule { RULE_NONZERO };
+    WindRule m_windRule { WindRule::NonZero };
 };
 
 } // namespace WebCore
index 255975e..3688fad 100644 (file)
@@ -4118,10 +4118,10 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WindRule e)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (e) {
-    case RULE_NONZERO:
+    case WindRule::NonZero:
         m_value.valueID = CSSValueNonzero;
         break;
-    case RULE_EVENODD:
+    case WindRule::EvenOdd:
         m_value.valueID = CSSValueEvenodd;
         break;
     }
@@ -4133,97 +4133,97 @@ template<> inline CSSPrimitiveValue::operator WindRule() const
 
     switch (m_value.valueID) {
     case CSSValueNonzero:
-        return RULE_NONZERO;
+        return WindRule::NonZero;
     case CSSValueEvenodd:
-        return RULE_EVENODD;
+        return WindRule::EvenOdd;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return RULE_NONZERO;
+    return WindRule::NonZero;
 }
 
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EAlignmentBaseline e)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(AlignmentBaseline e)
     : CSSValue(PrimitiveClass)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (e) {
-    case AB_AUTO:
+    case AlignmentBaseline::Auto:
         m_value.valueID = CSSValueAuto;
         break;
-    case AB_BASELINE:
+    case AlignmentBaseline::Baseline:
         m_value.valueID = CSSValueBaseline;
         break;
-    case AB_BEFORE_EDGE:
+    case AlignmentBaseline::BeforeEdge:
         m_value.valueID = CSSValueBeforeEdge;
         break;
-    case AB_TEXT_BEFORE_EDGE:
+    case AlignmentBaseline::TextBeforeEdge:
         m_value.valueID = CSSValueTextBeforeEdge;
         break;
-    case AB_MIDDLE:
+    case AlignmentBaseline::Middle:
         m_value.valueID = CSSValueMiddle;
         break;
-    case AB_CENTRAL:
+    case AlignmentBaseline::Central:
         m_value.valueID = CSSValueCentral;
         break;
-    case AB_AFTER_EDGE:
+    case AlignmentBaseline::AfterEdge:
         m_value.valueID = CSSValueAfterEdge;
         break;
-    case AB_TEXT_AFTER_EDGE:
+    case AlignmentBaseline::TextAfterEdge:
         m_value.valueID = CSSValueTextAfterEdge;
         break;
-    case AB_IDEOGRAPHIC:
+    case AlignmentBaseline::Ideographic:
         m_value.valueID = CSSValueIdeographic;
         break;
-    case AB_ALPHABETIC:
+    case AlignmentBaseline::Alphabetic:
         m_value.valueID = CSSValueAlphabetic;
         break;
-    case AB_HANGING:
+    case AlignmentBaseline::Hanging:
         m_value.valueID = CSSValueHanging;
         break;
-    case AB_MATHEMATICAL:
+    case AlignmentBaseline::Mathematical:
         m_value.valueID = CSSValueMathematical;
         break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator EAlignmentBaseline() const
+template<> inline CSSPrimitiveValue::operator AlignmentBaseline() const
 {
     ASSERT(isValueID());
 
     switch (m_value.valueID) {
     case CSSValueAuto:
-        return AB_AUTO;
+        return AlignmentBaseline::Auto;
     case CSSValueBaseline:
-        return AB_BASELINE;
+        return AlignmentBaseline::Baseline;
     case CSSValueBeforeEdge:
-        return AB_BEFORE_EDGE;
+        return AlignmentBaseline::BeforeEdge;
     case CSSValueTextBeforeEdge:
-        return AB_TEXT_BEFORE_EDGE;
+        return AlignmentBaseline::TextBeforeEdge;
     case CSSValueMiddle:
-        return AB_MIDDLE;
+        return AlignmentBaseline::Middle;
     case CSSValueCentral:
-        return AB_CENTRAL;
+        return AlignmentBaseline::Central;
     case CSSValueAfterEdge:
-        return AB_AFTER_EDGE;
+        return AlignmentBaseline::AfterEdge;
     case CSSValueTextAfterEdge:
-        return AB_TEXT_AFTER_EDGE;
+        return AlignmentBaseline::TextAfterEdge;
     case CSSValueIdeographic:
-        return AB_IDEOGRAPHIC;
+        return AlignmentBaseline::Ideographic;
     case CSSValueAlphabetic:
-        return AB_ALPHABETIC;
+        return AlignmentBaseline::Alphabetic;
     case CSSValueHanging:
-        return AB_HANGING;
+        return AlignmentBaseline::Hanging;
     case CSSValueMathematical:
-        return AB_MATHEMATICAL;
+        return AlignmentBaseline::Mathematical;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return AB_AUTO;
+    return AlignmentBaseline::Auto;
 }
 
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(BorderCollapse e)
@@ -4510,270 +4510,270 @@ template<int supported> Length CSSPrimitiveValue::convertToLength(const CSSToLen
     return Length(Undefined);
 }
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBufferedRendering e)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(BufferedRendering e)
     : CSSValue(PrimitiveClass)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (e) {
-    case BR_AUTO:
+    case BufferedRendering::Auto:
         m_value.valueID = CSSValueAuto;
         break;
-    case BR_DYNAMIC:
+    case BufferedRendering::Dynamic:
         m_value.valueID = CSSValueDynamic;
         break;
-    case BR_STATIC:
+    case BufferedRendering::Static:
         m_value.valueID = CSSValueStatic;
         break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator EBufferedRendering() const
+template<> inline CSSPrimitiveValue::operator BufferedRendering() const
 {
     ASSERT(isValueID());
 
     switch (m_value.valueID) {
     case CSSValueAuto:
-        return BR_AUTO;
+        return BufferedRendering::Auto;
     case CSSValueDynamic:
-        return BR_DYNAMIC;
+        return BufferedRendering::Dynamic;
     case CSSValueStatic:
-        return BR_STATIC;
+        return BufferedRendering::Static;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return BR_AUTO;
+    return BufferedRendering::Auto;
 }
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorInterpolation e)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColorInterpolation e)
     : CSSValue(PrimitiveClass)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (e) {
-    case CI_AUTO:
+    case ColorInterpolation::Auto:
         m_value.valueID = CSSValueAuto;
         break;
-    case CI_SRGB:
+    case ColorInterpolation::SRGB:
         m_value.valueID = CSSValueSRGB;
         break;
-    case CI_LINEARRGB:
+    case ColorInterpolation::LinearRGB:
         m_value.valueID = CSSValueLinearRGB;
         break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator EColorInterpolation() const
+template<> inline CSSPrimitiveValue::operator ColorInterpolation() const
 {
     ASSERT(isValueID());
 
     switch (m_value.valueID) {
     case CSSValueSRGB:
-        return CI_SRGB;
+        return ColorInterpolation::SRGB;
     case CSSValueLinearRGB:
-        return CI_LINEARRGB;
+        return ColorInterpolation::LinearRGB;
     case CSSValueAuto:
-        return CI_AUTO;
+        return ColorInterpolation::Auto;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return CI_AUTO;
+    return ColorInterpolation::Auto;
 }
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorRendering e)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColorRendering e)
     : CSSValue(PrimitiveClass)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (e) {
-    case CR_AUTO:
+    case ColorRendering::Auto:
         m_value.valueID = CSSValueAuto;
         break;
-    case CR_OPTIMIZESPEED:
+    case ColorRendering::OptimizeSpeed:
         m_value.valueID = CSSValueOptimizeSpeed;
         break;
-    case CR_OPTIMIZEQUALITY:
+    case ColorRendering::OptimizeQuality:
         m_value.valueID = CSSValueOptimizeQuality;
         break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator EColorRendering() const
+template<> inline CSSPrimitiveValue::operator ColorRendering() const
 {
     ASSERT(isValueID());
 
     switch (m_value.valueID) {
     case CSSValueOptimizeSpeed:
-        return CR_OPTIMIZESPEED;
+        return ColorRendering::OptimizeSpeed;
     case CSSValueOptimizeQuality:
-        return CR_OPTIMIZEQUALITY;
+        return ColorRendering::OptimizeQuality;
     case CSSValueAuto:
-        return CR_AUTO;
+        return ColorRendering::Auto;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return CR_AUTO;
+    return ColorRendering::Auto;
 }
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDominantBaseline e)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(DominantBaseline e)
     : CSSValue(PrimitiveClass)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (e) {
-    case DB_AUTO:
+    case DominantBaseline::Auto:
         m_value.valueID = CSSValueAuto;
         break;
-    case DB_USE_SCRIPT:
+    case DominantBaseline::UseScript:
         m_value.valueID = CSSValueUseScript;
         break;
-    case DB_NO_CHANGE:
+    case DominantBaseline::NoChange:
         m_value.valueID = CSSValueNoChange;
         break;
-    case DB_RESET_SIZE:
+    case DominantBaseline::ResetSize:
         m_value.valueID = CSSValueResetSize;
         break;
-    case DB_CENTRAL:
+    case DominantBaseline::Central:
         m_value.valueID = CSSValueCentral;
         break;
-    case DB_MIDDLE:
+    case DominantBaseline::Middle:
         m_value.valueID = CSSValueMiddle;
         break;
-    case DB_TEXT_BEFORE_EDGE:
+    case DominantBaseline::TextBeforeEdge:
         m_value.valueID = CSSValueTextBeforeEdge;
         break;
-    case DB_TEXT_AFTER_EDGE:
+    case DominantBaseline::TextAfterEdge:
         m_value.valueID = CSSValueTextAfterEdge;
         break;
-    case DB_IDEOGRAPHIC:
+    case DominantBaseline::Ideographic:
         m_value.valueID = CSSValueIdeographic;
         break;
-    case DB_ALPHABETIC:
+    case DominantBaseline::Alphabetic:
         m_value.valueID = CSSValueAlphabetic;
         break;
-    case DB_HANGING:
+    case DominantBaseline::Hanging:
         m_value.valueID = CSSValueHanging;
         break;
-    case DB_MATHEMATICAL:
+    case DominantBaseline::Mathematical:
         m_value.valueID = CSSValueMathematical;
         break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator EDominantBaseline() const
+template<> inline CSSPrimitiveValue::operator DominantBaseline() const
 {
     ASSERT(isValueID());
 
     switch (m_value.valueID) {
     case CSSValueAuto:
-        return DB_AUTO;
+        return DominantBaseline::Auto;
     case CSSValueUseScript:
-        return DB_USE_SCRIPT;
+        return DominantBaseline::UseScript;
     case CSSValueNoChange:
-        return DB_NO_CHANGE;
+        return DominantBaseline::NoChange;
     case CSSValueResetSize:
-        return DB_RESET_SIZE;
+        return DominantBaseline::ResetSize;
     case CSSValueIdeographic:
-        return DB_IDEOGRAPHIC;
+        return DominantBaseline::Ideographic;
     case CSSValueAlphabetic:
-        return DB_ALPHABETIC;
+        return DominantBaseline::Alphabetic;
     case CSSValueHanging:
-        return DB_HANGING;
+        return DominantBaseline::Hanging;
     case CSSValueMathematical:
-        return DB_MATHEMATICAL;
+        return DominantBaseline::Mathematical;
     case CSSValueCentral:
-        return DB_CENTRAL;
+        return DominantBaseline::Central;
     case CSSValueMiddle:
-        return DB_MIDDLE;
+        return DominantBaseline::Middle;
     case CSSValueTextAfterEdge:
-        return DB_TEXT_AFTER_EDGE;
+        return DominantBaseline::TextAfterEdge;
     case CSSValueTextBeforeEdge:
-        return DB_TEXT_BEFORE_EDGE;
+        return DominantBaseline::TextBeforeEdge;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return DB_AUTO;
+    return DominantBaseline::Auto;
 }
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EShapeRendering e)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ShapeRendering e)
     : CSSValue(PrimitiveClass)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (e) {
-    case SR_AUTO:
+    case ShapeRendering::Auto:
         m_value.valueID = CSSValueAuto;
         break;
-    case SR_OPTIMIZESPEED:
+    case ShapeRendering::OptimizeSpeed:
         m_value.valueID = CSSValueOptimizeSpeed;
         break;
-    case SR_CRISPEDGES:
+    case ShapeRendering::CrispEdges:
         m_value.valueID = CSSValueCrispedges;
         break;
-    case SR_GEOMETRICPRECISION:
+    case ShapeRendering::GeometricPrecision:
         m_value.valueID = CSSValueGeometricPrecision;
         break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator EShapeRendering() const
+template<> inline CSSPrimitiveValue::operator ShapeRendering() const
 {
     ASSERT(isValueID());
 
     switch (m_value.valueID) {
     case CSSValueAuto:
-        return SR_AUTO;
+        return ShapeRendering::Auto;
     case CSSValueOptimizeSpeed:
-        return SR_OPTIMIZESPEED;
+        return ShapeRendering::OptimizeSpeed;
     case CSSValueCrispedges:
-        return SR_CRISPEDGES;
+        return ShapeRendering::CrispEdges;
     case CSSValueGeometricPrecision:
-        return SR_GEOMETRICPRECISION;
+        return ShapeRendering::GeometricPrecision;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return SR_AUTO;
+    return ShapeRendering::Auto;
 }
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAnchor e)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextAnchor e)
     : CSSValue(PrimitiveClass)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (e) {
-    case TA_START:
+    case TextAnchor::Start:
         m_value.valueID = CSSValueStart;
         break;
-    case TA_MIDDLE:
+    case TextAnchor::Middle:
         m_value.valueID = CSSValueMiddle;
         break;
-    case TA_END:
+    case TextAnchor::End:
         m_value.valueID = CSSValueEnd;
         break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator ETextAnchor() const
+template<> inline CSSPrimitiveValue::operator TextAnchor() const
 {
     ASSERT(isValueID());
 
     switch (m_value.valueID) {
     case CSSValueStart:
-        return TA_START;
+        return TextAnchor::Start;
     case CSSValueMiddle:
-        return TA_MIDDLE;
+        return TextAnchor::Middle;
     case CSSValueEnd:
-        return TA_END;
+        return TextAnchor::End;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return TA_START;
+    return TextAnchor::Start;
 }
 
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(const Color& color)
@@ -4790,66 +4790,66 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CSSFontFamily fontFamily)
     m_value.fontFamily = new CSSFontFamily(WTFMove(fontFamily));
 }
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVectorEffect e)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(VectorEffect e)
     : CSSValue(PrimitiveClass)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (e) {
-    case VE_NONE:
+    case VectorEffect::None:
         m_value.valueID = CSSValueNone;
         break;
-    case VE_NON_SCALING_STROKE:
+    case VectorEffect::NonScalingStroke:
         m_value.valueID = CSSValueNonScalingStroke;
         break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator EVectorEffect() const
+template<> inline CSSPrimitiveValue::operator VectorEffect() const
 {
     ASSERT(isValueID());
 
     switch (m_value.valueID) {
     case CSSValueNone:
-        return VE_NONE;
+        return VectorEffect::None;
     case CSSValueNonScalingStroke:
-        return VE_NON_SCALING_STROKE;
+        return VectorEffect::NonScalingStroke;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return VE_NONE;
+    return VectorEffect::None;
 }
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMaskType e)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(MaskType e)
     : CSSValue(PrimitiveClass)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (e) {
-    case MT_LUMINANCE:
+    case MaskType::Luminance:
         m_value.valueID = CSSValueLuminance;
         break;
-    case MT_ALPHA:
+    case MaskType::Alpha:
         m_value.valueID = CSSValueAlpha;
         break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator EMaskType() const
+template<> inline CSSPrimitiveValue::operator MaskType() const
 {
     ASSERT(isValueID());
 
     switch (m_value.valueID) {
     case CSSValueLuminance:
-        return MT_LUMINANCE;
+        return MaskType::Luminance;
     case CSSValueAlpha:
-        return MT_ALPHA;
+        return MaskType::Alpha;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return MT_LUMINANCE;
+    return MaskType::Luminance;
 }
 
 #if ENABLE(CSS_IMAGE_ORIENTATION)
index cb2c0fe..ac41882 100644 (file)
 
 namespace WebCore {
 
-static RefPtr<CSSPrimitiveValue> glyphOrientationToCSSPrimitiveValue(EGlyphOrientation orientation)
+static RefPtr<CSSPrimitiveValue> glyphOrientationToCSSPrimitiveValue(GlyphOrientation orientation)
 {
     switch (orientation) {
-        case GO_0DEG:
-            return CSSPrimitiveValue::create(0.0f, CSSPrimitiveValue::CSS_DEG);
-        case GO_90DEG:
-            return CSSPrimitiveValue::create(90.0f, CSSPrimitiveValue::CSS_DEG);
-        case GO_180DEG:
-            return CSSPrimitiveValue::create(180.0f, CSSPrimitiveValue::CSS_DEG);
-        case GO_270DEG:
-            return CSSPrimitiveValue::create(270.0f, CSSPrimitiveValue::CSS_DEG);
-        default:
-            return nullptr;
+    case GlyphOrientation::Degrees0:
+        return CSSPrimitiveValue::create(0.0f, CSSPrimitiveValue::CSS_DEG);
+    case GlyphOrientation::Degrees90:
+        return CSSPrimitiveValue::create(90.0f, CSSPrimitiveValue::CSS_DEG);
+    case GlyphOrientation::Degrees180:
+        return CSSPrimitiveValue::create(180.0f, CSSPrimitiveValue::CSS_DEG);
+    case GlyphOrientation::Degrees270:
+        return CSSPrimitiveValue::create(270.0f, CSSPrimitiveValue::CSS_DEG);
+    case GlyphOrientation::Auto:
+        return nullptr;
     }
 }
 
@@ -60,20 +60,20 @@ static RefPtr<CSSValue> strokeDashArrayToCSSValueList(const Vector<SVGLengthValu
 
 RefPtr<CSSValue> ComputedStyleExtractor::adjustSVGPaintForCurrentColor(SVGPaintType paintType, const String& url, const Color& color, const Color& currentColor) const
 {
-    if (paintType >= SVG_PAINTTYPE_URI_NONE) {
+    if (paintType >= SVGPaintType::URINone) {
         RefPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
         values->append(CSSPrimitiveValue::create(url, CSSPrimitiveValue::UnitType::CSS_URI));
-        if (paintType == SVG_PAINTTYPE_URI_NONE)
+        if (paintType == SVGPaintType::URINone)
             values->append(CSSPrimitiveValue::createIdentifier(CSSValueNone));
-        else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR)
+        else if (paintType == SVGPaintType::URICurrentColor)
             values->append(CSSPrimitiveValue::create(currentColor));
-        else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR)
+        else if (paintType == SVGPaintType::URIRGBColor)
             values->append(CSSPrimitiveValue::create(color));
         return values;
     }
-    if (paintType == SVG_PAINTTYPE_NONE)
+    if (paintType == SVGPaintType::None)
         return CSSPrimitiveValue::createIdentifier(CSSValueNone);
-    if (paintType == SVG_PAINTTYPE_CURRENTCOLOR)
+    if (paintType == SVGPaintType::CurrentColor)
         return CSSPrimitiveValue::create(currentColor);
     
     return CSSPrimitiveValue::create(color);
@@ -95,104 +95,104 @@ RefPtr<CSSValue> ComputedStyleExtractor::svgPropertyValue(CSSPropertyID property
     const SVGRenderStyle& svgStyle = style->svgStyle();
 
     switch (propertyID) {
-        case CSSPropertyClipRule:
-            return CSSPrimitiveValue::create(svgStyle.clipRule());
-        case CSSPropertyFloodOpacity:
-            return CSSPrimitiveValue::create(svgStyle.floodOpacity(), CSSPrimitiveValue::CSS_NUMBER);
-        case CSSPropertyStopOpacity:
-            return CSSPrimitiveValue::create(svgStyle.stopOpacity(), CSSPrimitiveValue::CSS_NUMBER);
-        case CSSPropertyColorInterpolation:
-            return CSSPrimitiveValue::create(svgStyle.colorInterpolation());
-        case CSSPropertyColorInterpolationFilters:
-            return CSSPrimitiveValue::create(svgStyle.colorInterpolationFilters());
-        case CSSPropertyFillOpacity:
-            return CSSPrimitiveValue::create(svgStyle.fillOpacity(), CSSPrimitiveValue::CSS_NUMBER);
-        case CSSPropertyFillRule:
-            return CSSPrimitiveValue::create(svgStyle.fillRule());
-        case CSSPropertyColorRendering:
-            return CSSPrimitiveValue::create(svgStyle.colorRendering());
-        case CSSPropertyShapeRendering:
-            return CSSPrimitiveValue::create(svgStyle.shapeRendering());
-        case CSSPropertyStrokeOpacity:
-            return CSSPrimitiveValue::create(svgStyle.strokeOpacity(), CSSPrimitiveValue::CSS_NUMBER);
-        case CSSPropertyAlignmentBaseline:
-            return CSSPrimitiveValue::create(svgStyle.alignmentBaseline());
-        case CSSPropertyDominantBaseline:
-            return CSSPrimitiveValue::create(svgStyle.dominantBaseline());
-        case CSSPropertyTextAnchor:
-            return CSSPrimitiveValue::create(svgStyle.textAnchor());
-        case CSSPropertyClipPath:
-            if (!svgStyle.clipperResource().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle.clipperResource(), CSSPrimitiveValue::CSS_URI);
-            return CSSPrimitiveValue::createIdentifier(CSSValueNone);
-        case CSSPropertyMask:
-            if (!svgStyle.maskerResource().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle.maskerResource(), CSSPrimitiveValue::CSS_URI);
-            return CSSPrimitiveValue::createIdentifier(CSSValueNone);
-        case CSSPropertyFloodColor:
-            return currentColorOrValidColor(style, svgStyle.floodColor());
-        case CSSPropertyLightingColor:
-            return currentColorOrValidColor(style, svgStyle.lightingColor());
-        case CSSPropertyStopColor:
-            return currentColorOrValidColor(style, svgStyle.stopColor());
-        case CSSPropertyFill:
-            return adjustSVGPaintForCurrentColor(svgStyle.fillPaintType(), svgStyle.fillPaintUri(), svgStyle.fillPaintColor(), style->color());
-        case CSSPropertyKerning:
-            return SVGLengthValue::toCSSPrimitiveValue(svgStyle.kerning());
-        case CSSPropertyMarkerEnd:
-            if (!svgStyle.markerEndResource().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle.markerEndResource(), CSSPrimitiveValue::CSS_URI);
-            return CSSPrimitiveValue::createIdentifier(CSSValueNone);
-        case CSSPropertyMarkerMid:
-            if (!svgStyle.markerMidResource().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle.markerMidResource(), CSSPrimitiveValue::CSS_URI);
-            return CSSPrimitiveValue::createIdentifier(CSSValueNone);
-        case CSSPropertyMarkerStart:
-            if (!svgStyle.markerStartResource().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle.markerStartResource(), CSSPrimitiveValue::CSS_URI);
-            return CSSPrimitiveValue::createIdentifier(CSSValueNone);
-        case CSSPropertyStroke:
-            return adjustSVGPaintForCurrentColor(svgStyle.strokePaintType(), svgStyle.strokePaintUri(), svgStyle.strokePaintColor(), style->color());
-        case CSSPropertyStrokeDasharray:
-            return strokeDashArrayToCSSValueList(svgStyle.strokeDashArray());
-        case CSSPropertyBaselineShift: {
-            switch (svgStyle.baselineShift()) {
-                case BS_BASELINE:
-                    return CSSPrimitiveValue::createIdentifier(CSSValueBaseline);
-                case BS_SUPER:
-                    return CSSPrimitiveValue::createIdentifier(CSSValueSuper);
-                case BS_SUB:
-                    return CSSPrimitiveValue::createIdentifier(CSSValueSub);
-                case BS_LENGTH:
-                    return SVGLengthValue::toCSSPrimitiveValue(svgStyle.baselineShiftValue());
-            }
-            ASSERT_NOT_REACHED();
-            return nullptr;
-        }
-        case CSSPropertyBufferedRendering:
-            return CSSPrimitiveValue::create(svgStyle.bufferedRendering());
-        case CSSPropertyGlyphOrientationHorizontal:
-            return glyphOrientationToCSSPrimitiveValue(svgStyle.glyphOrientationHorizontal());
-        case CSSPropertyGlyphOrientationVertical: {
-            if (RefPtr<CSSPrimitiveValue> value = glyphOrientationToCSSPrimitiveValue(svgStyle.glyphOrientationVertical()))
-                return value;
-
-            if (svgStyle.glyphOrientationVertical() == GO_AUTO)
-                return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
-
-            return nullptr;
+    case CSSPropertyClipRule:
+        return CSSPrimitiveValue::create(svgStyle.clipRule());
+    case CSSPropertyFloodOpacity:
+        return CSSPrimitiveValue::create(svgStyle.floodOpacity(), CSSPrimitiveValue::CSS_NUMBER);
+    case CSSPropertyStopOpacity:
+        return CSSPrimitiveValue::create(svgStyle.stopOpacity(), CSSPrimitiveValue::CSS_NUMBER);
+    case CSSPropertyColorInterpolation:
+        return CSSPrimitiveValue::create(svgStyle.colorInterpolation());
+    case CSSPropertyColorInterpolationFilters:
+        return CSSPrimitiveValue::create(svgStyle.colorInterpolationFilters());
+    case CSSPropertyFillOpacity:
+        return CSSPrimitiveValue::create(svgStyle.fillOpacity(), CSSPrimitiveValue::CSS_NUMBER);
+    case CSSPropertyFillRule:
+        return CSSPrimitiveValue::create(svgStyle.fillRule());
+    case CSSPropertyColorRendering:
+        return CSSPrimitiveValue::create(svgStyle.colorRendering());
+    case CSSPropertyShapeRendering:
+        return CSSPrimitiveValue::create(svgStyle.shapeRendering());
+    case CSSPropertyStrokeOpacity:
+        return CSSPrimitiveValue::create(svgStyle.strokeOpacity(), CSSPrimitiveValue::CSS_NUMBER);
+    case CSSPropertyAlignmentBaseline:
+        return CSSPrimitiveValue::create(svgStyle.alignmentBaseline());
+    case CSSPropertyDominantBaseline:
+        return CSSPrimitiveValue::create(svgStyle.dominantBaseline());
+    case CSSPropertyTextAnchor:
+        return CSSPrimitiveValue::create(svgStyle.textAnchor());
+    case CSSPropertyClipPath:
+        if (!svgStyle.clipperResource().isEmpty())
+            return CSSPrimitiveValue::create(svgStyle.clipperResource(), CSSPrimitiveValue::CSS_URI);
+        return CSSPrimitiveValue::createIdentifier(CSSValueNone);
+    case CSSPropertyMask:
+        if (!svgStyle.maskerResource().isEmpty())
+            return CSSPrimitiveValue::create(svgStyle.maskerResource(), CSSPrimitiveValue::CSS_URI);
+        return CSSPrimitiveValue::createIdentifier(CSSValueNone);
+    case CSSPropertyFloodColor:
+        return currentColorOrValidColor(style, svgStyle.floodColor());
+    case CSSPropertyLightingColor:
+        return currentColorOrValidColor(style, svgStyle.lightingColor());
+    case CSSPropertyStopColor:
+        return currentColorOrValidColor(style, svgStyle.stopColor());
+    case CSSPropertyFill:
+        return adjustSVGPaintForCurrentColor(svgStyle.fillPaintType(), svgStyle.fillPaintUri(), svgStyle.fillPaintColor(), style->color());
+    case CSSPropertyKerning:
+        return SVGLengthValue::toCSSPrimitiveValue(svgStyle.kerning());
+    case CSSPropertyMarkerEnd:
+        if (!svgStyle.markerEndResource().isEmpty())
+            return CSSPrimitiveValue::create(svgStyle.markerEndResource(), CSSPrimitiveValue::CSS_URI);
+        return CSSPrimitiveValue::createIdentifier(CSSValueNone);
+    case CSSPropertyMarkerMid:
+        if (!svgStyle.markerMidResource().isEmpty())
+            return CSSPrimitiveValue::create(svgStyle.markerMidResource(), CSSPrimitiveValue::CSS_URI);
+        return CSSPrimitiveValue::createIdentifier(CSSValueNone);
+    case CSSPropertyMarkerStart:
+        if (!svgStyle.markerStartResource().isEmpty())
+            return CSSPrimitiveValue::create(svgStyle.markerStartResource(), CSSPrimitiveValue::CSS_URI);
+        return CSSPrimitiveValue::createIdentifier(CSSValueNone);
+    case CSSPropertyStroke:
+        return adjustSVGPaintForCurrentColor(svgStyle.strokePaintType(), svgStyle.strokePaintUri(), svgStyle.strokePaintColor(), style->color());
+    case CSSPropertyStrokeDasharray:
+        return strokeDashArrayToCSSValueList(svgStyle.strokeDashArray());
+    case CSSPropertyBaselineShift: {
+        switch (svgStyle.baselineShift()) {
+        case BaselineShift::Baseline:
+            return CSSPrimitiveValue::createIdentifier(CSSValueBaseline);
+        case BaselineShift::Super:
+            return CSSPrimitiveValue::createIdentifier(CSSValueSuper);
+        case BaselineShift::Sub:
+            return CSSPrimitiveValue::createIdentifier(CSSValueSub);
+        case BaselineShift::Length:
+            return SVGLengthValue::toCSSPrimitiveValue(svgStyle.baselineShiftValue());
         }
-        case CSSPropertyWebkitSvgShadow:
-            return valueForShadow(svgStyle.shadow(), propertyID, *style);
-        case CSSPropertyVectorEffect:
-            return CSSPrimitiveValue::create(svgStyle.vectorEffect());
-        case CSSPropertyMaskType:
-            return CSSPrimitiveValue::create(svgStyle.maskType());
-        case CSSPropertyMarker:
-        case CSSPropertyEnableBackground:
-        case CSSPropertyColorProfile:
-            // the above properties are not yet implemented in the engine
-            break;
+        ASSERT_NOT_REACHED();
+        return nullptr;
+    }
+    case CSSPropertyBufferedRendering:
+        return CSSPrimitiveValue::create(svgStyle.bufferedRendering());
+    case CSSPropertyGlyphOrientationHorizontal:
+        return glyphOrientationToCSSPrimitiveValue(svgStyle.glyphOrientationHorizontal());
+    case CSSPropertyGlyphOrientationVertical: {
+        if (RefPtr<CSSPrimitiveValue> value = glyphOrientationToCSSPrimitiveValue(svgStyle.glyphOrientationVertical()))
+            return value;
+
+        if (svgStyle.glyphOrientationVertical() == GlyphOrientation::Auto)
+            return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
+
+        return nullptr;
+    }
+    case CSSPropertyWebkitSvgShadow:
+        return valueForShadow(svgStyle.shadow(), propertyID, *style);
+    case CSSPropertyVectorEffect:
+        return CSSPrimitiveValue::create(svgStyle.vectorEffect());
+    case CSSPropertyMaskType:
+        return CSSPrimitiveValue::create(svgStyle.maskType());
+    case CSSPropertyMarker:
+    case CSSPropertyEnableBackground:
+    case CSSPropertyColorProfile:
+        // the above properties are not yet implemented in the engine
+        break;
     default:
         // If you crash here, it's because you added a css property and are not handling it
         // in either this switch statement or the one in CSSComputedStyleDelcaration::getPropertyCSSValue
index 6764178..6667047 100644 (file)
@@ -134,8 +134,8 @@ public:
     static Color convertSVGColor(StyleResolver&, const CSSValue&);
     static StyleSelfAlignmentData convertSelfOrDefaultAlignmentData(StyleResolver&, const CSSValue&);
     static StyleContentAlignmentData convertContentAlignmentData(StyleResolver&, const CSSValue&);
-    static EGlyphOrientation convertGlyphOrientation(StyleResolver&, const CSSValue&);
-    static EGlyphOrientation convertGlyphOrientationOrAuto(StyleResolver&, const CSSValue&);
+    static GlyphOrientation convertGlyphOrientation(StyleResolver&, const CSSValue&);
+    static GlyphOrientation convertGlyphOrientationOrAuto(StyleResolver&, const CSSValue&);
     static std::optional<Length> convertLineHeight(StyleResolver&, const CSSValue&, float multiplier = 1.f);
     static FontSynthesis convertFontSynthesis(StyleResolver&, const CSSValue&);
     
@@ -1383,22 +1383,22 @@ inline StyleContentAlignmentData StyleBuilderConverter::convertContentAlignmentD
     return alignmentData;
 }
 
-inline EGlyphOrientation StyleBuilderConverter::convertGlyphOrientation(StyleResolver&, const CSSValue& value)
+inline GlyphOrientation StyleBuilderConverter::convertGlyphOrientation(StyleResolver&, const CSSValue& value)
 {
     float angle = fabsf(fmodf(downcast<CSSPrimitiveValue>(value).floatValue(), 360.0f));
     if (angle <= 45.0f || angle > 315.0f)
-        return GO_0DEG;
+        return GlyphOrientation::Degrees0;
     if (angle > 45.0f && angle <= 135.0f)
-        return GO_90DEG;
+        return GlyphOrientation::Degrees90;
     if (angle > 135.0f && angle <= 225.0f)
-        return GO_180DEG;
-    return GO_270DEG;
+        return GlyphOrientation::Degrees180;
+    return GlyphOrientation::Degrees270;
 }
 
-inline EGlyphOrientation StyleBuilderConverter::convertGlyphOrientationOrAuto(StyleResolver& styleResolver, const CSSValue& value)
+inline GlyphOrientation StyleBuilderConverter::convertGlyphOrientationOrAuto(StyleResolver& styleResolver, const CSSValue& value)
 {
     if (downcast<CSSPrimitiveValue>(value).valueID() == CSSValueAuto)
-        return GO_AUTO;
+        return GlyphOrientation::Auto;
     return convertGlyphOrientation(styleResolver, value);
 }
 
index 6e5d5f7..bc41d8e 100644 (file)
@@ -1032,19 +1032,19 @@ inline void StyleBuilderCustom::applyValueBaselineShift(StyleResolver& styleReso
     if (primitiveValue.isValueID()) {
         switch (primitiveValue.valueID()) {
         case CSSValueBaseline:
-            svgStyle.setBaselineShift(BS_BASELINE);
+            svgStyle.setBaselineShift(BaselineShift::Baseline);
             break;
         case CSSValueSub:
-            svgStyle.setBaselineShift(BS_SUB);
+            svgStyle.setBaselineShift(BaselineShift::Sub);
             break;
         case CSSValueSuper:
-            svgStyle.setBaselineShift(BS_SUPER);
+            svgStyle.setBaselineShift(BaselineShift::Super);
             break;
         default:
             break;
         }
     } else {
-        svgStyle.setBaselineShift(BS_LENGTH);
+        svgStyle.setBaselineShift(BaselineShift::Length);
         svgStyle.setBaselineShiftValue(SVGLengthValue::fromCSSPrimitiveValue(primitiveValue));
     }
 }
@@ -1269,18 +1269,18 @@ inline void StyleBuilderCustom::applyValueFill(StyleResolver& styleResolver, CSS
         return;
 
     Color color;
-    auto paintType = SVG_PAINTTYPE_RGBCOLOR;
+    auto paintType = SVGPaintType::RGBColor;
     if (localValue->isURI()) {
-        paintType = SVG_PAINTTYPE_URI;
+        paintType = SVGPaintType::URI;
         url = localValue->stringValue();
     } else if (localValue->isValueID() && localValue->valueID() == CSSValueNone)
-        paintType = url.isEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE;
+        paintType = url.isEmpty() ? SVGPaintType::None : SVGPaintType::URINone;
     else if (localValue->isValueID() && localValue->valueID() == CSSValueCurrentcolor) {
         color = styleResolver.style()->color();
-        paintType = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR : SVG_PAINTTYPE_URI_CURRENTCOLOR;
+        paintType = url.isEmpty() ? SVGPaintType::CurrentColor : SVGPaintType::URICurrentColor;
     } else {
         color = styleResolver.colorFromPrimitiveValue(*localValue);
-        paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_RGBCOLOR;
+        paintType = url.isEmpty() ? SVGPaintType::RGBColor : SVGPaintType::URIRGBColor;
     }
     svgStyle.setFillPaint(paintType, color, url, styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle());
 }
@@ -1313,18 +1313,18 @@ inline void StyleBuilderCustom::applyValueStroke(StyleResolver& styleResolver, C
         return;
 
     Color color;
-    auto paintType = SVG_PAINTTYPE_RGBCOLOR;
+    auto paintType = SVGPaintType::RGBColor;
     if (localValue->isURI()) {
-        paintType = SVG_PAINTTYPE_URI;
+        paintType = SVGPaintType::URI;
         url = downcast<CSSPrimitiveValue>(localValue)->stringValue();
     } else if (localValue->isValueID() && localValue->valueID() == CSSValueNone)
-        paintType = url.isEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE;
+        paintType = url.isEmpty() ? SVGPaintType::None : SVGPaintType::URINone;
     else if (localValue->isValueID() && localValue->valueID() == CSSValueCurrentcolor) {
         color = styleResolver.style()->color();
-        paintType = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR : SVG_PAINTTYPE_URI_CURRENTCOLOR;
+        paintType = url.isEmpty() ? SVGPaintType::CurrentColor : SVGPaintType::URICurrentColor;
     } else {
         color = styleResolver.colorFromPrimitiveValue(*localValue);
-        paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_RGBCOLOR;
+        paintType = url.isEmpty() ? SVGPaintType::RGBColor : SVGPaintType::URIRGBColor;
     }
     svgStyle.setStrokePaint(paintType, color, url, styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle());
 }
index bcece70..106f76c 100644 (file)
@@ -2453,7 +2453,7 @@ static RefPtr<CSSBasicShapePolygon> consumeBasicShapePolygon(CSSParserTokenRange
 {
     RefPtr<CSSBasicShapePolygon> shape = CSSBasicShapePolygon::create();
     if (identMatches<CSSValueEvenodd, CSSValueNonzero>(args.peek().id())) {
-        shape->setWindRule(args.consumeIncludingWhitespace().id() == CSSValueEvenodd ? RULE_EVENODD : RULE_NONZERO);
+        shape->setWindRule(args.consumeIncludingWhitespace().id() == CSSValueEvenodd ? WindRule::EvenOdd : WindRule::NonZero);
         if (!consumeCommaIncludingWhitespace(args))
             return nullptr;
     }
@@ -2472,9 +2472,9 @@ static RefPtr<CSSBasicShapePolygon> consumeBasicShapePolygon(CSSParserTokenRange
 
 static RefPtr<CSSBasicShapePath> consumeBasicShapePath(CSSParserTokenRange& args)
 {
-    WindRule windRule = RULE_NONZERO;
+    WindRule windRule = WindRule::NonZero;
     if (identMatches<CSSValueEvenodd, CSSValueNonzero>(args.peek().id())) {
-        windRule = args.consumeIncludingWhitespace().id() == CSSValueEvenodd ? RULE_EVENODD : RULE_NONZERO;
+        windRule = args.consumeIncludingWhitespace().id() == CSSValueEvenodd ? WindRule::EvenOdd : WindRule::NonZero;
         if (!consumeCommaIncludingWhitespace(args))
             return nullptr;
     }
index 768c0fc..cd6f3ef 100644 (file)
@@ -1046,7 +1046,7 @@ bool CanvasRenderingContext2DBase::isFullCanvasCompositeMode(CompositeOperator o
 
 static WindRule toWindRule(CanvasFillRule rule)
 {
-    return rule == CanvasFillRule::Nonzero ? RULE_NONZERO : RULE_EVENODD;
+    return rule == CanvasFillRule::Nonzero ? WindRule::NonZero : WindRule::EvenOdd;
 }
 
 void CanvasRenderingContext2DBase::fill(CanvasFillRule windingRule)
index ac16ec5..72aa66f 100644 (file)
@@ -1344,7 +1344,7 @@ public:
 class PropertyWrapperSVGPaint : public AnimationPropertyWrapperBase {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    PropertyWrapperSVGPaint(CSSPropertyID prop, const SVGPaintType& (RenderStyle::*paintTypeGetter)() const, Color (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&))
+    PropertyWrapperSVGPaint(CSSPropertyID prop, SVGPaintType (RenderStyle::*paintTypeGetter)() const, Color (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&))
         : AnimationPropertyWrapperBase(prop)
         , m_paintTypeGetter(paintTypeGetter)
         , m_getter(getter)
@@ -1365,7 +1365,7 @@ public:
         // We only support animations between SVGPaints that are pure Color values.
         // For everything else we must return true for this method, otherwise
         // we will try to animate between values forever.
-        if ((a->*m_paintTypeGetter)() == SVG_PAINTTYPE_RGBCOLOR) {
+        if ((a->*m_paintTypeGetter)() == SVGPaintType::RGBColor) {
             Color fromColor = (a->*m_getter)();
             Color toColor = (b->*m_getter)();
 
@@ -1384,8 +1384,8 @@ public:
 
     void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
     {
-        if ((a->*m_paintTypeGetter)() != SVG_PAINTTYPE_RGBCOLOR
-            || (b->*m_paintTypeGetter)() != SVG_PAINTTYPE_RGBCOLOR)
+        if ((a->*m_paintTypeGetter)() != SVGPaintType::RGBColor
+            || (b->*m_paintTypeGetter)() != SVGPaintType::RGBColor)
             return;
 
         Color fromColor = (a->*m_getter)();
@@ -1410,7 +1410,7 @@ public:
 #endif
 
 private:
-    const SVGPaintType& (RenderStyle::*m_paintTypeGetter)() const;
+    SVGPaintType (RenderStyle::*m_paintTypeGetter)() const;
     Color (RenderStyle::*m_getter)() const;
     void (RenderStyle::*m_setter)(const Color&);
 };
index 76d6c71..8c89731 100644 (file)
@@ -198,7 +198,7 @@ bool FloatPolygon::contains(const FloatPoint& point) const
 {
     if (!m_boundingBox.contains(point))
         return false;
-    return fillRule() == RULE_NONZERO ? containsNonZero(point) : containsEvenOdd(point);
+    return fillRule() == WindRule::NonZero ? containsNonZero(point) : containsEvenOdd(point);
 }
 
 bool VertexPair::overlapsRect(const FloatRect& rect) const
index 76bad7f..bc3b651 100644 (file)
@@ -907,7 +907,7 @@ void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const FloatRo
     WindRule oldFillRule = fillRule();
     Color oldFillColor = fillColor();
     
-    setFillRule(RULE_EVENODD);
+    setFillRule(WindRule::EvenOdd);
     setFillColor(color);
 
     fillPath(path);
index cf62ab6..61112a0 100644 (file)
@@ -172,7 +172,7 @@ struct GraphicsContextState {
     Color shadowColor;
 
     StrokeStyle strokeStyle { SolidStroke };
-    WindRule fillRule { RULE_NONZERO };
+    WindRule fillRule { WindRule::NonZero };
 
     float alpha { 1 };
     CompositeOperator compositeOperator { CompositeSourceOver };
@@ -387,7 +387,7 @@ public:
 
     void clipOut(const FloatRect&);
     void clipOutRoundedRect(const FloatRoundedRect&);
-    void clipPath(const Path&, WindRule = RULE_EVENODD);
+    void clipPath(const Path&, WindRule = WindRule::EvenOdd);
     void clipToImageBuffer(ImageBuffer&, const FloatRect&);
     
     IntRect clipBounds() const;
@@ -465,7 +465,7 @@ public:
     // This clip function is used only by <canvas> code. It allows
     // implementations to handle clipping on the canvas differently since
     // the discipline is different.
-    void canvasClip(const Path&, WindRule = RULE_EVENODD);
+    void canvasClip(const Path&, WindRule = WindRule::EvenOdd);
     void clipOut(const Path&);
 
     void scale(float s)
index 698180e..99e98ba 100644 (file)
@@ -346,7 +346,7 @@ WindRule GraphicsLayer::shapeLayerWindRule() const
 #if USE(CA)
     return m_shapeLayerWindRule;
 #else
-    return RULE_NONZERO;
+    return WindRule::NonZero;
 #endif
 }
 
index 558cdb1..10eda15 100644 (file)
@@ -690,7 +690,7 @@ protected:
 
 #if USE(CA)
     Path m_shapeLayerPath;
-    WindRule m_shapeLayerWindRule { RULE_NONZERO };
+    WindRule m_shapeLayerWindRule { WindRule::NonZero };
 #endif
 };
 
index 4431ce8..5ff1542 100644 (file)
@@ -138,10 +138,10 @@ TextStream& operator<<(TextStream& ts, BlendMode blendMode)
 TextStream& operator<<(TextStream& ts, WindRule rule)
 {
     switch (rule) {
-    case RULE_NONZERO:
+    case WindRule::NonZero:
         ts << "NON-ZERO";
         break;
-    case RULE_EVENODD:
+    case WindRule::EvenOdd:
         ts << "EVEN-ODD";
         break;
     }
index 047c948..fba8501 100644 (file)
@@ -121,7 +121,7 @@ namespace WebCore {
         
         static Path polygonPathFromPoints(const Vector<FloatPoint>&);
 
-        bool contains(const FloatPoint&, WindRule rule = RULE_NONZERO) const;
+        bool contains(const FloatPoint&, WindRule = WindRule::NonZero) const;
         bool strokeContains(StrokeStyleApplier*, const FloatPoint&) const;
         // fastBoundingRect() should equal or contain boundingRect(); boundingRect()
         // should perfectly bound the points within the path.
index 8a652fb..fe049a4 100644 (file)
@@ -608,7 +608,7 @@ void ShadowBlur::drawInsetShadow(const AffineTransform& transform, const IntRect
         else
             path.addRoundedRect(holeRect);
 
-        shadowContext.setFillRule(RULE_EVENODD);
+        shadowContext.setFillRule(WindRule::EvenOdd);
         shadowContext.setFillColor(Color::black);
         shadowContext.fillPath(path);
 
@@ -682,7 +682,7 @@ void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext& graphicsContext,
         else
             path.addRoundedRect(holeRect);
 
-        shadowContext.setFillRule(RULE_EVENODD);
+        shadowContext.setFillRule(WindRule::EvenOdd);
         shadowContext.setFillColor(Color::black);
         shadowContext.fillPath(path);
 
@@ -743,7 +743,7 @@ void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext& graphicsContext, con
         GraphicsContext& shadowContext = m_layerImage->context();
         GraphicsContextStateSaver shadowStateSaver(shadowContext);
         shadowContext.clearRect(templateBounds);
-        shadowContext.setFillRule(RULE_EVENODD);
+        shadowContext.setFillRule(WindRule::EvenOdd);
         shadowContext.setFillColor(Color::black);
 
         Path path;
@@ -779,7 +779,7 @@ void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext& graphicsContext, con
 
     {
         GraphicsContextStateSaver fillStateSaver(graphicsContext);
-        graphicsContext.setFillRule(RULE_EVENODD);
+        graphicsContext.setFillRule(WindRule::EvenOdd);
         graphicsContext.setFillColor(m_color);
         graphicsContext.clearShadow();
         graphicsContext.fillPath(exteriorPath);
index f50834f..40cdb67 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef WindRule_h
-#define WindRule_h
+#pragma once
 
 namespace WebCore {
 
-enum WindRule {
-    RULE_NONZERO = 0,
-    RULE_EVENODD = 1
+enum class WindRule {
+    NonZero = 0,
+    EvenOdd = 1
 };
 
 }
-
-#endif // WindRule_h
-
index 36e71bf..25cf28a 100644 (file)
@@ -941,9 +941,9 @@ WindRule PlatformCALayerCocoa::shapeWindRule() const
 
     NSString *fillRule = [(CAShapeLayer *)m_layer fillRule];
     if ([fillRule isEqualToString:@"even-odd"])
-        return RULE_EVENODD;
+        return WindRule::EvenOdd;
 
-    return RULE_NONZERO;
+    return WindRule::NonZero;
 }
 
 void PlatformCALayerCocoa::setShapeWindRule(WindRule windRule)
@@ -951,10 +951,10 @@ void PlatformCALayerCocoa::setShapeWindRule(WindRule windRule)
     ASSERT(m_layerType == LayerTypeShapeLayer);
 
     switch (windRule) {
-    case RULE_NONZERO:
+    case WindRule::NonZero:
         [(CAShapeLayer *)m_layer setFillRule:@"non-zero"];
         break;
-    case RULE_EVENODD:
+    case WindRule::EvenOdd:
         [(CAShapeLayer *)m_layer setFillRule:@"even-odd"];
         break;
     }
index 9700bb7..7a3d327 100644 (file)
@@ -670,7 +670,7 @@ void PlatformCALayerWin::setShapeRoundedRect(const FloatRoundedRect&)
 WindRule PlatformCALayerWin::shapeWindRule() const
 {
     // FIXME: implement.
-    return RULE_NONZERO;
+    return WindRule::NonZero;
 }
 
 void PlatformCALayerWin::setShapeWindRule(WindRule)
index ecc6fdf..f6fb97d 100644 (file)
@@ -117,7 +117,7 @@ static void clipForPatternFilling(cairo_t* cr, const FloatSize& patternSize, con
 
 static void prepareForFilling(cairo_t* cr, const Cairo::FillSource& fillSource, PatternAdjustment patternAdjustment)
 {
-    cairo_set_fill_rule(cr, fillSource.fillRule == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
+    cairo_set_fill_rule(cr, fillSource.fillRule == WindRule::EvenOdd ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
 
     bool adjustForAlpha = patternAdjustment == AdjustPatternForGlobalAlpha;
 
@@ -1261,7 +1261,7 @@ void clipPath(PlatformContextCairo& platformContext, const Path& path, WindRule
         setPathOnCairoContext(cr, path.platformPath()->context());
 
     cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
-    cairo_set_fill_rule(cr, clipRule == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
+    cairo_set_fill_rule(cr, clipRule == WindRule::EvenOdd ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
     cairo_clip(cr);
     cairo_set_fill_rule(cr, savedFillRule);
 
index b9ef1cf..634cc0a 100644 (file)
@@ -89,7 +89,7 @@ struct FillSource {
     } gradient;
     Color color;
 
-    WindRule fillRule { RULE_NONZERO };
+    WindRule fillRule { WindRule::NonZero };
 };
 
 struct StrokeSource {
index 3f99394..dc288b3 100644 (file)
@@ -388,7 +388,7 @@ bool Path::contains(const FloatPoint& point, WindRule rule) const
         return false;
     cairo_t* cr = platformPath()->context();
     cairo_fill_rule_t cur = cairo_get_fill_rule(cr);
-    cairo_set_fill_rule(cr, rule == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
+    cairo_set_fill_rule(cr, rule == WindRule::EvenOdd ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
     bool contains = cairo_in_fill(cr, point.x(), point.y());
     cairo_set_fill_rule(cr, cur);
     return contains;
index 0b89d20..d295071 100644 (file)
@@ -687,7 +687,7 @@ static inline bool calculateDrawingMode(const GraphicsContextState& state, CGPat
 {
     bool shouldFill = state.fillPattern || state.fillColor.isVisible();
     bool shouldStroke = state.strokePattern || (state.strokeStyle != NoStroke && state.strokeColor.isVisible());
-    bool useEOFill = state.fillRule == RULE_EVENODD;
+    bool useEOFill = state.fillRule == WindRule::EvenOdd;
 
     if (shouldFill) {
         if (shouldStroke) {
@@ -774,7 +774,7 @@ void GraphicsContext::fillPath(const Path& path)
             CGContextAddPath(layerContext, path.platformPath());
             CGContextConcatCTM(layerContext, m_state.fillGradient->gradientSpaceTransform());
 
-            if (fillRule() == RULE_EVENODD)
+            if (fillRule() == WindRule::EvenOdd)
                 CGContextEOClip(layerContext);
             else
                 CGContextClip(layerContext);
@@ -788,7 +788,7 @@ void GraphicsContext::fillPath(const Path& path)
             CGContextStateSaver stateSaver(context);
             CGContextConcatCTM(context, m_state.fillGradient->gradientSpaceTransform());
 
-            if (fillRule() == RULE_EVENODD)
+            if (fillRule() == WindRule::EvenOdd)
                 CGContextEOClip(context);
             else
                 CGContextClip(context);
@@ -802,11 +802,11 @@ void GraphicsContext::fillPath(const Path& path)
     if (m_state.fillPattern)
         applyFillPattern();
 #if USE_DRAW_PATH_DIRECT
-    CGContextDrawPathDirect(context, fillRule() == RULE_EVENODD ? kCGPathEOFill : kCGPathFill, path.platformPath(), nullptr);
+    CGContextDrawPathDirect(context, fillRule() == WindRule::EvenOdd ? kCGPathEOFill : kCGPathFill, path.platformPath(), nullptr);
 #else
     CGContextBeginPath(context);
     CGContextAddPath(context, path.platformPath());
-    if (fillRule() == RULE_EVENODD)
+    if (fillRule() == WindRule::EvenOdd)
         CGContextEOFillPath(context);
     else
         CGContextFillPath(context);
@@ -1034,7 +1034,7 @@ void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const Float
     WindRule oldFillRule = fillRule();
     Color oldFillColor = fillColor();
 
-    setFillRule(RULE_EVENODD);
+    setFillRule(WindRule::EvenOdd);
     setFillColor(color);
 
     // fillRectWithRoundedHole() assumes that the edges of rect are clipped out, so we only care about shadows cast around inside the hole.
@@ -1127,7 +1127,7 @@ void GraphicsContext::clipPath(const Path& path, WindRule clipRule)
         CGContextBeginPath(platformContext());
         CGContextAddPath(platformContext(), path.platformPath());
 
-        if (clipRule == RULE_EVENODD)
+        if (clipRule == WindRule::EvenOdd)
             CGContextEOClip(context);
         else
             CGContextClip(context);
index e959abf..62ed182 100644 (file)
@@ -184,7 +184,7 @@ bool Path::contains(const FloatPoint &point, WindRule rule) const
 
     // CGPathContainsPoint returns false for non-closed paths, as a work-around, we copy and close the path first.  Radar 4758998 asks for a better CG API to use
     RetainPtr<CGMutablePathRef> path = adoptCF(copyCGPathClosingSubpaths(m_path));
-    bool ret = CGPathContainsPoint(path.get(), 0, point, rule == RULE_EVENODD ? true : false);
+    bool ret = CGPathContainsPoint(path.get(), 0, point, rule == WindRule::EvenOdd ? true : false);
     return ret;
 }
 
index e40dcd4..029d079 100644 (file)
@@ -1241,7 +1241,7 @@ void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const Float
     WindRule oldFillRule = fillRule();
     Color oldFillColor = fillColor();
 
-    setFillRule(RULE_EVENODD);
+    setFillRule(WindRule::EvenOdd);
     setFillColor(color);
 
     // fillRectWithRoundedHole() assumes that the edges of rect are clipped out, so we only care about shadows cast around inside the hole.
@@ -1312,7 +1312,7 @@ void GraphicsContext::clipOut(const Path& path)
     boundingRect.appendGeometry(path.platformPath());
 
     COMPtr<ID2D1GeometryGroup> pathToClip;
-    boundingRect.createGeometryWithFillMode(RULE_EVENODD, pathToClip);
+    boundingRect.createGeometryWithFillMode(WindRule::EvenOdd, pathToClip);
 
     m_data->clip(pathToClip.get());
 }
index ec4fe86..d980b04 100644 (file)
@@ -114,7 +114,7 @@ void Path::createGeometryWithFillMode(WindRule webkitFillMode, COMPtr<ID2D1Geome
 {
     RELEASE_ASSERT(m_path);
 
-    auto fillMode = (webkitFillMode == RULE_EVENODD) ? D2D1_FILL_MODE_ALTERNATE : D2D1_FILL_MODE_WINDING;
+    auto fillMode = (webkitFillMode == WindRule::EvenOdd) ? D2D1_FILL_MODE_ALTERNATE : D2D1_FILL_MODE_WINDING;
 
     if (fillMode == m_path->GetFillMode()) {
         path = m_path;
index ea153c9..9e860d6 100644 (file)
@@ -245,7 +245,7 @@ void MockRealtimeVideoSource::drawAnimation(GraphicsContext& context)
     m_path.addArc(location, radius, 0, 2 * piFloat, false);
     m_path.closeSubpath();
     context.setFillColor(Color::white);
-    context.setFillRule(RULE_NONZERO);
+    context.setFillRule(WindRule::NonZero);
     context.fillPath(m_path);
 
     float endAngle = piFloat * (((fmod(m_frameNumber, frameRate()) + 0.5) * (2.0 / frameRate())) + 1);
@@ -254,7 +254,7 @@ void MockRealtimeVideoSource::drawAnimation(GraphicsContext& context)
     m_path.addArc(location, radius, 1.5 * piFloat, endAngle, false);
     m_path.closeSubpath();
     context.setFillColor(Color::gray);
-    context.setFillRule(RULE_NONZERO);
+    context.setFillRule(WindRule::NonZero);
     context.fillPath(m_path);
 }
 
index a5d51ea..e316c2d 100644 (file)
@@ -118,7 +118,7 @@ RefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderElement& r
 
         effectElement.setStandardAttributes(effect.get());
         if (effectElement.renderer())
-            effect->setOperatingColorSpace(effectElement.renderer()->style().svgStyle().colorInterpolationFilters() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceSRGB);
+            effect->setOperatingColorSpace(effectElement.renderer()->style().svgStyle().colorInterpolationFilters() == ColorInterpolation::LinearRGB ? ColorSpaceLinearRGB : ColorSpaceSRGB);
 
         builder->add(effectElement.result(), effect);
         m_effects.append(*effect);
index 9a33f16..34eb4e5 100644 (file)
@@ -1929,7 +1929,7 @@ void RenderBoxModelObject::paintBorder(const PaintInfo& info, const LayoutRect&
             else
                 path.addRect(pixelSnappedInnerBorder.rect());
             
-            graphicsContext.setFillRule(RULE_EVENODD);
+            graphicsContext.setFillRule(WindRule::EvenOdd);
             graphicsContext.setFillColor(edges[firstVisibleEdge].color());
             graphicsContext.fillPath(path);
             return;
@@ -1946,7 +1946,7 @@ void RenderBoxModelObject::paintBorder(const PaintInfo& info, const LayoutRect&
                 }
             }
 
-            graphicsContext.setFillRule(RULE_NONZERO);
+            graphicsContext.setFillRule(WindRule::NonZero);
             graphicsContext.setFillColor(edges[firstVisibleEdge].color());
             graphicsContext.fillPath(path);
             return;
@@ -2205,7 +2205,7 @@ void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext& graphicsContex
     if (firstEdgeMatches == secondEdgeMatches) {
         bool wasAntialiased = graphicsContext.shouldAntialias();
         graphicsContext.setShouldAntialias(!firstEdgeMatches);
-        graphicsContext.clipPath(Path::polygonPathFromPoints(quad), RULE_NONZERO);
+        graphicsContext.clipPath(Path::polygonPathFromPoints(quad), WindRule::NonZero);
         graphicsContext.setShouldAntialias(wasAntialiased);
         return;
     }
@@ -2220,7 +2220,7 @@ void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext& graphicsContex
     };
     bool wasAntialiased = graphicsContext.shouldAntialias();
     graphicsContext.setShouldAntialias(!firstEdgeMatches);
-    graphicsContext.clipPath(Path::polygonPathFromPoints(firstQuad), RULE_NONZERO);
+    graphicsContext.clipPath(Path::polygonPathFromPoints(firstQuad), WindRule::NonZero);
 
     Vector<FloatPoint> secondQuad = {
         quad[0],
@@ -2231,7 +2231,7 @@ void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext& graphicsContex
     };
     // Antialiasing affects the second side.
     graphicsContext.setShouldAntialias(!secondEdgeMatches);
-    graphicsContext.clipPath(Path::polygonPathFromPoints(secondQuad), RULE_NONZERO);
+    graphicsContext.clipPath(Path::polygonPathFromPoints(secondQuad), WindRule::NonZero);
 
     graphicsContext.setShouldAntialias(wasAntialiased);
 }
index a4c0acc..3133ca6 100644 (file)
@@ -1890,7 +1890,7 @@ void RenderElement::paintOutline(PaintInfo& paintInfo, const LayoutRect& paintRe
             Path path;
             path.addRect(outer);
             path.addRect(inner);
-            graphicsContext.setFillRule(RULE_EVENODD);
+            graphicsContext.setFillRule(WindRule::EvenOdd);
             graphicsContext.setFillColor(outlineColor);
             graphicsContext.fillPath(path);
             return;
index 3111b73..8bfafe6 100644 (file)
@@ -4139,7 +4139,7 @@ Path RenderLayer::computeClipPath(const LayoutSize& offsetFromRoot, LayoutRect&
         FloatRoundedRect shapeRect = computeRoundedRectForBoxShape(clipPath.referenceBox(), downcast<RenderBox>(renderer())).pixelSnappedRoundedRectForPainting(deviceSaleFactor);
         shapeRect.move(offsetFromRoot);
 
-        windRule = RULE_NONZERO;
+        windRule = WindRule::NonZero;
         return clipPath.pathForReferenceRect(shapeRect);
     }
     
index c6c68d8..86ccf18 100644 (file)
@@ -59,7 +59,7 @@ public:
     virtual Type type() const = 0;
 
     virtual const Path& path(const FloatRect&) = 0;
-    virtual WindRule windRule() const { return RULE_NONZERO; }
+    virtual WindRule windRule() const { return WindRule::NonZero; }
 
     virtual bool canBlend(const BasicShape&) const = 0;
     virtual Ref<BasicShape> blend(const BasicShape& from, double) const = 0;
@@ -260,7 +260,7 @@ private:
 
     bool operator==(const BasicShape&) const override;
 
-    WindRule m_windRule { RULE_NONZERO };
+    WindRule m_windRule { WindRule::NonZero };
     Vector<Length> m_values;
 };
 
@@ -289,7 +289,7 @@ private:
     bool operator==(const BasicShape&) const override;
 
     std::unique_ptr<SVGPathByteStream> m_byteStream;
-    WindRule m_windRule { RULE_NONZERO };
+    WindRule m_windRule { WindRule::NonZero };
 };
 
 class BasicShapeInset final : public BasicShape {
index b95d769..7783fd6 100644 (file)
@@ -1291,15 +1291,15 @@ public:
     const SVGRenderStyle& svgStyle() const { return m_svgStyle; }
     SVGRenderStyle& accessSVGStyle() { return m_svgStyle.access(); }
 
-    const SVGPaintType& fillPaintType() const { return svgStyle().fillPaintType(); }
+    SVGPaintType fillPaintType() const { return svgStyle().fillPaintType(); }
     Color fillPaintColor() const { return svgStyle().fillPaintColor(); }
-    void setFillPaintColor(const Color& color) { accessSVGStyle().setFillPaint(SVG_PAINTTYPE_RGBCOLOR, color, emptyString()); }
+    void setFillPaintColor(const Color& color) { accessSVGStyle().setFillPaint(SVGPaintType::RGBColor, color, emptyString()); }
     float fillOpacity() const { return svgStyle().fillOpacity(); }
     void setFillOpacity(float f) { accessSVGStyle().setFillOpacity(f); }
 
-    const SVGPaintType& strokePaintType() const { return svgStyle().strokePaintType(); }
+    SVGPaintType strokePaintType() const { return svgStyle().strokePaintType(); }
     Color strokePaintColor() const { return svgStyle().strokePaintColor(); }
-    void setStrokePaintColor(const Color& color) { accessSVGStyle().setStrokePaint(SVG_PAINTTYPE_RGBCOLOR, color, emptyString()); }
+    void setStrokePaintColor(const Color& color) { accessSVGStyle().setStrokePaint(SVGPaintType::RGBColor, color, emptyString()); }
     float strokeOpacity() const { return svgStyle().strokeOpacity(); }
     void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); }
     Vector<SVGLengthValue> strokeDashArray() const { return svgStyle().strokeDashArray(); }
index b29f773..4244ca6 100644 (file)
@@ -47,26 +47,26 @@ public:
     bool operator!=(const SVGRenderStyle& other) const { return !(*this == other); }
 
     // Initial values for all the properties
-    static EAlignmentBaseline initialAlignmentBaseline() { return AB_AUTO; }
-    static EDominantBaseline initialDominantBaseline() { return DB_AUTO; }
-    static EBaselineShift initialBaselineShift() { return BS_BASELINE; }
-    static EVectorEffect initialVectorEffect() { return VE_NONE; }
-    static EBufferedRendering initialBufferedRendering() { return BR_AUTO; }
-    static WindRule initialClipRule() { return RULE_NONZERO; }
-    static EColorInterpolation initialColorInterpolation() { return CI_SRGB; }
-    static EColorInterpolation initialColorInterpolationFilters() { return CI_LINEARRGB; }
-    static EColorRendering initialColorRendering() { return CR_AUTO; }
-    static WindRule initialFillRule() { return RULE_NONZERO; }
-    static EShapeRendering initialShapeRendering() { return SR_AUTO; }
-    static ETextAnchor initialTextAnchor() { return TA_START; }
-    static EGlyphOrientation initialGlyphOrientationHorizontal() { return GO_0DEG; }
-    static EGlyphOrientation initialGlyphOrientationVertical() { return GO_AUTO; }
+    static AlignmentBaseline initialAlignmentBaseline() { return AlignmentBaseline::Auto; }
+    static DominantBaseline initialDominantBaseline() { return DominantBaseline::Auto; }
+    static BaselineShift initialBaselineShift() { return BaselineShift::Baseline; }
+    static VectorEffect initialVectorEffect() { return VectorEffect::None; }
+    static BufferedRendering initialBufferedRendering() { return BufferedRendering::Auto; }
+    static WindRule initialClipRule() { return WindRule::NonZero; }
+    static ColorInterpolation initialColorInterpolation() { return ColorInterpolation::SRGB; }
+    static ColorInterpolation initialColorInterpolationFilters() { return ColorInterpolation::LinearRGB; }
+    static ColorRendering initialColorRendering() { return ColorRendering::Auto; }
+    static WindRule initialFillRule() { return WindRule::NonZero; }
+    static ShapeRendering initialShapeRendering() { return ShapeRendering::Auto; }
+    static TextAnchor initialTextAnchor() { return TextAnchor::Start; }
+    static GlyphOrientation initialGlyphOrientationHorizontal() { return GlyphOrientation::Degrees0; }
+    static GlyphOrientation initialGlyphOrientationVertical() { return GlyphOrientation::Auto; }
     static float initialFillOpacity() { return 1; }
-    static SVGPaintType initialFillPaintType() { return SVG_PAINTTYPE_RGBCOLOR; }
+    static SVGPaintType initialFillPaintType() { return SVGPaintType::RGBColor; }
     static Color initialFillPaintColor() { return Color::black; }
     static String initialFillPaintUri() { return String(); }
     static float initialStrokeOpacity() { return 1; }
-    static SVGPaintType initialStrokePaintType() { return SVG_PAINTTYPE_NONE; }
+    static SVGPaintType initialStrokePaintType() { return SVGPaintType::None; }
     static Color initialStrokePaintColor() { return Color(); }
     static String initialStrokePaintUri() { return String(); }
     static Vector<SVGLengthValue> initialStrokeDashArray() { return { }; }
@@ -81,26 +81,26 @@ public:
     static String initialMarkerStartResource() { return String(); }
     static String initialMarkerMidResource() { return String(); }
     static String initialMarkerEndResource() { return String(); }
-    static EMaskType initialMaskType() { return MT_LUMINANCE; }
+    static MaskType initialMaskType() { return MaskType::Luminance; }
     static SVGLengthValue initialBaselineShiftValue();
     static SVGLengthValue initialKerning();
 
     // SVG CSS Property setters
-    void setAlignmentBaseline(EAlignmentBaseline val) { m_nonInheritedFlags.flagBits.alignmentBaseline = val; }
-    void setDominantBaseline(EDominantBaseline val) { m_nonInheritedFlags.flagBits.dominantBaseline = val; }
-    void setBaselineShift(EBaselineShift val) { m_nonInheritedFlags.flagBits.baselineShift = val; }
-    void setVectorEffect(EVectorEffect val) { m_nonInheritedFlags.flagBits.vectorEffect = val; }
-    void setBufferedRendering(EBufferedRendering val) { m_nonInheritedFlags.flagBits.bufferedRendering = val; }
-    void setClipRule(WindRule val) { m_inheritedFlags.clipRule = val; }
-    void setColorInterpolation(EColorInterpolation val) { m_inheritedFlags.colorInterpolation = val; }
-    void setColorInterpolationFilters(EColorInterpolation val) { m_inheritedFlags.colorInterpolationFilters = val; }
-    void setColorRendering(EColorRendering val) { m_inheritedFlags.colorRendering = val; }
-    void setFillRule(WindRule val) { m_inheritedFlags.fillRule = val; }
-    void setShapeRendering(EShapeRendering val) { m_inheritedFlags.shapeRendering = val; }
-    void setTextAnchor(ETextAnchor val) { m_inheritedFlags.textAnchor = val; }
-    void setGlyphOrientationHorizontal(EGlyphOrientation val) { m_inheritedFlags.glyphOrientationHorizontal = val; }
-    void setGlyphOrientationVertical(EGlyphOrientation val) { m_inheritedFlags.glyphOrientationVertical = val; }
-    void setMaskType(EMaskType val) { m_nonInheritedFlags.flagBits.maskType = val; }
+    void setAlignmentBaseline(AlignmentBaseline val) { m_nonInheritedFlags.flagBits.alignmentBaseline = static_cast<unsigned>(val); }
+    void setDominantBaseline(DominantBaseline val) { m_nonInheritedFlags.flagBits.dominantBaseline = static_cast<unsigned>(val); }
+    void setBaselineShift(BaselineShift val) { m_nonInheritedFlags.flagBits.baselineShift = static_cast<unsigned>(val); }
+    void setVectorEffect(VectorEffect val) { m_nonInheritedFlags.flagBits.vectorEffect = static_cast<unsigned>(val); }
+    void setBufferedRendering(BufferedRendering val) { m_nonInheritedFlags.flagBits.bufferedRendering = static_cast<unsigned>(val); }
+    void setClipRule(WindRule val) { m_inheritedFlags.clipRule = static_cast<unsigned>(val); }
+    void setColorInterpolation(ColorInterpolation val) { m_inheritedFlags.colorInterpolation = static_cast<unsigned>(val); }
+    void setColorInterpolationFilters(ColorInterpolation val) { m_inheritedFlags.colorInterpolationFilters = static_cast<unsigned>(val); }
+    void setColorRendering(ColorRendering val) { m_inheritedFlags.colorRendering = static_cast<unsigned>(val); }
+    void setFillRule(WindRule val) { m_inheritedFlags.fillRule = static_cast<unsigned>(val); }
+    void setShapeRendering(ShapeRendering val) { m_inheritedFlags.shapeRendering = static_cast<unsigned>(val); }
+    void setTextAnchor(TextAnchor val) { m_inheritedFlags.textAnchor = static_cast<unsigned>(val); }
+    void setGlyphOrientationHorizontal(GlyphOrientation val) { m_inheritedFlags.glyphOrientationHorizontal = static_cast<unsigned>(val); }
+    void setGlyphOrientationVertical(GlyphOrientation val) { m_inheritedFlags.glyphOrientationVertical = static_cast<unsigned>(val); }
+    void setMaskType(MaskType val) { m_nonInheritedFlags.flagBits.maskType = static_cast<unsigned>(val); }
     void setCx(const Length&);
     void setCy(const Length&);
     void setR(const Length&);
@@ -135,26 +135,26 @@ public:
     void setMarkerEndResource(const String&);
 
     // Read accessors for all the properties
-    EAlignmentBaseline alignmentBaseline() const { return (EAlignmentBaseline) m_nonInheritedFlags.flagBits.alignmentBaseline; }
-    EDominantBaseline dominantBaseline() const { return (EDominantBaseline) m_nonInheritedFlags.flagBits.dominantBaseline; }
-    EBaselineShift baselineShift() const { return (EBaselineShift) m_nonInheritedFlags.flagBits.baselineShift; }
-    EVectorEffect vectorEffect() const { return (EVectorEffect) m_nonInheritedFlags.flagBits.vectorEffect; }
-    EBufferedRendering bufferedRendering() const { return (EBufferedRendering) m_nonInheritedFlags.flagBits.bufferedRendering; }
-    WindRule clipRule() const { return (WindRule) m_inheritedFlags.clipRule; }
-    EColorInterpolation colorInterpolation() const { return (EColorInterpolation) m_inheritedFlags.colorInterpolation; }
-    EColorInterpolation colorInterpolationFilters() const { return (EColorInterpolation) m_inheritedFlags.colorInterpolationFilters; }
-    EColorRendering colorRendering() const { return (EColorRendering) m_inheritedFlags.colorRendering; }
-    WindRule fillRule() const { return (WindRule) m_inheritedFlags.fillRule; }
-    EShapeRendering shapeRendering() const { return (EShapeRendering) m_inheritedFlags.shapeRendering; }
-    ETextAnchor textAnchor() const { return (ETextAnchor) m_inheritedFlags.textAnchor; }
-    EGlyphOrientation glyphOrientationHorizontal() const { return (EGlyphOrientation) m_inheritedFlags.glyphOrientationHorizontal; }
-    EGlyphOrientation glyphOrientationVertical() const { return (EGlyphOrientation) m_inheritedFlags.glyphOrientationVertical; }
+    AlignmentBaseline alignmentBaseline() const { return static_cast<AlignmentBaseline>(m_nonInheritedFlags.flagBits.alignmentBaseline); }
+    DominantBaseline dominantBaseline() const { return static_cast<DominantBaseline>(m_nonInheritedFlags.flagBits.dominantBaseline); }
+    BaselineShift baselineShift() const { return static_cast<BaselineShift>(m_nonInheritedFlags.flagBits.baselineShift); }
+    VectorEffect vectorEffect() const { return static_cast<VectorEffect>(m_nonInheritedFlags.flagBits.vectorEffect); }
+    BufferedRendering bufferedRendering() const { return static_cast<BufferedRendering>(m_nonInheritedFlags.flagBits.bufferedRendering); }
+    WindRule clipRule() const { return static_cast<WindRule>(m_inheritedFlags.clipRule); }
+    ColorInterpolation colorInterpolation() const { return static_cast<ColorInterpolation>(m_inheritedFlags.colorInterpolation); }
+    ColorInterpolation colorInterpolationFilters() const { return static_cast<ColorInterpolation>(m_inheritedFlags.colorInterpolationFilters); }
+    ColorRendering colorRendering() const { return static_cast<ColorRendering>(m_inheritedFlags.colorRendering); }
+    WindRule fillRule() const { return static_cast<WindRule>(m_inheritedFlags.fillRule); }
+    ShapeRendering shapeRendering() const { return static_cast<ShapeRendering>(m_inheritedFlags.shapeRendering); }
+    TextAnchor textAnchor() const { return static_cast<TextAnchor>(m_inheritedFlags.textAnchor); }
+    GlyphOrientation glyphOrientationHorizontal() const { return static_cast<GlyphOrientation>(m_inheritedFlags.glyphOrientationHorizontal); }
+    GlyphOrientation glyphOrientationVertical() const { return static_cast<GlyphOrientation>(m_inheritedFlags.glyphOrientationVertical); }
     float fillOpacity() const { return m_fillData->opacity; }
-    const SVGPaintType& fillPaintType() const { return m_fillData->paintType; }
+    SVGPaintType fillPaintType() const { return static_cast<SVGPaintType>(m_fillData->paintType); }
     const Color& fillPaintColor() const { return m_fillData->paintColor; }
     const String& fillPaintUri() const { return m_fillData->paintUri; }    
     float strokeOpacity() const { return m_strokeData->opacity; }
-    const SVGPaintType& strokePaintType() const { return m_strokeData->paintType; }
+    SVGPaintType strokePaintType() const { return static_cast<SVGPaintType>(m_strokeData->paintType); }
     const Color& strokePaintColor() const { return m_strokeData->paintColor; }
     const String& strokePaintUri() const { return m_strokeData->paintUri; }
     Vector<SVGLengthValue> strokeDashArray() const { return m_strokeData->dashArray; }
@@ -179,12 +179,12 @@ public:
     const String& markerStartResource() const { return m_inheritedResourceData->markerStart; }
     const String& markerMidResource() const { return m_inheritedResourceData->markerMid; }
     const String& markerEndResource() const { return m_inheritedResourceData->markerEnd; }
-    EMaskType maskType() const { return (EMaskType) m_nonInheritedFlags.flagBits.maskType; }
+    MaskType maskType() const { return static_cast<MaskType>(m_nonInheritedFlags.flagBits.maskType); }
 
-    const SVGPaintType& visitedLinkFillPaintType() const { return m_fillData->visitedLinkPaintType; }
+    SVGPaintType visitedLinkFillPaintType() const { return static_cast<SVGPaintType>(m_fillData->visitedLinkPaintType); }
     const Color& visitedLinkFillPaintColor() const { return m_fillData->visitedLinkPaintColor; }
     const String& visitedLinkFillPaintUri() const { return m_fillData->visitedLinkPaintUri; }
-    const SVGPaintType& visitedLinkStrokePaintType() const { return m_strokeData->visitedLinkPaintType; }
+    SVGPaintType visitedLinkStrokePaintType() const { return static_cast<SVGPaintType>(m_strokeData->visitedLinkPaintType); }
     const Color& visitedLinkStrokePaintColor() const { return m_strokeData->visitedLinkPaintColor; }
     const String& visitedLinkStrokePaintUri() const { return m_strokeData->visitedLinkPaintUri; }
 
@@ -192,8 +192,8 @@ public:
     bool hasClipper() const { return !clipperResource().isEmpty(); }
     bool hasMasker() const { return !maskerResource().isEmpty(); }
     bool hasMarkers() const { return !markerStartResource().isEmpty() || !markerMidResource().isEmpty() || !markerEndResource().isEmpty(); }
-    bool hasStroke() const { return strokePaintType() != SVG_PAINTTYPE_NONE; }
-    bool hasFill() const { return fillPaintType() != SVG_PAINTTYPE_NONE; }
+    bool hasStroke() const { return strokePaintType() != SVGPaintType::None; }
+    bool hasFill() const { return fillPaintType() != SVGPaintType::None; }
     bool isolatesBlending() const { return hasMasker() || shadow(); }
 
 private:
@@ -209,15 +209,15 @@ private:
         bool operator==(const InheritedFlags&) const;
         bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
 
-        unsigned colorRendering : 2; // EColorRendering
-        unsigned shapeRendering : 2; // EShapeRendering
+        unsigned colorRendering : 2; // ColorRendering
+        unsigned shapeRendering : 2; // ShapeRendering
         unsigned clipRule : 1; // WindRule
         unsigned fillRule : 1; // WindRule
-        unsigned textAnchor : 2; // ETextAnchor
-        unsigned colorInterpolation : 2; // EColorInterpolation
-        unsigned colorInterpolationFilters : 2; // EColorInterpolation
-        unsigned glyphOrientationHorizontal : 3; // EGlyphOrientation
-        unsigned glyphOrientationVertical : 3; // EGlyphOrientation
+        unsigned textAnchor : 2; // TextAnchor
+        unsigned colorInterpolation : 2; // ColorInterpolation
+        unsigned colorInterpolationFilters : 2; // ColorInterpolation
+        unsigned glyphOrientationHorizontal : 3; // GlyphOrientation
+        unsigned glyphOrientationVertical : 3; // GlyphOrientation
     };
 
     struct NonInheritedFlags {
@@ -227,12 +227,12 @@ private:
 
         union {
             struct {
-                unsigned alignmentBaseline : 4; // EAlignmentBaseline
-                unsigned dominantBaseline : 4; // EDominantBaseline
-                unsigned baselineShift : 2; // EBaselineShift
-                unsigned vectorEffect: 1; // EVectorEffect
-                unsigned bufferedRendering: 2; // EBufferedRendering
-                unsigned maskType: 1; // EMaskType
+                unsigned alignmentBaseline : 4; // AlignmentBaseline
+                unsigned dominantBaseline : 4; // DominantBaseline
+                unsigned baselineShift : 2; // BaselineShift
+                unsigned vectorEffect: 1; // VectorEffect
+                unsigned bufferedRendering: 2; // BufferedRendering
+                unsigned maskType: 1; // MaskType
                 // 18 bits unused
             } flagBits;
             uint32_t flags;
@@ -450,23 +450,23 @@ inline void SVGRenderStyle::setMarkerEndResource(const String& resource)
 
 inline void SVGRenderStyle::setBitDefaults()
 {
-    m_inheritedFlags.clipRule = initialClipRule();
-    m_inheritedFlags.colorRendering = initialColorRendering();
-    m_inheritedFlags.fillRule = initialFillRule();
-    m_inheritedFlags.shapeRendering = initialShapeRendering();
-    m_inheritedFlags.textAnchor = initialTextAnchor();
-    m_inheritedFlags.colorInterpolation = initialColorInterpolation();
-    m_inheritedFlags.colorInterpolationFilters = initialColorInterpolationFilters();
-    m_inheritedFlags.glyphOrientationHorizontal = initialGlyphOrientationHorizontal();
-    m_inheritedFlags.glyphOrientationVertical = initialGlyphOrientationVertical();
+    m_inheritedFlags.clipRule = static_cast<unsigned>(initialClipRule());
+    m_inheritedFlags.colorRendering = static_cast<unsigned>(initialColorRendering());
+    m_inheritedFlags.fillRule = static_cast<unsigned>(initialFillRule());
+    m_inheritedFlags.shapeRendering = static_cast<unsigned>(initialShapeRendering());
+    m_inheritedFlags.textAnchor = static_cast<unsigned>(initialTextAnchor());
+    m_inheritedFlags.colorInterpolation = static_cast<unsigned>(initialColorInterpolation());
+    m_inheritedFlags.colorInterpolationFilters = static_cast<unsigned>(initialColorInterpolationFilters());
+    m_inheritedFlags.glyphOrientationHorizontal = static_cast<unsigned>(initialGlyphOrientationHorizontal());
+    m_inheritedFlags.glyphOrientationVertical = static_cast<unsigned>(initialGlyphOrientationVertical());
 
     m_nonInheritedFlags.flags = 0;
-    m_nonInheritedFlags.flagBits.alignmentBaseline = initialAlignmentBaseline();
-    m_nonInheritedFlags.flagBits.dominantBaseline = initialDominantBaseline();
-    m_nonInheritedFlags.flagBits.baselineShift = initialBaselineShift();
-    m_nonInheritedFlags.flagBits.vectorEffect = initialVectorEffect();
-    m_nonInheritedFlags.flagBits.bufferedRendering = initialBufferedRendering();
-    m_nonInheritedFlags.flagBits.maskType = initialMaskType();
+    m_nonInheritedFlags.flagBits.alignmentBaseline = static_cast<unsigned>(initialAlignmentBaseline());
+    m_nonInheritedFlags.flagBits.dominantBaseline = static_cast<unsigned>(initialDominantBaseline());
+    m_nonInheritedFlags.flagBits.baselineShift = static_cast<unsigned>(initialBaselineShift());
+    m_nonInheritedFlags.flagBits.vectorEffect = static_cast<unsigned>(initialVectorEffect());
+    m_nonInheritedFlags.flagBits.bufferedRendering = static_cast<unsigned>(initialBufferedRendering());
+    m_nonInheritedFlags.flagBits.maskType = static_cast<unsigned>(initialMaskType());
 }
 
 inline bool SVGRenderStyle::InheritedFlags::operator==(const InheritedFlags& other) const
index b28d79d..d74de78 100644 (file)
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
-    enum SVGPaintType {
-        SVG_PAINTTYPE_RGBCOLOR,
-        SVG_PAINTTYPE_NONE,
-        SVG_PAINTTYPE_CURRENTCOLOR,
-        SVG_PAINTTYPE_URI_NONE,
-        SVG_PAINTTYPE_URI_CURRENTCOLOR,
-        SVG_PAINTTYPE_URI_RGBCOLOR,
-        SVG_PAINTTYPE_URI
-    };
-
-    enum EBaselineShift {
-        BS_BASELINE, BS_SUB, BS_SUPER, BS_LENGTH
-    };
-
-    enum ETextAnchor {
-        TA_START, TA_MIDDLE, TA_END
-    };
-
-    enum EColorInterpolation {
-        CI_AUTO, CI_SRGB, CI_LINEARRGB
-    };
-
-    enum EColorRendering {
-        CR_AUTO, CR_OPTIMIZESPEED, CR_OPTIMIZEQUALITY
-    };
-    enum EShapeRendering {
-        SR_AUTO, SR_OPTIMIZESPEED, SR_CRISPEDGES, SR_GEOMETRICPRECISION
-    };
-
-    enum EGlyphOrientation {
-        GO_0DEG, GO_90DEG, GO_180DEG, GO_270DEG, GO_AUTO
-    };
-
-    enum EAlignmentBaseline {
-        AB_AUTO, AB_BASELINE, AB_BEFORE_EDGE, AB_TEXT_BEFORE_EDGE,
-        AB_MIDDLE, AB_CENTRAL, AB_AFTER_EDGE, AB_TEXT_AFTER_EDGE,
-        AB_IDEOGRAPHIC, AB_ALPHABETIC, AB_HANGING, AB_MATHEMATICAL
-    };
-
-    enum EDominantBaseline {
-        DB_AUTO, DB_USE_SCRIPT, DB_NO_CHANGE, DB_RESET_SIZE,
-        DB_IDEOGRAPHIC, DB_ALPHABETIC, DB_HANGING, DB_MATHEMATICAL,
-        DB_CENTRAL, DB_MIDDLE, DB_TEXT_AFTER_EDGE, DB_TEXT_BEFORE_EDGE
-    };
+
+class CSSValue;
+class CSSValueList;
+class SVGPaint;
+
+enum class SVGPaintType {
+    RGBColor,
+    None,
+    CurrentColor,
+    URINone,
+    URICurrentColor,
+    URIRGBColor,
+    URI
+};
+
+enum class BaselineShift {
+    Baseline,
+    Sub,
+    Super,
+    Length
+};
+
+enum class TextAnchor {
+    Start,
+    Middle,
+    End
+};
+
+enum class ColorInterpolation {
+    Auto,
+    SRGB,
+    LinearRGB
+};
+
+enum class ColorRendering {
+    Auto,
+    OptimizeSpeed,
+    OptimizeQuality
+};
+enum class ShapeRendering {
+    Auto,
+    OptimizeSpeed,
+    CrispEdges,
+    GeometricPrecision
+};
+
+enum class GlyphOrientation {
+    Degrees0,
+    Degrees90,
+    Degrees180,
+    Degrees270,
+    Auto
+};
+
+enum class AlignmentBaseline {
+    Auto,
+    Baseline,
+    BeforeEdge,
+    TextBeforeEdge,
+    Middle,
+    Central,
+    AfterEdge,
+    TextAfterEdge,
+    Ideographic,
+    Alphabetic,
+    Hanging,
+    Mathematical
+};
+
+enum class DominantBaseline {
+    Auto,
+    UseScript,
+    NoChange,
+    ResetSize,
+    Ideographic,
+    Alphabetic,
+    Hanging,
+    Mathematical,
+    Central,
+    Middle,
+    TextAfterEdge,
+    TextBeforeEdge
+};
+
+enum class VectorEffect {
+    None,
+    NonScalingStroke
+};
+
+enum class BufferedRendering {
+    Auto,
+    Dynamic,
+    Static
+};
+
+enum class MaskType {
+    Luminance,
+    Alpha
+};
+
+// Inherited/Non-Inherited Style Datastructures
+class StyleFillData : public RefCounted<StyleFillData> {
+public:
+    static Ref<StyleFillData> create() { return adoptRef(*new StyleFillData); }
+    Ref<StyleFillData> copy() const;
+
+    bool operator==(const StyleFillData&) const;
+    bool operator!=(const StyleFillData& other) const
+    {
+        return !(*this == other);
+    }
+
+    float opacity;
+    SVGPaintType paintType;
+    Color paintColor;
+    String paintUri;
+    SVGPaintType visitedLinkPaintType;
+    Color visitedLinkPaintColor;
+    String visitedLinkPaintUri;
+
+private:
+    StyleFillData();
+    StyleFillData(const StyleFillData&);
+};
+
+class StyleStrokeData : public RefCounted<StyleStrokeData> {
+public:
+    static Ref<StyleStrokeData> create() { return adoptRef(*new StyleStrokeData); }
+    Ref<StyleStrokeData> copy() const;
+
+    bool operator==(const StyleStrokeData&) const;
+    bool operator!=(const StyleStrokeData& other) const
+    {
+        return !(*this == other);
+    }
+
+    float opacity;
+
+    Length dashOffset;
+    Vector<SVGLengthValue> dashArray;
+
+    SVGPaintType paintType;
+    Color paintColor;
+    String paintUri;
+    SVGPaintType visitedLinkPaintType;
+    Color visitedLinkPaintColor;
+    String visitedLinkPaintUri;
+
+private:
+    StyleStrokeData();
+    StyleStrokeData(const StyleStrokeData&);
+};
+
+class StyleStopData : public RefCounted<StyleStopData> {
+public:
+    static Ref<StyleStopData> create() { return adoptRef(*new StyleStopData); }
+    Ref<StyleStopData> copy() const;
+
+    bool operator==(const StyleStopData&) const;
+    bool operator!=(const StyleStopData& other) const
+    {
+        return !(*this == other);
+    }
+
+    float opacity;
+    Color color;
+
+private:
+    StyleStopData();
+    StyleStopData(const StyleStopData&);
+};
+
+class StyleTextData : public RefCounted<StyleTextData> {
+public:
+    static Ref<StyleTextData> create() { return adoptRef(*new StyleTextData); }
+    Ref<StyleTextData> copy() const;
     
-    enum EVectorEffect {
-        VE_NONE,
-        VE_NON_SCALING_STROKE
-    };
-
-    enum EBufferedRendering {
-        BR_AUTO,
-        BR_DYNAMIC,
-        BR_STATIC
-    };
-
-    enum EMaskType {
-        MT_LUMINANCE,
-        MT_ALPHA
-    };
-
-    class CSSValue;
-    class CSSValueList;
-    class SVGPaint;
-
-    // Inherited/Non-Inherited Style Datastructures
-    class StyleFillData : public RefCounted<StyleFillData> {
-    public:
-        static Ref<StyleFillData> create() { return adoptRef(*new StyleFillData); }
-        Ref<StyleFillData> copy() const;
-
-        bool operator==(const StyleFillData&) const;
-        bool operator!=(const StyleFillData& other) const
-        {
-            return !(*this == other);
-        }
-
-        float opacity;
-        SVGPaintType paintType;
-        Color paintColor;
-        String paintUri;
-        SVGPaintType visitedLinkPaintType;
-        Color visitedLinkPaintColor;
-        String visitedLinkPaintUri;
-
-    private:
-        StyleFillData();
-        StyleFillData(const StyleFillData&);
-    };
-
-    class StyleStrokeData : public RefCounted<StyleStrokeData> {
-    public:
-        static Ref<StyleStrokeData> create() { return adoptRef(*new StyleStrokeData); }
-        Ref<StyleStrokeData> copy() const;
-
-        bool operator==(const StyleStrokeData&) const;
-        bool operator!=(const StyleStrokeData& other) const
-        {
-            return !(*this == other);
-        }
-
-        float opacity;
-
-        Length dashOffset;
-        Vector<SVGLengthValue> dashArray;
-
-        SVGPaintType paintType;
-        Color paintColor;
-        String paintUri;
-        SVGPaintType visitedLinkPaintType;
-        Color visitedLinkPaintColor;
-        String visitedLinkPaintUri;
-
-    private:        
-        StyleStrokeData();
-        StyleStrokeData(const StyleStrokeData&);
-    };
-
-    class StyleStopData : public RefCounted<StyleStopData> {
-    public:
-        static Ref<StyleStopData> create() { return adoptRef(*new StyleStopData); }
-        Ref<StyleStopData> copy() const;
-
-        bool operator==(const StyleStopData&) const;
-        bool operator!=(const StyleStopData& other) const
-        {
-            return !(*this == other);
-        }
-
-        float opacity;
-        Color color;
-
-    private:        
-        StyleStopData();
-        StyleStopData(const StyleStopData&);
-    };
-
-    class StyleTextData : public RefCounted<StyleTextData> {
-    public:
-        static Ref<StyleTextData> create() { return adoptRef(*new StyleTextData); }
-        Ref<StyleTextData> copy() const;
-        
-        bool operator==(const StyleTextData& other) const;
-        bool operator!=(const StyleTextData& other) const
-        {
-            return !(*this == other);
-        }
-
-        SVGLengthValue kerning;
-
-    private:
-        StyleTextData();
-        StyleTextData(const StyleTextData&);
-    };
-
-    // Note: the rule for this class is, *no inheritance* of these props
-    class StyleMiscData : public RefCounted<StyleMiscData> {
-    public:
-        static Ref<StyleMiscData> create() { return adoptRef(*new StyleMiscData); }
-        Ref<StyleMiscData> copy() const;
-
-        bool operator==(const StyleMiscData&) const;
-        bool operator!=(const StyleMiscData& other) const
-        {
-            return !(*this == other);
-        }
-
-        Color floodColor;
-        float floodOpacity;
-        Color lightingColor;
-
-        // non-inherited text stuff lives here not in StyleTextData.
-        SVGLengthValue baselineShiftValue;
-
-    private:
-        StyleMiscData();
-        StyleMiscData(const StyleMiscData&);
-    };
-
-    class StyleShadowSVGData : public RefCounted<StyleShadowSVGData> {
-    public:
-        static Ref<StyleShadowSVGData> create() { return adoptRef(*new StyleShadowSVGData); }
-        Ref<StyleShadowSVGData> copy() const;
-
-        bool operator==(const StyleShadowSVGData&) const;
-        bool operator!=(const StyleShadowSVGData& other) const
-        {
-            return !(*this == other);
-        }
-
-        std::unique_ptr<ShadowData> shadow;
-
-    private:
-        StyleShadowSVGData();
-        StyleShadowSVGData(const StyleShadowSVGData&);
-    };
-
-    // Non-inherited resources
-    class StyleResourceData : public RefCounted<StyleResourceData> {
-    public:
-        static Ref<StyleResourceData> create() { return adoptRef(*new StyleResourceData); }
-        Ref<StyleResourceData> copy() const;
-
-        bool operator==(const StyleResourceData&) const;
-        bool operator!=(const StyleResourceData& other) const
-        {
-            return !(*this == other);
-        }
-
-        String clipper;
-        String masker;
-
-    private:
-        StyleResourceData();
-        StyleResourceData(const StyleResourceData&);
-    };
-
-    // Inherited resources
-    class StyleInheritedResourceData : public RefCounted<StyleInheritedResourceData> {
-    public:
-        static Ref<StyleInheritedResourceData> create() { return adoptRef(*new StyleInheritedResourceData); }
-        Ref<StyleInheritedResourceData> copy() const;
-
-        bool operator==(const StyleInheritedResourceData&) const;
-        bool operator!=(const StyleInheritedResourceData& other) const
-        {
-            return !(*this == other);
-        }
-
-        String markerStart;
-        String markerMid;
-        String markerEnd;
-
-    private:
-        StyleInheritedResourceData();
-        StyleInheritedResourceData(const StyleInheritedResourceData&);
-    };
-
-    // Positioning and sizing properties.
-    class StyleLayoutData : public RefCounted<StyleLayoutData> {
-    public:
-        static Ref<StyleLayoutData> create() { return adoptRef(*new StyleLayoutData); }
-        Ref<StyleLayoutData> copy() const;
-
-        bool operator==(const StyleLayoutData&) const;
-        bool operator!=(const StyleLayoutData& other) const
-        {
-            return !(*this == other);
-        }
-
-        Length cx;
-        Length cy;
-        Length r;
-        Length rx;
-        Length ry;
-        Length x;
-        Length y;
-
-    private:        
-        StyleLayoutData();
-        StyleLayoutData(const StyleLayoutData&);
-    };
+    bool operator==(const StyleTextData& other) const;
+    bool operator!=(const StyleTextData& other) const
+    {
+        return !(*this == other);
+    }
+
+    SVGLengthValue kerning;
+
+private:
+    StyleTextData();
+    StyleTextData(const StyleTextData&);
+};
+
+// Note: the rule for this class is, *no inheritance* of these props
+class StyleMiscData : public RefCounted<StyleMiscData> {
+public:
+    static Ref<StyleMiscData> create() { return adoptRef(*new StyleMiscData); }
+    Ref<StyleMiscData> copy() const;
+
+    bool operator==(const StyleMiscData&) const;
+    bool operator!=(const StyleMiscData& other) const
+    {
+        return !(*this == other);
+    }
+
+    Color floodColor;
+    float floodOpacity;
+    Color lightingColor;
+
+    // non-inherited text stuff lives here not in StyleTextData.
+    SVGLengthValue baselineShiftValue;
+
+private:
+    StyleMiscData();
+    StyleMiscData(const StyleMiscData&);
+};
+
+class StyleShadowSVGData : public RefCounted<StyleShadowSVGData> {
+public:
+    static Ref<StyleShadowSVGData> create() { return adoptRef(*new StyleShadowSVGData); }
+    Ref<StyleShadowSVGData> copy() const;
+
+    bool operator==(const StyleShadowSVGData&) const;
+    bool operator!=(const StyleShadowSVGData& other) const
+    {
+        return !(*this == other);
+    }
+
+    std::unique_ptr<ShadowData> shadow;
+
+private:
+    StyleShadowSVGData();
+    StyleShadowSVGData(const StyleShadowSVGData&);
+};
+
+// Non-inherited resources
+class StyleResourceData : public RefCounted<StyleResourceData> {
+public:
+    static Ref<StyleResourceData> create() { return adoptRef(*new StyleResourceData); }
+    Ref<StyleResourceData> copy() const;
+
+    bool operator==(const StyleResourceData&) const;
+    bool operator!=(const StyleResourceData& other) const
+    {
+        return !(*this == other);
+    }
+
+    String clipper;
+    String masker;
+
+private:
+    StyleResourceData();
+    StyleResourceData(const StyleResourceData&);
+};
+
+// Inherited resources
+class StyleInheritedResourceData : public RefCounted<StyleInheritedResourceData> {
+public:
+    static Ref<StyleInheritedResourceData> create() { return adoptRef(*new StyleInheritedResourceData); }
+    Ref<StyleInheritedResourceData> copy() const;
+
+    bool operator==(const StyleInheritedResourceData&) const;
+    bool operator!=(const StyleInheritedResourceData& other) const
+    {
+        return !(*this == other);
+    }
+
+    String markerStart;
+    String markerMid;
+    String markerEnd;
+
+private:
+    StyleInheritedResourceData();
+    StyleInheritedResourceData(const StyleInheritedResourceData&);
+};
+
+// Positioning and sizing properties.
+class StyleLayoutData : public RefCounted<StyleLayoutData> {
+public:
+    static Ref<StyleLayoutData> create() { return adoptRef(*new StyleLayoutData); }
+    Ref<StyleLayoutData> copy() const;
+
+    bool operator==(const StyleLayoutData&) const;
+    bool operator!=(const StyleLayoutData& other) const
+    {
+        return !(*this == other);
+    }
+
+    Length cx;
+    Length cy;
+    Length r;
+    Length rx;
+    Length ry;
+    Length x;
+    Length y;
+
+private:
+    StyleLayoutData();
+    StyleLayoutData(const StyleLayoutData&);
+};
 
 } // namespace WebCore
index 5308fa6..94c56ef 100644 (file)
@@ -155,7 +155,7 @@ void RenderSVGImage::paint(PaintInfo& paintInfo, const LayoutPoint&)
         SVGRenderingContext renderingContext(*this, childPaintInfo);
 
         if (renderingContext.isRenderingPrepared()) {
-            if (style().svgStyle().bufferedRendering() == BR_STATIC && renderingContext.bufferForeground(m_bufferedForeground))
+            if (style().svgStyle().bufferedRendering() == BufferedRendering::Static && renderingContext.bufferForeground(m_bufferedForeground))
                 return;
 
             paintForeground(childPaintInfo);
index cf9c040..b8642d2 100644 (file)
@@ -93,7 +93,7 @@ void RenderSVGRect::updateShapeFromElement()
 
 #if USE(CG)
     // CoreGraphics can inflate the stroke by 1px when drawing a rectangle with antialiasing disabled at non-integer coordinates, we need to compensate.
-    if (style().svgStyle().shapeRendering() == SR_CRISPEDGES)
+    if (style().svgStyle().shapeRendering() == ShapeRendering::CrispEdges)
         m_strokeBoundingBox.inflate(1);
 #endif
 }
index 5c606b0..e7d9fc1 100644 (file)
@@ -71,15 +71,15 @@ static inline RenderSVGResource* requestPaintingResource(OptionSet<RenderSVGReso
 
     bool applyToFill = mode == RenderSVGResourceMode::ApplyToFill;
     SVGPaintType paintType = applyToFill ? svgStyle.fillPaintType() : svgStyle.strokePaintType();
-    if (paintType == SVG_PAINTTYPE_NONE)
+    if (paintType == SVGPaintType::None)
         return nullptr;
 
     Color color;
     switch (paintType) {
-    case SVG_PAINTTYPE_CURRENTCOLOR:
-    case SVG_PAINTTYPE_RGBCOLOR:
-    case SVG_PAINTTYPE_URI_CURRENTCOLOR:
-    case SVG_PAINTTYPE_URI_RGBCOLOR:
+    case SVGPaintType::CurrentColor:
+    case SVGPaintType::RGBColor:
+    case SVGPaintType::URICurrentColor:
+    case SVGPaintType::URIRGBColor:
         color = applyToFill ? svgStyle.fillPaintColor() : svgStyle.strokePaintColor();
         break;
     default:
@@ -90,8 +90,8 @@ static inline RenderSVGResource* requestPaintingResource(OptionSet<RenderSVGReso
         // FIXME: This code doesn't support the uri component of the visited link paint, https://bugs.webkit.org/show_bug.cgi?id=70006
         SVGPaintType visitedPaintType = applyToFill ? svgStyle.visitedLinkFillPaintType() : svgStyle.visitedLinkStrokePaintType();
 
-        // For SVG_PAINTTYPE_CURRENTCOLOR, 'color' already contains the 'visitedColor'.
-        if (visitedPaintType < SVG_PAINTTYPE_URI_NONE && visitedPaintType != SVG_PAINTTYPE_CURRENTCOLOR) {
+        // For SVGPaintType::CurrentColor, 'color' already contains the 'visitedColor'.
+        if (visitedPaintType < SVGPaintType::URINone && visitedPaintType != SVGPaintType::CurrentColor) {
             const Color& visitedColor = applyToFill ? svgStyle.visitedLinkFillPaintColor() : svgStyle.visitedLinkStrokePaintColor();
             if (visitedColor.isValid())
                 color = visitedColor.colorWithAlpha(color.alphaAsFloat());
@@ -100,7 +100,7 @@ static inline RenderSVGResource* requestPaintingResource(OptionSet<RenderSVGReso
 
     // If the primary resource is just a color, return immediately.
     RenderSVGResourceSolidColor* colorResource = RenderSVGResource::sharedSolidPaintingResource();
-    if (paintType < SVG_PAINTTYPE_URI_NONE) {
+    if (paintType < SVGPaintType::URINone) {
         if (!inheritColorFromParentStyleIfNeeded(renderer, applyToFill, color))
             return nullptr;
 
@@ -111,7 +111,7 @@ static inline RenderSVGResource* requestPaintingResource(OptionSet<RenderSVGReso
     // If no resources are associated with the given renderer, return the color resource.
     auto* resources = SVGResourcesCache::cachedResourcesForRenderer(renderer);
     if (!resources) {
-        if (paintType == SVG_PAINTTYPE_URI_NONE || !inheritColorFromParentStyleIfNeeded(renderer, applyToFill, color))
+        if (paintType == SVGPaintType::URINone || !inheritColorFromParentStyleIfNeeded(renderer, applyToFill, color))
             return nullptr;
 
         colorResource->setColor(color);
index 156e0d0..eb20713 100644 (file)
@@ -78,7 +78,7 @@ bool RenderSVGResourceClipper::pathOnlyClipping(GraphicsContext& context, const
     // If the current clip-path gets clipped itself, we have to fallback to masking.
     if (!style().svgStyle().clipperResource().isEmpty())
         return false;
-    WindRule clipRule = RULE_NONZERO;
+    WindRule clipRule = WindRule::NonZero;
     Path clipPath = Path();
 
     // If clip-path only contains one visible shape or path, we can use path-based clipping. Invisible
index 8ca9ada..069a07c 100644 (file)
@@ -102,7 +102,7 @@ std::unique_ptr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives(SVGFi
         element.setStandardAttributes(effect.get());
         effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(&element, filterElement().primitiveUnits(), targetBoundingBox));
         if (element.renderer())
-            effect->setOperatingColorSpace(element.renderer()->style().svgStyle().colorInterpolationFilters() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceSRGB);
+            effect->setOperatingColorSpace(element.renderer()->style().svgStyle().colorInterpolationFilters() == ColorInterpolation::LinearRGB ? ColorSpaceLinearRGB : ColorSpaceSRGB);
         builder->add(element.result(), WTFMove(effect));
     }
     return builder;
index 9781c4e..badb08f 100644 (file)
@@ -177,7 +177,7 @@ bool RenderSVGResourceGradient::applyResource(RenderElement& renderer, const Ren
         context->setFillGradient(*gradientData->gradient);
         context->setFillRule(svgStyle.fillRule());
     } else if (resourceMode.contains(RenderSVGResourceMode::ApplyToStroke)) {
-        if (svgStyle.vectorEffect() == VE_NON_SCALING_STROKE)
+        if (svgStyle.vectorEffect() == VectorEffect::NonScalingStroke)
             gradientData->gradient->setGradientSpaceTransform(transformOnNonScalingStroke(&renderer, gradientData->userspaceTransform));
         context->setAlpha(svgStyle.strokeOpacity());
         context->setStrokeGradient(*gradientData->gradient);
index 9fbcff9..39a8cb6 100644 (file)
@@ -69,7 +69,7 @@ bool RenderSVGResourceMasker::applyResource(RenderElement& renderer, const Rende
 
     if (!maskerData->maskImage && !repaintRect.isEmpty()) {
         const SVGRenderStyle& svgStyle = style().svgStyle();
-        ColorSpace colorSpace = svgStyle.colorInterpolation() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceSRGB;
+        ColorSpace colorSpace = svgStyle.colorInterpolation() == ColorInterpolation::LinearRGB ? ColorSpaceLinearRGB : ColorSpaceSRGB;
         // FIXME (149470): This image buffer should not be unconditionally unaccelerated. Making it match the context breaks alpha masking, though.
         maskerData->maskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, colorSpace, Unaccelerated);
         if (!maskerData->maskImage)
@@ -119,7 +119,7 @@ bool RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, C
 #endif
 
     // Create the luminance mask.
-    if (style().svgStyle().maskType() == MT_LUMINANCE)
+    if (style().svgStyle().maskType() == MaskType::Luminance)
         maskerData->maskImage->convertToLuminanceMask();
 
     return true;
index 13ce6d7..9587fdd 100644 (file)
@@ -176,7 +176,7 @@ bool RenderSVGResourcePattern::applyResource(RenderElement& renderer, const Rend
         context->setFillPattern(*patternData->pattern);
         context->setFillRule(svgStyle.fillRule());
     } else if (resourceMode.contains(RenderSVGResourceMode::ApplyToStroke)) {
-        if (svgStyle.vectorEffect() == VE_NON_SCALING_STROKE)
+        if (svgStyle.vectorEffect() == VectorEffect::NonScalingStroke)
             patternData->pattern->setPatternSpaceTransform(transformOnNonScalingStroke(&renderer, patternData->transform));
         context->setAlpha(svgStyle.strokeOpacity());
         context->setStrokePattern(*patternData->pattern);
index ed6a83d..a4d905a 100644 (file)
@@ -312,7 +312,7 @@ void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&)
 
         if (renderingContext.isRenderingPrepared()) {
             const SVGRenderStyle& svgStyle = style().svgStyle();
-            if (svgStyle.shapeRendering() == SR_CRISPEDGES)
+            if (svgStyle.shapeRendering() == ShapeRendering::CrispEdges)
                 childPaintInfo.context().setShouldAntialias(false);
 
             fillStrokeMarkers(childPaintInfo);
index 4f0a78f..c3bdebd 100644 (file)
@@ -86,7 +86,7 @@ protected:
     float strokeWidth() const;
     bool hasSmoothStroke() const;
 
-    bool hasNonScalingStroke() const { return style().svgStyle().vectorEffect() == VE_NON_SCALING_STROKE; }
+    bool hasNonScalingStroke() const { return style().svgStyle().vectorEffect() == VectorEffect::NonScalingStroke; }
     AffineTransform nonScalingStrokeTransform() const;
     Path* nonScalingStrokePath(const Path*, const AffineTransform&) const;
 
@@ -95,7 +95,7 @@ protected:
 
 private:
     // Hit-detection separated for the fill and the stroke
-    bool fillContains(const FloatPoint&, bool requiresFill = true, const WindRule fillRule = RULE_NONZERO);
+    bool fillContains(const FloatPoint&, bool requiresFill = true, const WindRule fillRule = WindRule::NonZero);
     bool strokeContains(const FloatPoint&, bool requiresStroke = true);
 
     FloatRect repaintRectInLocalCoordinates() const final { return m_repaintBoundingBox; }
index 7f54953..fabc8b2 100644 (file)
@@ -211,10 +211,10 @@ static void writeStyle(TextStream& ts, const RenderElement& renderer)
             writeSVGPaintingResource(ts, fillPaintingResource);
 
             writeIfNotDefault(ts, "opacity", svgStyle.fillOpacity(), 1.0f);
-            writeIfNotDefault(ts, "fill rule", svgStyle.fillRule(), RULE_NONZERO);
+            writeIfNotDefault(ts, "fill rule", svgStyle.fillRule(), WindRule::NonZero);
             ts << "}]";
         }
-        writeIfNotDefault(ts, "clip rule", svgStyle.clipRule(), RULE_NONZERO);
+        writeIfNotDefault(ts, "clip rule", svgStyle.clipRule(), WindRule::NonZero);
     }
 
     writeIfNotEmpty(ts, "start marker", svgStyle.markerStartResource());
@@ -319,14 +319,14 @@ static inline void writeSVGInlineTextBox(TextStream& ts, SVGInlineTextBox* textB
 
         // FIXME: Remove this hack, once the new text layout engine is completly landed. We want to preserve the old layout test results for now.
         ts << "chunk 1 ";
-        ETextAnchor anchor = svgStyle.textAnchor();
+        TextAnchor anchor = svgStyle.textAnchor();
         bool isVerticalText = textBox->renderer().style().isVerticalWritingMode();
-        if (anchor == TA_MIDDLE) {
+        if (anchor == TextAnchor::Middle) {
             ts << "(middle anchor";
             if (isVerticalText)
                 ts << ", vertical";
             ts << ") ";
-        } else if (anchor == TA_END) {
+        } else if (anchor == TextAnchor::End) {
             ts << "(end anchor";
             if (isVerticalText)
                 ts << ", vertical";
index d8e71b7..68fae61 100644 (file)
@@ -170,7 +170,7 @@ static inline bool isChainableResource(const SVGElement& element, const SVGEleme
 
 static inline RenderSVGResourceContainer* paintingResourceFromSVGPaint(Document& document, const SVGPaintType& paintType, const String& paintUri, AtomicString& id, bool& hasPendingResource)
 {
-    if (paintType != SVG_PAINTTYPE_URI && paintType != SVG_PAINTTYPE_URI_RGBCOLOR && paintType != SVG_PAINTTYPE_URI_CURRENTCOLOR)
+    if (paintType != SVGPaintType::URI && paintType != SVGPaintType::URIRGBColor && paintType != SVGPaintType::URICurrentColor)
         return nullptr;
 
     id = SVGURIReference::fragmentIdentifierFromIRIString(paintUri, document);
index 621c542..b60b2ce 100644 (file)
@@ -43,12 +43,12 @@ SVGTextChunk::SVGTextChunk(const Vector<SVGInlineTextBox*>& lineLayoutBoxes, uns
         m_chunkStyle |= SVGTextChunk::VerticalText;
     
     switch (svgStyle.textAnchor()) {
-    case TA_START:
+    case TextAnchor::Start:
         break;
-    case TA_MIDDLE:
+    case TextAnchor::Middle:
         m_chunkStyle |= MiddleAnchor;
         break;
-    case TA_END:
+    case TextAnchor::End:
         m_chunkStyle |= EndAnchor;
         break;
     }
index e037716..f746338 100644 (file)
@@ -35,7 +35,7 @@ SVGTextLayoutEngineBaseline::SVGTextLayoutEngineBaseline(const FontCascade& font
 
 float SVGTextLayoutEngineBaseline::calculateBaselineShift(const SVGRenderStyle& style, SVGElement* context) const
 {
-    if (style.baselineShift() == BS_LENGTH) {
+    if (style.baselineShift() == BaselineShift::Length) {
         auto baselineShiftValueLength = style.baselineShiftValue();
         if (baselineShiftValueLength.unitType() == LengthTypePercentage)
             return baselineShiftValueLength.valueAsPercentage() * m_font.pixelSize();
@@ -45,61 +45,61 @@ float SVGTextLayoutEngineBaseline::calculateBaselineShift(const SVGRenderStyle&
     }
 
     switch (style.baselineShift()) {
-    case BS_BASELINE:
+    case BaselineShift::Baseline:
         return 0;
-    case BS_SUB:
+    case BaselineShift::Sub:
         return -m_font.fontMetrics().floatHeight() / 2;
-    case BS_SUPER:
+    case BaselineShift::Super:
         return m_font.fontMetrics().floatHeight() / 2;
-    case BS_LENGTH:
+    case BaselineShift::Length:
         break;
     }
     ASSERT_NOT_REACHED();
     return 0;
 }
 
-EAlignmentBaseline SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline(bool isVerticalText, const RenderObject* textRenderer) const
+AlignmentBaseline SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline(bool isVerticalText, const RenderObject* textRenderer) const
 {
     ASSERT(textRenderer);
     ASSERT(textRenderer->parent());
 
     const SVGRenderStyle& svgStyle = textRenderer->style().svgStyle();
 
-    EDominantBaseline baseline = svgStyle.dominantBaseline();
-    if (baseline == DB_AUTO) {
+    DominantBaseline baseline = svgStyle.dominantBaseline();
+    if (baseline == DominantBaseline::Auto) {
         if (isVerticalText)
-            baseline = DB_CENTRAL;
+            baseline = DominantBaseline::Central;
         else
-            baseline = DB_ALPHABETIC;
+            baseline = DominantBaseline::Alphabetic;
     }
 
     switch (baseline) {
-    case DB_USE_SCRIPT:
+    case DominantBaseline::UseScript:
         // FIXME: The dominant-baseline and the baseline-table components are set by determining the predominant script of the character data content.
-        return AB_ALPHABETIC;
-    case DB_NO_CHANGE:
+        return AlignmentBaseline::Alphabetic;
+    case DominantBaseline::NoChange:
         return dominantBaselineToAlignmentBaseline(isVerticalText, textRenderer->parent());
-    case DB_RESET_SIZE:
+    case DominantBaseline::ResetSize:
         return dominantBaselineToAlignmentBaseline(isVerticalText, textRenderer->parent());
-    case DB_IDEOGRAPHIC:
-        return AB_IDEOGRAPHIC;
-    case DB_ALPHABETIC:
-        return AB_ALPHABETIC;
-    case DB_HANGING:
-        return AB_HANGING;
-    case DB_MATHEMATICAL:
-        return AB_MATHEMATICAL;
-    case DB_CENTRAL:
-        return AB_CENTRAL;
-    case DB_MIDDLE:
-        return AB_MIDDLE;
-    case DB_TEXT_AFTER_EDGE:
-        return AB_TEXT_AFTER_EDGE;
-    case DB_TEXT_BEFORE_EDGE:
-        return AB_TEXT_BEFORE_EDGE;
+    case DominantBaseline::Ideographic:
+        return AlignmentBaseline::Ideographic;
+    case DominantBaseline::Alphabetic:
+        return AlignmentBaseline::Alphabetic;
+    case DominantBaseline::Hanging:
+        return AlignmentBaseline::Hanging;
+    case DominantBaseline::Mathematical:
+        return AlignmentBaseline::Mathematical;
+    case DominantBaseline::Central:
+        return AlignmentBaseline::Central;
+    case DominantBaseline::Middle:
+        return AlignmentBaseline::Middle;
+    case DominantBaseline::TextAfterEdge:
+        return AlignmentBaseline::TextAfterEdge;
+    case DominantBaseline::TextBeforeEdge:
+        return AlignmentBaseline::TextBeforeEdge;
     default:
         ASSERT_NOT_REACHED();
-        return AB_AUTO;
+        return AlignmentBaseline::Auto;
     }
 }
 
@@ -108,36 +108,37 @@ float SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift(bool isVertic
     const RenderObject* textRendererParent = textRenderer.parent();
     ASSERT(textRendererParent);
 
-    EAlignmentBaseline baseline = textRenderer.style().svgStyle().alignmentBaseline();
-    if (baseline == AB_AUTO) {
+    AlignmentBaseline baseline = textRenderer.style().svgStyle().alignmentBaseline();
+    if (baseline == AlignmentBaseline::Auto) {
         baseline = dominantBaselineToAlignmentBaseline(isVerticalText, textRendererParent);
-        ASSERT(baseline != AB_AUTO);
+        ASSERT(baseline != AlignmentBaseline::Auto);
     }
 
     const FontMetrics& fontMetrics = m_font.fontMetrics();
 
     // Note: http://wiki.apache.org/xmlgraphics-fop/LineLayout/AlignmentHandling
     switch (baseline) {
-    case AB_BASELINE:
-        return dominantBaselineToAlignmentBaseline(isVerticalText, textRendererParent);
-    case AB_BEFORE_EDGE:
-    case AB_TEXT_BEFORE_EDGE:
+    case AlignmentBaseline::Baseline:
+        // FIXME: This seems wrong. Why are we returning an enum value converted to a float?
+        return static_cast<float>(dominantBaselineToAlignmentBaseline(isVerticalText, textRendererParent));
+    case AlignmentBaseline::BeforeEdge:
+    case AlignmentBaseline::TextBeforeEdge:
         return fontMetrics.floatAscent();
-    case AB_MIDDLE:
+    case AlignmentBaseline::Middle:
         return fontMetrics.xHeight() / 2;
-    case AB_CENTRAL:
+    case AlignmentBaseline::Central:
         return (fontMetrics.floatAscent() - fontMetrics.floatDescent()) / 2;
-    case AB_AFTER_EDGE:
-    case AB_TEXT_AFTER_EDGE:
-    case AB_IDEOGRAPHIC:
+    case AlignmentBaseline::AfterEdge:
+    case AlignmentBaseline::TextAfterEdge:
+    case AlignmentBaseline::Ideographic:
         return fontMetrics.floatDescent();
-    case AB_ALPHABETIC:
+    case AlignmentBaseline::Alphabetic:
         return 0;
-    case AB_HANGING:
+    case AlignmentBaseline::Hanging:
         return fontMetrics.floatAscent() * 8 / 10.f;
-    case AB_MATHEMATICAL:
+    case AlignmentBaseline::Mathematical:
         return fontMetrics.floatAscent() / 2;
-    default:
+    case AlignmentBaseline::Auto:
         ASSERT_NOT_REACHED();
         return 0;
     }
@@ -146,7 +147,7 @@ float SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift(bool isVertic
 float SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle(bool isVerticalText, const SVGRenderStyle& style, const UChar& character) const
 {
     switch (isVerticalText ? style.glyphOrientationVertical() : style.glyphOrientationHorizontal()) {
-    case GO_AUTO:
+    case GlyphOrientation::Auto:
         // Spec: Fullwidth ideographic and fullwidth Latin text will be set with a glyph-orientation of 0-degrees.
         // Text which is not fullwidth will be set with a glyph-orientation of 90-degrees.
         // FIXME: There's not an accurate way to tell if text is fullwidth by looking at a single character.
@@ -165,13 +166,13 @@ float SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle(bool isVertica
         }
         ASSERT_NOT_REACHED();
         break;
-    case GO_90DEG:
+    case GlyphOrientation::Degrees90:
         return 90;
-    case GO_180DEG:
+    case GlyphOrientation::Degrees180:
         return 180;
-    case GO_270DEG:
+    case GlyphOrientation::Degrees270:
         return 270;
-    case GO_0DEG:
+    case GlyphOrientation::Degrees0:
         return 0;
     }
     ASSERT_NOT_REACHED();
index 44d7f73..6caf243 100644 (file)
@@ -42,7 +42,7 @@ public:
     float calculateGlyphAdvanceAndOrientation(bool isVerticalText, SVGTextMetrics&, float angle, float& xOrientationShift, float& yOrientationShift) const;
 
 private:
-    EAlignmentBaseline dominantBaselineToAlignmentBaseline(bool isVerticalText, const RenderObject* textRenderer) const;
+    AlignmentBaseline dominantBaselineToAlignmentBaseline(bool isVerticalText, const RenderObject* textRenderer) const;
 
     const FontCascade& m_font;
 };
index f6f8896..1c12d7c 100644 (file)
@@ -1,3 +1,16 @@
+2018-05-28  Sam Weinig  <sam@webkit.org>
+
+        Modernize SVGRenderStyleDefs.h
+        https://bugs.webkit.org/show_bug.cgi?id=186024
+
+        Reviewed by Daniel Bates.
+
+        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
+        (WebKit::applyPropertiesToLayer):
+        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
+        Update for new enum names.
+
 2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.3 release.
index ab1159c..dd87993 100644 (file)
@@ -214,10 +214,10 @@ static void applyPropertiesToLayer(CALayer *layer, RemoteLayerTreeHost* layerTre
         ASSERT([layer isKindOfClass:[CAShapeLayer class]]);
         CAShapeLayer *shapeLayer = (CAShapeLayer *)layer;
         switch (properties.windRule) {
-        case RULE_NONZERO:
+        case WindRule::NonZero:
             shapeLayer.fillRule = @"non-zero";
             break;
-        case RULE_EVENODD:
+        case WindRule::EvenOdd:
             shapeLayer.fillRule = @"even-odd";
             break;
         }
index caf72df..8c4f790 100644 (file)
@@ -94,7 +94,7 @@ RemoteLayerTreeTransaction::LayerProperties::LayerProperties()
     , minificationFilter(PlatformCALayer::FilterType::Linear)
     , magnificationFilter(PlatformCALayer::FilterType::Linear)
     , blendMode(BlendModeNormal)
-    , windRule(RULE_NONZERO)
+    , windRule(WindRule::NonZero)
     , hidden(false)
     , backingStoreAttached(true)
     , geometryFlipped(false)