WebKit Bugzilla
Attachment 341429 Details for
Bug 186024
: Modernize SVGRenderStyleDefs.h
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186024-20180527135134.patch (text/plain), 129.47 KB, created by
Sam Weinig
on 2018-05-27 13:51:35 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sam Weinig
Created:
2018-05-27 13:51:35 PDT
Size:
129.47 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 232228) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,229 @@ >+2018-05-27 Sam Weinig <sam@webkit.org> >+ >+ Modernize SVGRenderStyleDefs.h >+ https://bugs.webkit.org/show_bug.cgi?id=186024 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-26 Zalan Bujtas <zalan@apple.com> > > [LFC] Implement margin computation >Index: Source/WebCore/css/CSSBasicShapes.cpp >=================================================================== >--- Source/WebCore/css/CSSBasicShapes.cpp (revision 232189) >+++ Source/WebCore/css/CSSBasicShapes.cpp (working copy) >@@ -211,7 +211,7 @@ CSSBasicShapePath::CSSBasicShapePath(std > 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 W > > result.reserveCapacity(length); > >- if (windRule == RULE_EVENODD) >+ if (windRule == WindRule::EvenOdd) > result.appendLiteral(evenOddOpening); > else > result.appendLiteral(nonZeroOpening); >Index: Source/WebCore/css/CSSBasicShapes.h >=================================================================== >--- Source/WebCore/css/CSSBasicShapes.h (revision 232189) >+++ Source/WebCore/css/CSSBasicShapes.h (working copy) >@@ -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: Source/WebCore/css/CSSPrimitiveValueMappings.h >=================================================================== >--- Source/WebCore/css/CSSPrimitiveValueMappings.h (revision 232189) >+++ Source/WebCore/css/CSSPrimitiveValueMappings.h (working copy) >@@ -4117,10 +4117,10 @@ template<> inline CSSPrimitiveValue::CSS > { > 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; > } >@@ -4132,97 +4132,97 @@ template<> inline CSSPrimitiveValue::ope > > 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) >@@ -4509,270 +4509,270 @@ template<int supported> Length CSSPrimit > 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) >@@ -4789,66 +4789,66 @@ template<> inline CSSPrimitiveValue::CSS > 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: Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp >=================================================================== >--- Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp (revision 232189) >+++ Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp (working copy) >@@ -30,19 +30,19 @@ > > 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> strokeDashArrayT > > 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: > 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 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 CSSPropertyBufferedRendering: >- return CSSPrimitiveValue::create(svgStyle.bufferedRendering()); >- case CSSPropertyGlyphOrientationHorizontal: >- return glyphOrientationToCSSPrimitiveValue(svgStyle.glyphOrientationHorizontal()); >- case CSSPropertyGlyphOrientationVertical: { >- if (RefPtr<CSSPrimitiveValue> value = glyphOrientationToCSSPrimitiveValue(svgStyle.glyphOrientationVertical())) >- return value; >+ 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); >+ 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; >+ 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: Source/WebCore/css/StyleBuilderConverter.h >=================================================================== >--- Source/WebCore/css/StyleBuilderConverter.h (revision 232189) >+++ Source/WebCore/css/StyleBuilderConverter.h (working copy) >@@ -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&); > >@@ -1385,22 +1385,22 @@ inline StyleContentAlignmentData StyleBu > 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: Source/WebCore/css/StyleBuilderCustom.h >=================================================================== >--- Source/WebCore/css/StyleBuilderCustom.h (revision 232189) >+++ Source/WebCore/css/StyleBuilderCustom.h (working copy) >@@ -1032,19 +1032,19 @@ inline void StyleBuilderCustom::applyVal > 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::applyVal > 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::applyVal > 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: Source/WebCore/css/parser/CSSPropertyParser.cpp >=================================================================== >--- Source/WebCore/css/parser/CSSPropertyParser.cpp (revision 232189) >+++ Source/WebCore/css/parser/CSSPropertyParser.cpp (working copy) >@@ -2453,7 +2453,7 @@ static RefPtr<CSSBasicShapePolygon> cons > { > 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> cons > > 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: Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >=================================================================== >--- Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (revision 232189) >+++ Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (working copy) >@@ -1046,7 +1046,7 @@ bool CanvasRenderingContext2DBase::isFul > > 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: Source/WebCore/page/animation/CSSPropertyAnimation.cpp >=================================================================== >--- Source/WebCore/page/animation/CSSPropertyAnimation.cpp (revision 232189) >+++ Source/WebCore/page/animation/CSSPropertyAnimation.cpp (working copy) >@@ -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: Source/WebCore/platform/graphics/FloatPolygon.cpp >=================================================================== >--- Source/WebCore/platform/graphics/FloatPolygon.cpp (revision 232189) >+++ Source/WebCore/platform/graphics/FloatPolygon.cpp (working copy) >@@ -198,7 +198,7 @@ bool FloatPolygon::contains(const FloatP > { > 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: Source/WebCore/platform/graphics/GraphicsContext.cpp >=================================================================== >--- Source/WebCore/platform/graphics/GraphicsContext.cpp (revision 232189) >+++ Source/WebCore/platform/graphics/GraphicsContext.cpp (working copy) >@@ -907,7 +907,7 @@ void GraphicsContext::fillRectWithRounde > WindRule oldFillRule = fillRule(); > Color oldFillColor = fillColor(); > >- setFillRule(RULE_EVENODD); >+ setFillRule(WindRule::EvenOdd); > setFillColor(color); > > fillPath(path); >Index: Source/WebCore/platform/graphics/GraphicsContext.h >=================================================================== >--- Source/WebCore/platform/graphics/GraphicsContext.h (revision 232189) >+++ Source/WebCore/platform/graphics/GraphicsContext.h (working copy) >@@ -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: Source/WebCore/platform/graphics/GraphicsLayer.cpp >=================================================================== >--- Source/WebCore/platform/graphics/GraphicsLayer.cpp (revision 232189) >+++ Source/WebCore/platform/graphics/GraphicsLayer.cpp (working copy) >@@ -346,7 +346,7 @@ WindRule GraphicsLayer::shapeLayerWindRu > #if USE(CA) > return m_shapeLayerWindRule; > #else >- return RULE_NONZERO; >+ return WindRule::NonZero; > #endif > } > >Index: Source/WebCore/platform/graphics/GraphicsLayer.h >=================================================================== >--- Source/WebCore/platform/graphics/GraphicsLayer.h (revision 232189) >+++ Source/WebCore/platform/graphics/GraphicsLayer.h (working copy) >@@ -690,7 +690,7 @@ protected: > > #if USE(CA) > Path m_shapeLayerPath; >- WindRule m_shapeLayerWindRule { RULE_NONZERO }; >+ WindRule m_shapeLayerWindRule { WindRule::NonZero }; > #endif > }; > >Index: Source/WebCore/platform/graphics/GraphicsTypes.cpp >=================================================================== >--- Source/WebCore/platform/graphics/GraphicsTypes.cpp (revision 232189) >+++ Source/WebCore/platform/graphics/GraphicsTypes.cpp (working copy) >@@ -138,10 +138,10 @@ TextStream& operator<<(TextStream& ts, B > 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: Source/WebCore/platform/graphics/Path.h >=================================================================== >--- Source/WebCore/platform/graphics/Path.h (revision 232189) >+++ Source/WebCore/platform/graphics/Path.h (working copy) >@@ -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: Source/WebCore/platform/graphics/ShadowBlur.cpp >=================================================================== >--- Source/WebCore/platform/graphics/ShadowBlur.cpp (revision 232189) >+++ Source/WebCore/platform/graphics/ShadowBlur.cpp (working copy) >@@ -608,7 +608,7 @@ void ShadowBlur::drawInsetShadow(const A > 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::drawInsetShadowWithoutT > 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::drawInsetShadowWithTili > 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::drawInsetShadowWithTili > > { > GraphicsContextStateSaver fillStateSaver(graphicsContext); >- graphicsContext.setFillRule(RULE_EVENODD); >+ graphicsContext.setFillRule(WindRule::EvenOdd); > graphicsContext.setFillColor(m_color); > graphicsContext.clearShadow(); > graphicsContext.fillPath(exteriorPath); >Index: Source/WebCore/platform/graphics/WindRule.h >=================================================================== >--- Source/WebCore/platform/graphics/WindRule.h (revision 232189) >+++ Source/WebCore/platform/graphics/WindRule.h (working copy) >@@ -25,17 +25,13 @@ > * 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: Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm >=================================================================== >--- Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (revision 232189) >+++ Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (working copy) >@@ -941,9 +941,9 @@ WindRule PlatformCALayerCocoa::shapeWind > > 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::setShapeWindR > 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: Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >=================================================================== >--- Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (revision 232189) >+++ Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (working copy) >@@ -687,7 +687,7 @@ static inline bool calculateDrawingMode( > { > 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 Pat > 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 Pat > 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 Pat > 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::fillRectWithRounde > 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 Pat > CGContextBeginPath(platformContext()); > CGContextAddPath(platformContext(), path.platformPath()); > >- if (clipRule == RULE_EVENODD) >+ if (clipRule == WindRule::EvenOdd) > CGContextEOClip(context); > else > CGContextClip(context); >Index: Source/WebCore/platform/graphics/cg/PathCG.cpp >=================================================================== >--- Source/WebCore/platform/graphics/cg/PathCG.cpp (revision 232189) >+++ Source/WebCore/platform/graphics/cg/PathCG.cpp (working copy) >@@ -184,7 +184,7 @@ bool Path::contains(const FloatPoint &po > > // 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: Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp >=================================================================== >--- Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp (revision 232189) >+++ Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp (working copy) >@@ -245,7 +245,7 @@ void MockRealtimeVideoSource::drawAnimat > 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::drawAnimat > 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: Source/WebCore/rendering/FilterEffectRenderer.cpp >=================================================================== >--- Source/WebCore/rendering/FilterEffectRenderer.cpp (revision 232189) >+++ Source/WebCore/rendering/FilterEffectRenderer.cpp (working copy) >@@ -118,7 +118,7 @@ RefPtr<FilterEffect> FilterEffectRendere > > 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: Source/WebCore/rendering/RenderBoxModelObject.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBoxModelObject.cpp (revision 232189) >+++ Source/WebCore/rendering/RenderBoxModelObject.cpp (working copy) >@@ -1929,7 +1929,7 @@ void RenderBoxModelObject::paintBorder(c > 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(c > } > } > >- graphicsContext.setFillRule(RULE_NONZERO); >+ graphicsContext.setFillRule(WindRule::NonZero); > graphicsContext.setFillColor(edges[firstVisibleEdge].color()); > graphicsContext.fillPath(path); > return; >@@ -2205,7 +2205,7 @@ void RenderBoxModelObject::clipBorderSid > 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::clipBorderSid > }; > 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::clipBorderSid > }; > // 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: Source/WebCore/rendering/RenderElement.cpp >=================================================================== >--- Source/WebCore/rendering/RenderElement.cpp (revision 232189) >+++ Source/WebCore/rendering/RenderElement.cpp (working copy) >@@ -1890,7 +1890,7 @@ void RenderElement::paintOutline(PaintIn > Path path; > path.addRect(outer); > path.addRect(inner); >- graphicsContext.setFillRule(RULE_EVENODD); >+ graphicsContext.setFillRule(WindRule::EvenOdd); > graphicsContext.setFillColor(outlineColor); > graphicsContext.fillPath(path); > return; >Index: Source/WebCore/rendering/RenderLayer.cpp >=================================================================== >--- Source/WebCore/rendering/RenderLayer.cpp (revision 232189) >+++ Source/WebCore/rendering/RenderLayer.cpp (working copy) >@@ -4139,7 +4139,7 @@ Path RenderLayer::computeClipPath(const > FloatRoundedRect shapeRect = computeRoundedRectForBoxShape(clipPath.referenceBox(), downcast<RenderBox>(renderer())).pixelSnappedRoundedRectForPainting(deviceSaleFactor); > shapeRect.move(offsetFromRoot); > >- windRule = RULE_NONZERO; >+ windRule = WindRule::NonZero; > return clipPath.pathForReferenceRect(shapeRect); > } > >Index: Source/WebCore/rendering/style/BasicShapes.h >=================================================================== >--- Source/WebCore/rendering/style/BasicShapes.h (revision 232189) >+++ Source/WebCore/rendering/style/BasicShapes.h (working copy) >@@ -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: Source/WebCore/rendering/style/RenderStyle.h >=================================================================== >--- Source/WebCore/rendering/style/RenderStyle.h (revision 232189) >+++ Source/WebCore/rendering/style/RenderStyle.h (working copy) >@@ -1290,15 +1290,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: Source/WebCore/rendering/style/SVGRenderStyle.h >=================================================================== >--- Source/WebCore/rendering/style/SVGRenderStyle.h (revision 232189) >+++ Source/WebCore/rendering/style/SVGRenderStyle.h (working copy) >@@ -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::setMarkerEnd > > 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: Source/WebCore/rendering/style/SVGRenderStyleDefs.h >=================================================================== >--- Source/WebCore/rendering/style/SVGRenderStyleDefs.h (revision 232189) >+++ Source/WebCore/rendering/style/SVGRenderStyleDefs.h (working copy) >@@ -35,267 +35,302 @@ > #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: Source/WebCore/rendering/svg/RenderSVGImage.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGImage.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/RenderSVGImage.cpp (working copy) >@@ -155,7 +155,7 @@ void RenderSVGImage::paint(PaintInfo& pa > 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: Source/WebCore/rendering/svg/RenderSVGRect.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGRect.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/RenderSVGRect.cpp (working copy) >@@ -93,7 +93,7 @@ void RenderSVGRect::updateShapeFromEleme > > #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: Source/WebCore/rendering/svg/RenderSVGResource.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGResource.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/RenderSVGResource.cpp (working copy) >@@ -71,15 +71,15 @@ static inline RenderSVGResource* request > > 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* request > // 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* request > > // 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* request > // 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: Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp (working copy) >@@ -78,7 +78,7 @@ bool RenderSVGResourceClipper::pathOnlyC > // 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: Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp (working copy) >@@ -102,7 +102,7 @@ std::unique_ptr<SVGFilterBuilder> Render > 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: Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp (working copy) >@@ -177,7 +177,7 @@ bool RenderSVGResourceGradient::applyRes > 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: Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp (working copy) >@@ -69,7 +69,7 @@ bool RenderSVGResourceMasker::applyResou > > 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::drawConten > #endif > > // Create the luminance mask. >- if (style().svgStyle().maskType() == MT_LUMINANCE) >+ if (style().svgStyle().maskType() == MaskType::Luminance) > maskerData->maskImage->convertToLuminanceMask(); > > return true; >Index: Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp (working copy) >@@ -176,7 +176,7 @@ bool RenderSVGResourcePattern::applyReso > 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: Source/WebCore/rendering/svg/RenderSVGShape.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGShape.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/RenderSVGShape.cpp (working copy) >@@ -312,7 +312,7 @@ void RenderSVGShape::paint(PaintInfo& pa > > 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: Source/WebCore/rendering/svg/RenderSVGShape.h >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGShape.h (revision 232189) >+++ Source/WebCore/rendering/svg/RenderSVGShape.h (working copy) >@@ -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: Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp >=================================================================== >--- Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (working copy) >@@ -211,10 +211,10 @@ static void writeStyle(TextStream& ts, c > 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 > > // 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: Source/WebCore/rendering/svg/SVGResources.cpp >=================================================================== >--- Source/WebCore/rendering/svg/SVGResources.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/SVGResources.cpp (working copy) >@@ -170,7 +170,7 @@ static inline bool isChainableResource(c > > 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: Source/WebCore/rendering/svg/SVGTextChunk.cpp >=================================================================== >--- Source/WebCore/rendering/svg/SVGTextChunk.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/SVGTextChunk.cpp (working copy) >@@ -43,12 +43,12 @@ SVGTextChunk::SVGTextChunk(const Vector< > 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: Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp >=================================================================== >--- Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp (revision 232189) >+++ Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp (working copy) >@@ -35,7 +35,7 @@ SVGTextLayoutEngineBaseline::SVGTextLayo > > 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::calcu > } > > 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::calcu > 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::calcu > 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::calcu > } > 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: Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h >=================================================================== >--- Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h (revision 232189) >+++ Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h (working copy) >@@ -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; > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186024
:
341429
|
341438