WebKit Bugzilla
Attachment 371692 Details for
Bug 198695
: Make it possible to mark the value of an SVGProperty as 'Invalid'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198695-20190608184055.patch (text/plain), 323.53 KB, created by
Said Abou-Hallawa
on 2019-06-08 18:40:57 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2019-06-08 18:40:57 PDT
Size:
323.53 KB
patch
obsolete
>Subversion Revision: 246234 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0b9937c8bb59b35ff1fbb6aa2c9333f31d23f1d5..664533ec1c3273008422b3a6efa352b5a09140f5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,422 @@ >+2019-06-08 Said Abou-Hallawa <said@apple.com> >+ >+ Make it possible to mark the value of an SVGProperty as 'Invalid' >+ https://bugs.webkit.org/show_bug.cgi?id=198695 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ SVGProperty can be initialized with the default value. Or it can be set >+ to the default value as a fall back of parsing error. Marking the state >+ to 'Invalid' will allow differentiating between these two cases. >+ >+ * svg/SVGElement.cpp: >+ (WebCore::SVGElement::commitPropertyChange): >+ * svg/SVGFitToViewBox.cpp: >+ (WebCore::SVGFitToViewBox::SVGFitToViewBox): >+ (WebCore::SVGFitToViewBox::setViewBox): >+ (WebCore::SVGFitToViewBox::resetViewBox): >+ * svg/SVGFitToViewBox.h: >+ (WebCore::SVGFitToViewBox::setPreserveAspectRatio): >+ (WebCore::SVGFitToViewBox::hasValidViewBox const): >+ (WebCore::SVGFitToViewBox::hasEmptyViewBox const): >+ (WebCore::SVGFitToViewBox::resetPreserveAspectRatio): >+ * svg/SVGRect.h: >+ (WebCore::SVGRect::create): >+ * svg/properties/SVGAnimatedDecoratedProperty.h: >+ * svg/properties/SVGAnimatedPrimitiveProperty.h: >+ * svg/properties/SVGAnimatedProperty.h: >+ (WebCore::SVGAnimatedProperty::state const): >+ (WebCore::SVGAnimatedProperty::setState): >+ (WebCore::SVGAnimatedProperty::isDirty const): Deleted. >+ (WebCore::SVGAnimatedProperty::setDirty): Deleted. >+ * svg/properties/SVGAnimatedPropertyList.h: >+ * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: >+ * svg/properties/SVGAnimatedValueProperty.h: >+ (WebCore::SVGAnimatedValueProperty::SVGAnimatedValueProperty): >+ * svg/properties/SVGProperty.h: >+ (WebCore::SVGProperty::state const): >+ (WebCore::SVGProperty::setState): >+ (WebCore::SVGProperty::synchronize): >+ (WebCore::SVGProperty::SVGProperty): >+ (WebCore::SVGProperty::isDirty const): Deleted. >+ (WebCore::SVGProperty::setDirty): Deleted. >+ * svg/properties/SVGValueProperty.h: >+ (WebCore::SVGValueProperty::SVGValueProperty): >+ >+2019-06-08 Said Abou-Hallawa <said@apple.com> >+ >+ Remove the non final propertyRegistry() from the SVG base classes >+ https://bugs.webkit.org/show_bug.cgi?id=198122 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This saves the memory that is taken by the member SVGPropertyRegistry of >+ the base class. propertyRegistry() is only needed for concrete classes. >+ >+ * svg/SVGAElement.h: >+ * svg/SVGAltGlyphDefElement.h: >+ * svg/SVGAltGlyphElement.h: >+ * svg/SVGAltGlyphItemElement.h: >+ * svg/SVGAnimationElement.h: >+ * svg/SVGCircleElement.h: >+ * svg/SVGClipPathElement.h: >+ * svg/SVGComponentTransferFunctionElement.h: >+ * svg/SVGCursorElement.h: >+ * svg/SVGDefsElement.h: >+ * svg/SVGDescElement.h: >+ * svg/SVGElement.h: >+ (WebCore::SVGElement::propertyRegistry const): Deleted. >+ * svg/SVGEllipseElement.h: >+ * svg/SVGExternalResourcesRequired.h: >+ * svg/SVGFEBlendElement.h: >+ * svg/SVGFEColorMatrixElement.h: >+ * svg/SVGFEComponentTransferElement.h: >+ * svg/SVGFECompositeElement.h: >+ * svg/SVGFEConvolveMatrixElement.h: >+ * svg/SVGFEDiffuseLightingElement.h: >+ * svg/SVGFEDisplacementMapElement.h: >+ * svg/SVGFEDropShadowElement.h: >+ * svg/SVGFEFloodElement.h: >+ * svg/SVGFEGaussianBlurElement.h: >+ * svg/SVGFEImageElement.h: >+ * svg/SVGFELightElement.h: >+ * svg/SVGFEMergeElement.h: >+ * svg/SVGFEMergeNodeElement.h: >+ * svg/SVGFEMorphologyElement.h: >+ * svg/SVGFEOffsetElement.h: >+ * svg/SVGFESpecularLightingElement.h: >+ * svg/SVGFETileElement.h: >+ * svg/SVGFETurbulenceElement.h: >+ * svg/SVGFilterElement.h: >+ * svg/SVGFontFaceElement.h: >+ * svg/SVGFontFaceFormatElement.h: >+ * svg/SVGFontFaceNameElement.h: >+ * svg/SVGFontFaceSrcElement.h: >+ * svg/SVGFontFaceUriElement.h: >+ * svg/SVGForeignObjectElement.h: >+ * svg/SVGGElement.h: >+ * svg/SVGGeometryElement.h: >+ * svg/SVGGlyphElement.h: >+ * svg/SVGGradientElement.h: >+ * svg/SVGGraphicsElement.h: >+ * svg/SVGHKernElement.h: >+ * svg/SVGImageElement.h: >+ * svg/SVGLineElement.h: >+ * svg/SVGLinearGradientElement.h: >+ * svg/SVGMPathElement.h: >+ * svg/SVGMarkerElement.h: >+ * svg/SVGMaskElement.h: >+ * svg/SVGMetadataElement.h: >+ * svg/SVGMissingGlyphElement.h: >+ * svg/SVGPathElement.cpp: >+ (WebCore::SVGPathElement::getTotalLength const): >+ (WebCore::SVGPathElement::getPointAtLength const): >+ (WebCore::SVGPathElement::getPathSegAtLength const): >+ * svg/SVGPathElement.h: >+ * svg/SVGPathUtilities.cpp: >+ (WebCore::pathSegAtLengthFromSVGPathByteStream): >+ (WebCore::totalLengthOfSVGPathByteStream): >+ (WebCore::pointAtLengthOfSVGPathByteStream): >+ (WebCore::getSVGPathSegAtLengthFromSVGPathByteStream): Deleted. >+ (WebCore::getTotalLengthOfSVGPathByteStream): Deleted. >+ (WebCore::getPointAtLengthOfSVGPathByteStream): Deleted. >+ * svg/SVGPathUtilities.h: >+ * svg/SVGPatternElement.h: >+ * svg/SVGPolyElement.h: >+ * svg/SVGRadialGradientElement.h: >+ * svg/SVGRectElement.h: >+ * svg/SVGSVGElement.h: >+ * svg/SVGScriptElement.h: >+ * svg/SVGStopElement.h: >+ * svg/SVGStyleElement.h: >+ * svg/SVGSwitchElement.h: >+ * svg/SVGSymbolElement.h: >+ * svg/SVGTRefElement.h: >+ * svg/SVGTSpanElement.h: >+ * svg/SVGTextContentElement.h: >+ * svg/SVGTextElement.h: >+ * svg/SVGTextPathElement.h: >+ * svg/SVGTextPositioningElement.h: >+ * svg/SVGTitleElement.h: >+ * svg/SVGUnknownElement.h: >+ * svg/SVGUseElement.h: >+ * svg/SVGVKernElement.h: >+ * svg/SVGViewElement.h: >+ >+2019-06-08 Said Abou-Hallawa <said@apple.com> >+ >+ SVGPropertyTraits and SVG enum types clean up >+ https://bugs.webkit.org/show_bug.cgi?id=198073 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In this patch: >+ >+ -- All SVGPropertyTraits will have two functions for parsing a string to >+ the property type. >+ 1) parse() will return Expected<PropertyType, SVGParsingError>. >+ 2) fromString() will call parse() but will return the default value >+ if parse() returns an error. >+ >+ -- All the SVG enum types are moved to a single file named SVGEnumType.h. >+ A new SVGPropertyTraits is defined for all enum types including the >+ non-SVG enum types, e.g. BlendMode. >+ >+ -- All SVGPropertyTraits for the enum types are removed. Parsing a string >+ to an enum value will be done by SVGEnumValueParser::parse(). Getting >+ a string from an enum value is done by SVGEnumValueComposer::toString(). >+ Each enum type needs to template specialize SVGEnumTraits::values() >+ which associates every emum value with a string. >+ >+ * WebCore.xcodeproj/project.pbxproj: >+ * css/CSSPrimitiveValueMappings.h: >+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): >+ * platform/graphics/GraphicsTypes.h: >+ * platform/graphics/cg/GraphicsContextCG.cpp: >+ (WebCore::selectCGBlendMode): >+ * svg/SVGAngleValue.h: >+ (WebCore::SVGPropertyTraits<SVGAngleValue>::initialValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGAngleValue>::toString): Deleted. >+ * svg/SVGComponentTransferFunctionElement.h: >+ (WebCore::SVGPropertyTraits<ComponentTransferType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<ComponentTransferType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<ComponentTransferType>::fromString): Deleted. >+ * svg/SVGFEBlendElement.h: >+ (WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<BlendMode>::fromString): Deleted. >+ (WebCore::SVGPropertyTraits<BlendMode>::toString): Deleted. >+ * svg/SVGFEColorMatrixElement.h: >+ (WebCore::SVGPropertyTraits<ColorMatrixType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<ColorMatrixType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<ColorMatrixType>::fromString): Deleted. >+ * svg/SVGFECompositeElement.h: >+ (WebCore::SVGIDLEnumLimits<CompositeOperationType>::highestExposedEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<CompositeOperationType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<CompositeOperationType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<CompositeOperationType>::fromString): Deleted. >+ * svg/SVGFEConvolveMatrixElement.h: >+ (WebCore::SVGPropertyTraits<EdgeModeType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<EdgeModeType>::initialValue): Deleted. >+ (WebCore::SVGPropertyTraits<EdgeModeType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<EdgeModeType>::fromString): Deleted. >+ * svg/SVGFEDisplacementMapElement.h: >+ (WebCore::SVGPropertyTraits<ChannelSelectorType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<ChannelSelectorType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<ChannelSelectorType>::fromString): Deleted. >+ * svg/SVGFEMorphologyElement.h: >+ (WebCore::SVGPropertyTraits<MorphologyOperatorType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<MorphologyOperatorType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<MorphologyOperatorType>::fromString): Deleted. >+ * svg/SVGFETurbulenceElement.cpp: >+ (WebCore::SVGFETurbulenceElement::build): >+ * svg/SVGFETurbulenceElement.h: >+ (WebCore::SVGPropertyTraits<SVGStitchOptions>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGStitchOptions>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGStitchOptions>::fromString): Deleted. >+ (WebCore::SVGPropertyTraits<TurbulenceType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<TurbulenceType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<TurbulenceType>::fromString): Deleted. >+ * svg/SVGGradientElement.h: >+ (WebCore::SVGPropertyTraits<SVGSpreadMethodType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGSpreadMethodType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGSpreadMethodType>::fromString): Deleted. >+ * svg/SVGLengthValue.h: >+ (WebCore::SVGPropertyTraits<SVGLengthValue>::initialValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGLengthValue>::parse): Deleted. >+ (WebCore::SVGPropertyTraits<SVGLengthValue>::toString): Deleted. >+ * svg/SVGMarkerTypes.h: >+ (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::fromString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoStartReverseString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::toString): Deleted. >+ (WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue): Deleted. >+ * svg/SVGParsingError.h: >+ (WebCore::SVGNumericParsingValidator::validate): >+ (WebCore::validateNumeric): >+ * svg/SVGPreserveAspectRatioValue.h: >+ (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::initialValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::parse): Deleted. >+ (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString): Deleted. >+ * svg/SVGTextContentElement.h: >+ (WebCore::SVGPropertyTraits<SVGLengthAdjustType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGLengthAdjustType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGLengthAdjustType>::fromString): Deleted. >+ * svg/SVGTextPathElement.h: >+ (WebCore::SVGPropertyTraits<SVGTextPathMethodType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGTextPathMethodType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGTextPathMethodType>::fromString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::fromString): Deleted. >+ * svg/SVGUnitTypes.h: >+ (WebCore::SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::highestEnumValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::toString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString): Deleted. >+ * svg/SVGZoomAndPan.h: >+ (WebCore::SVGZoomAndPan::reset): >+ * svg/SVGZoomAndPanType.h: Deleted. >+ * svg/properties/SVGDecoratedPrimitive.h: >+ * svg/properties/SVGEnumTraits.h: Added. >+ (WebCore::SVGEnumValueChecker::isValidEnum): >+ (WebCore::SVGEnumValueParser::parse): >+ (WebCore::SVGEnumValueComposer::toString): >+ * svg/properties/SVGEnumType.h: Added. >+ * svg/properties/SVGEnumTypeTraits.h: Added. >+ (WebCore::SVGEnumTraits<BlendMode>::values): >+ (WebCore::SVGEnumTraits<BlendMode>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<ChannelSelectorType>::values): >+ (WebCore::SVGEnumTraits<ChannelSelectorType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<ComponentTransferType>::values): >+ (WebCore::SVGEnumTraits<ComponentTransferType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<ColorMatrixType>::values): >+ (WebCore::SVGEnumTraits<ColorMatrixType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<CompositeOperationType>::values): >+ (WebCore::SVGEnumTraits<CompositeOperationType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<EdgeModeType>::values): >+ (WebCore::SVGEnumTraits<EdgeModeType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<MorphologyOperatorType>::values): >+ (WebCore::SVGEnumTraits<MorphologyOperatorType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<TurbulenceType>::values): >+ (WebCore::SVGEnumTraits<TurbulenceType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<SVGLengthAdjustType>::values): >+ (WebCore::SVGEnumTraits<SVGLengthAdjustType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<SVGMarkerUnitsType>::values): >+ (WebCore::SVGEnumTraits<SVGMarkerUnitsType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<SVGMarkerOrientType>::values): >+ (WebCore::SVGEnumTraits<SVGMarkerOrientType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<SVGSpreadMethodType>::values): >+ (WebCore::SVGEnumTraits<SVGSpreadMethodType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<SVGStitchOptions>::values): >+ (WebCore::SVGEnumTraits<SVGStitchOptions>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<SVGTextPathMethodType>::values): >+ (WebCore::SVGEnumTraits<SVGTextPathMethodType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<SVGTextPathSpacingType>::values): >+ (WebCore::SVGEnumTraits<SVGTextPathSpacingType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<SVGUnitTypes::SVGUnitType>::values): >+ (WebCore::SVGEnumTraits<SVGUnitTypes::SVGUnitType>::highestExposedEnumValue): >+ (WebCore::SVGEnumTraits<SVGZoomAndPanType>::values): >+ (WebCore::SVGEnumTraits<SVGZoomAndPanType>::highestExposedEnumValue): >+ * svg/properties/SVGPropertyTraits.h: >+ (WebCore::SVGPropertyTraits<bool>::parse): >+ (WebCore::SVGPropertyTraits<bool>::fromString): >+ (WebCore::SVGPropertyTraits<bool>::toString): >+ (WebCore::SVGPropertyTraits<Color>::parse): >+ (WebCore::SVGPropertyTraits<Color>::fromString): >+ (WebCore::SVGPropertyTraits<Color>::toString): >+ (WebCore::SVGPropertyTraits<String>::initialValue): >+ (WebCore::SVGPropertyTraits<String>::parse): >+ (WebCore::SVGPropertyTraits<String>::fromString): >+ (WebCore::SVGPropertyTraits<String>::toString): >+ (WebCore::SVGPropertyTraits<float>::parse): >+ (WebCore::SVGPropertyTraits<float>::fromString): >+ (WebCore::SVGPropertyTraits<float>::toString): >+ (WebCore::SVGPropertyTraits<int>::initialValue): >+ (WebCore::SVGPropertyTraits<int>::parse): >+ (WebCore::SVGPropertyTraits<int>::fromString): >+ (WebCore::SVGPropertyTraits<int>::toString): >+ (WebCore::SVGPropertyTraits<FloatPoint>::parse): >+ (WebCore::SVGPropertyTraits<FloatPoint>::fromString): >+ (WebCore::SVGPropertyTraits<FloatPoint>::toString): >+ (WebCore::SVGPropertyTraits<FloatRect>::parse): >+ (WebCore::SVGPropertyTraits<FloatRect>::fromString): >+ (WebCore::SVGPropertyTraits<FloatRect>::toString): >+ (WebCore::SVGPropertyTraits<unsigned>::initialValue): Deleted. >+ (WebCore::SVGPropertyTraits<unsigned>::parse): Deleted. >+ (WebCore::SVGPropertyTraits<unsigned>::toString): Deleted. >+ (WebCore::SVGIDLEnumLimits::highestExposedEnumValue): Deleted. >+ >+2019-05-20 Said Abou-Hallawa <said@apple.com> >+ >+ Unify the parsing of SVGList super classes >+ https://bugs.webkit.org/show_bug.cgi?id=197831 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Parsing the SVG lists is just ad-hoc. There is no single rule for: >+ >+ -- The leading spaces: SVGLengthList SVGNumberList treated them as an error >+ while SVGTransformList and SVGPointList were just skipping them. >+ -- Status of the list in case of an error: SVGTransformList was clearing >+ the list if an error was detected. The other lists were leaving whatever >+ is parsed before the error happened but return an error. >+ -- Reporting an error message in the console: SVGPointList was reporting >+ an error message if a parsing error happened. The other type of lists >+ were just silent when an error happens. >+ -- Delimiters: SVGNumberList assume the white spaces are the only allowed >+ delimiter. All other lists allow the comma also as a delimiter. >+ -- Extra text at the end: SVGTransformList was not reporting an error if >+ there is extra text at the end. Other list were returning false. >+ >+ In addition to that, the parsing code was repeated in every SVGList >+ super class. Instead parsing the list should be in SVGValuePropertyList >+ and SVGPrimitiveList. And parsing the item should be moved to the value >+ property class or the SVGPropertyTraits of the primitive. >+ >+ SVGViewSpec parsing is cleaned up in the patch as well. Parsing of this >+ class is needed to create the view for a fragment. >+ >+ * svg/SVGElement.cpp: >+ (WebCore::SVGElement::reportAttributeParsingError): >+ * svg/SVGFitToViewBox.cpp: >+ (WebCore::SVGFitToViewBox::parseAttribute): >+ (WebCore::SVGFitToViewBox::parseViewBox): >+ * svg/SVGFitToViewBox.h: >+ * svg/SVGLength.h: >+ (WebCore::SVGLength::create): >+ * svg/SVGLengthList.h: >+ (WebCore::SVGLengthList::parse): >+ * svg/SVGNumber.h: >+ (WebCore::SVGNumber::create): >+ * svg/SVGNumberList.h: >+ (WebCore::SVGNumberList::create): >+ (WebCore::SVGNumberList::parse): Deleted. >+ (): Deleted. >+ * svg/SVGParsingError.h: >+ * svg/SVGPoint.h: >+ (WebCore::SVGPoint::create): >+ * svg/SVGPointList.h: >+ (WebCore::SVGPointList::create): >+ (WebCore::SVGPointList::parse): Deleted. >+ (): Deleted. >+ * svg/SVGPolyElement.cpp: >+ (WebCore::SVGPolyElement::parseAttribute): >+ * svg/SVGPreserveAspectRatioValue.cpp: >+ (WebCore::SVGPreserveAspectRatioValue::parse): >+ * svg/SVGPreserveAspectRatioValue.h: >+ * svg/SVGSVGElement.cpp: >+ (WebCore::SVGSVGElement::parseAttribute): >+ (WebCore::SVGSVGElement::scrollToFragment): >+ * svg/SVGStringList.h: >+ * svg/SVGTests.cpp: >+ (WebCore::SVGTests::parseAttribute): >+ * svg/SVGTransform.h: >+ (WebCore::SVGTransform::create): >+ * svg/SVGTransformList.h: >+ * svg/SVGViewElement.cpp: >+ (WebCore::SVGViewElement::parseAttribute): >+ * svg/SVGViewSpec.cpp: >+ (WebCore::parseNamesValues): >+ (WebCore::SVGViewSpec::parseAttribute): >+ (WebCore::SVGViewSpec::parseViewSpec): >+ * svg/SVGViewSpec.h: >+ * svg/SVGZoomAndPan.cpp: >+ (WebCore::SVGZoomAndPan::parseAttribute): >+ (WebCore::SVGZoomAndPan::parseZoomAndPan): Deleted. >+ * svg/SVGZoomAndPan.h: >+ * svg/SVGZoomAndPanType.h: >+ (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::parse): >+ (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::fromString): >+ (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::toString): Deleted. >+ * svg/properties/SVGPrimitiveList.h: >+ (WebCore::SVGPrimitiveList::parse): >+ * svg/properties/SVGValuePropertyList.h: >+ (WebCore::SVGValuePropertyList::parse): >+ > 2019-06-08 Zalan Bujtas <zalan@apple.com> > > [LFC][IFC] Introduce Baseline to LineBox >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 7b69a86dc7928a7fc65c178f507aebbd862b11a7..e734eed95d0e24a3f83b42976892bcbd31438070 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1743,7 +1743,6 @@ > 55DCC52822407B2000C26E32 /* SVGPrimitiveList.h in Headers */ = {isa = PBXBuildFile; fileRef = 55DCC5252240749E00C26E32 /* SVGPrimitiveList.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 55DCC52922407B2A00C26E32 /* SVGList.h in Headers */ = {isa = PBXBuildFile; fileRef = 55DCC523224073FE00C26E32 /* SVGList.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 55EC9599206AA7A0007DD0A9 /* PaintFrequencyTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 55FA7FFB2110ECD7005AEFE7 /* SVGZoomAndPanType.h in Headers */ = {isa = PBXBuildFile; fileRef = 55FA7FFA2110ECD7005AEFE7 /* SVGZoomAndPanType.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 5704405A1E53936200356601 /* JSAesCbcCfbParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 570440591E53936200356601 /* JSAesCbcCfbParams.h */; }; > 5706A6961DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5706A6951DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h */; }; > 5706A6981DDE5E4600A03B14 /* JSRsaOaepParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5706A6971DDE5E4600A03B14 /* JSRsaOaepParams.h */; }; >@@ -8562,7 +8561,6 @@ > 55EE5362223B2A2300FBA944 /* SVGAnimatedProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedProperty.h; sourceTree = "<group>"; }; > 55EE5363223B2A2400FBA944 /* SVGProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGProperty.h; sourceTree = "<group>"; }; > 55EE5364223B2A2400FBA944 /* SVGAttributeAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAttributeAnimator.h; sourceTree = "<group>"; }; >- 55FA7FFA2110ECD7005AEFE7 /* SVGZoomAndPanType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGZoomAndPanType.h; sourceTree = "<group>"; }; > 570440571E53851600356601 /* CryptoAlgorithmAES_CFBMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmAES_CFBMac.cpp; sourceTree = "<group>"; }; > 570440591E53936200356601 /* JSAesCbcCfbParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAesCbcCfbParams.h; sourceTree = "<group>"; }; > 5704405B1E53937900356601 /* JSAesCbcCfbParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAesCbcCfbParams.cpp; sourceTree = "<group>"; }; >@@ -9406,6 +9404,9 @@ > 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTBlendMinMax.h; sourceTree = "<group>"; }; > 724EE54E1DC7F25B00A91FFB /* ActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivityState.h; sourceTree = "<group>"; }; > 724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivityStateChangeObserver.h; sourceTree = "<group>"; }; >+ 72654AA3228C6B3B00BEB103 /* SVGEnumTraits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGEnumTraits.h; sourceTree = "<group>"; }; >+ 72654AA7228EFDC400BEB103 /* SVGEnumType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGEnumType.h; sourceTree = "<group>"; }; >+ 72654AA8228F383600BEB103 /* SVGEnumTypeTraits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGEnumTypeTraits.h; sourceTree = "<group>"; }; > 7266F0132241BCE200833975 /* SVGPropertyAnimatorFactory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPropertyAnimatorFactory.h; sourceTree = "<group>"; }; > 7266F0142241BFB200833975 /* SVGPrimitivePropertyAnimatorImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPrimitivePropertyAnimatorImpl.h; sourceTree = "<group>"; }; > 7266F0152241C09800833975 /* SVGPrimitivePropertyAnimator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPrimitivePropertyAnimator.h; sourceTree = "<group>"; }; >@@ -16069,6 +16070,9 @@ > 5553592122441B97008F5EC9 /* SVGDecoratedEnumeration.h */, > 5553592222441BE9008F5EC9 /* SVGDecoratedPrimitive.h */, > 5553592322441C18008F5EC9 /* SVGDecoratedProperty.h */, >+ 72654AA3228C6B3B00BEB103 /* SVGEnumTraits.h */, >+ 72654AA7228EFDC400BEB103 /* SVGEnumType.h */, >+ 72654AA8228F383600BEB103 /* SVGEnumTypeTraits.h */, > 55DCC523224073FE00C26E32 /* SVGList.h */, > 55EE5354223B29E900FBA944 /* SVGMemberAccessor.h */, > 55BE025A223B29C20032F08A /* SVGPointerMemberAccessor.h */, >@@ -24236,7 +24240,6 @@ > B222795F0D00BF210071B782 /* SVGZoomAndPan.cpp */, > B22279600D00BF210071B782 /* SVGZoomAndPan.h */, > B22279610D00BF210071B782 /* SVGZoomAndPan.idl */, >- 55FA7FFA2110ECD7005AEFE7 /* SVGZoomAndPanType.h */, > B2E4EC940D00C22B00432643 /* SVGZoomEvent.cpp */, > B2E4EC950D00C22B00432643 /* SVGZoomEvent.h */, > B2E4EC960D00C22B00432643 /* SVGZoomEvent.idl */, >@@ -31786,7 +31789,6 @@ > B2227AF30D00BF220071B782 /* SVGViewSpec.h in Headers */, > 8485228B1190173C006EDC7F /* SVGVKernElement.h in Headers */, > B2227AF60D00BF220071B782 /* SVGZoomAndPan.h in Headers */, >- 55FA7FFB2110ECD7005AEFE7 /* SVGZoomAndPanType.h in Headers */, > B2E4EC980D00C22B00432643 /* SVGZoomEvent.h in Headers */, > 46ECB6381FD0A3C80088E5AD /* SWClientConnection.h in Headers */, > 46658DC91FA24B8700F7DD54 /* SWContextManager.h in Headers */, >diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h >index 9d120ca5e823c5a2c2092259d0a80da093b6d353..8ff4ff03e7ce624e5c12c24f4902da1ad0cf9da4 100644 >--- a/Source/WebCore/css/CSSPrimitiveValueMappings.h >+++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h >@@ -3923,6 +3923,9 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(BlendMode blendMode) > { > m_primitiveUnitType = CSS_VALUE_ID; > switch (blendMode) { >+ case BlendMode::Unknown: >+ ASSERT_NOT_REACHED(); >+ break; > case BlendMode::Normal: > m_value.valueID = CSSValueNormal; > break; >diff --git a/Source/WebCore/platform/graphics/GraphicsTypes.h b/Source/WebCore/platform/graphics/GraphicsTypes.h >index 6e1afee198ca438ed25e4715f79d652a7fb1d220..e94223cef646056b3ef6e099018d27ab89505dce 100644 >--- a/Source/WebCore/platform/graphics/GraphicsTypes.h >+++ b/Source/WebCore/platform/graphics/GraphicsTypes.h >@@ -52,6 +52,7 @@ enum CompositeOperator { > }; > > enum class BlendMode { >+ Unknown = 0, > Normal = 1, // Start with 1 to match SVG's blendmode enumeration. > Multiply, > Screen, >diff --git a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >index 8adf8014df59621fa049a84772ad4b8425f67881..c726f9dba2e45266d7cee2523e9d8e5047bcb8cd 100644 >--- a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >+++ b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >@@ -154,6 +154,9 @@ static InterpolationQuality convertInterpolationQuality(CGInterpolationQuality q > static CGBlendMode selectCGBlendMode(CompositeOperator compositeOperator, BlendMode blendMode) > { > switch (blendMode) { >+ case BlendMode::Unknown: >+ ASSERT_NOT_REACHED(); >+ return kCGBlendModeNormal; > case BlendMode::Normal: > switch (compositeOperator) { > case CompositeClear: >diff --git a/Source/WebCore/svg/SVGAElement.h b/Source/WebCore/svg/SVGAElement.h >index 7e1d2946704e6755be34e40e798474fb14c701c6..6d1ef45ec17b52df32a38481e0e1e542f2d11012 100644 >--- a/Source/WebCore/svg/SVGAElement.h >+++ b/Source/WebCore/svg/SVGAElement.h >@@ -31,6 +31,8 @@ namespace WebCore { > > class SVGAElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired, public SVGURIReference { > WTF_MAKE_ISO_ALLOCATED(SVGAElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; >+ > public: > static Ref<SVGAElement> create(const QualifiedName&, Document&); > >@@ -42,9 +44,7 @@ public: > private: > SVGAElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -66,8 +66,6 @@ private: > > PropertyRegistry m_propertyRegistry { *this }; > Ref<SVGAnimatedString> m_target { SVGAnimatedString::create(this) }; >- >- // This is computed only once and must not be affected by subsequent URL changes. > mutable Optional<SharedStringHash> m_storedVisitedLinkHash; > }; > >diff --git a/Source/WebCore/svg/SVGAltGlyphDefElement.h b/Source/WebCore/svg/SVGAltGlyphDefElement.h >index 47174fbb02b6d7b22a4bd467be57ab55f9523928..e3d579267b112092f2520ba7f1b72524e34d3d7f 100644 >--- a/Source/WebCore/svg/SVGAltGlyphDefElement.h >+++ b/Source/WebCore/svg/SVGAltGlyphDefElement.h >@@ -28,6 +28,8 @@ namespace WebCore { > > class SVGAltGlyphDefElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGAltGlyphDefElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAltGlyphDefElement, SVGElement>; >+ > public: > static Ref<SVGAltGlyphDefElement> create(const QualifiedName&, Document&); > >@@ -36,7 +38,10 @@ public: > private: > SVGAltGlyphDefElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAltGlyphElement.h b/Source/WebCore/svg/SVGAltGlyphElement.h >index 5d902f6756c39c7a2cfe7830fc448251907e07e0..9459da4681c36b068b05ecaee46bba3735981a4a 100644 >--- a/Source/WebCore/svg/SVGAltGlyphElement.h >+++ b/Source/WebCore/svg/SVGAltGlyphElement.h >@@ -32,6 +32,8 @@ class SVGGlyphElement; > > class SVGAltGlyphElement final : public SVGTextPositioningElement, public SVGURIReference { > WTF_MAKE_ISO_ALLOCATED(SVGAltGlyphElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAltGlyphElement, SVGTextPositioningElement, SVGURIReference>; >+ > public: > static Ref<SVGAltGlyphElement> create(const QualifiedName&, Document&); > >@@ -45,11 +47,9 @@ public: > private: > SVGAltGlyphElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAltGlyphElement, SVGTextPositioningElement, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- >- RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; >- bool childShouldCreateRenderer(const Node&) const override; >+ RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; >+ bool childShouldCreateRenderer(const Node&) const final; > > PropertyRegistry m_propertyRegistry { *this }; > }; >diff --git a/Source/WebCore/svg/SVGAltGlyphItemElement.h b/Source/WebCore/svg/SVGAltGlyphItemElement.h >index 606b7833484763f6c13529059f487596f6dff833..65fc04eec7d62f0455e7c4fcd12aebed7f82cef6 100644 >--- a/Source/WebCore/svg/SVGAltGlyphItemElement.h >+++ b/Source/WebCore/svg/SVGAltGlyphItemElement.h >@@ -28,6 +28,8 @@ namespace WebCore { > > class SVGAltGlyphItemElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGAltGlyphItemElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAltGlyphItemElement, SVGElement>; >+ > public: > static Ref<SVGAltGlyphItemElement> create(const QualifiedName&, Document&); > >@@ -36,7 +38,10 @@ public: > private: > SVGAltGlyphItemElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAngleValue.h b/Source/WebCore/svg/SVGAngleValue.h >index 4d402f7fcd45a1fc7e7947d961de9ea5914be461..cc4544183cf0df90fb7eb92a93aa3df1eb31528b 100644 >--- a/Source/WebCore/svg/SVGAngleValue.h >+++ b/Source/WebCore/svg/SVGAngleValue.h >@@ -56,10 +56,4 @@ private: > float m_valueInSpecifiedUnits { 0 }; > }; > >-template<> >-struct SVGPropertyTraits<SVGAngleValue> { >- static SVGAngleValue initialValue() { return SVGAngleValue(); } >- static String toString(const SVGAngleValue& type) { return type.valueAsString(); } >-}; >- > } >diff --git a/Source/WebCore/svg/SVGAnimationElement.h b/Source/WebCore/svg/SVGAnimationElement.h >index 54e9128129c792cf811e3d605756390f080afe35..620d91996ae8dc1057ce4720dabfd40d419944d8 100644 >--- a/Source/WebCore/svg/SVGAnimationElement.h >+++ b/Source/WebCore/svg/SVGAnimationElement.h >@@ -40,6 +40,8 @@ enum AnimatedPropertyValueType { RegularPropertyValue, CurrentColorValue, Inheri > > class SVGAnimationElement : public SVGSMILElement, public SVGExternalResourcesRequired, public SVGTests { > WTF_MAKE_ISO_ALLOCATED(SVGAnimationElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAnimationElement, SVGElement, SVGExternalResourcesRequired, SVGTests>; >+ > public: > float getStartTime() const; > float getCurrentTime() const; >@@ -86,9 +88,6 @@ public: > protected: > SVGAnimationElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAnimationElement, SVGElement, SVGExternalResourcesRequired, SVGTests>; >- const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } >- > virtual void resetAnimation(); > > static bool isSupportedAttribute(const QualifiedName&); >@@ -115,6 +114,7 @@ protected: > void setCalcMode(CalcMode calcMode) { m_calcMode = calcMode; } > > private: >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > void animationAttributeChanged() override; > void setAttributeType(const AtomicString&); > >diff --git a/Source/WebCore/svg/SVGCircleElement.h b/Source/WebCore/svg/SVGCircleElement.h >index 5f90c70fa9d6bb02edb75470619c4f93248bf00c..f82726092fe5a4315dc841e7daced6c8cc41521f 100644 >--- a/Source/WebCore/svg/SVGCircleElement.h >+++ b/Source/WebCore/svg/SVGCircleElement.h >@@ -29,6 +29,8 @@ namespace WebCore { > > class SVGCircleElement final : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGCircleElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGCircleElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ > public: > static Ref<SVGCircleElement> create(const QualifiedName&, Document&); > >@@ -43,9 +45,7 @@ public: > private: > SVGCircleElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGCircleElement, SVGGeometryElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGClipPathElement.h b/Source/WebCore/svg/SVGClipPathElement.h >index 3ef0368cc94f44adf4d04f7a3ac28dd3cbbbe396..8890a30248f7fdf1be39e1184d4ba691eb26bbee 100644 >--- a/Source/WebCore/svg/SVGClipPathElement.h >+++ b/Source/WebCore/svg/SVGClipPathElement.h >@@ -31,6 +31,8 @@ class RenderObject; > > class SVGClipPathElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGClipPathElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGClipPathElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ > public: > static Ref<SVGClipPathElement> create(const QualifiedName&, Document&); > >@@ -40,9 +42,7 @@ public: > private: > SVGClipPathElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGClipPathElement, SVGGraphicsElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > void childrenChanged(const ChildChange&) final; >diff --git a/Source/WebCore/svg/SVGComponentTransferFunctionElement.h b/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >index a3388f82e28219446f2f231e6b0e753abfdf5131..560c52da41c2df42f78548fd716662b211d316fb 100644 >--- a/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >+++ b/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >@@ -26,49 +26,10 @@ > > namespace WebCore { > >-template<> >-struct SVGPropertyTraits<ComponentTransferType> { >- static unsigned highestEnumValue() { return FECOMPONENTTRANSFER_TYPE_GAMMA; } >- >- static String toString(ComponentTransferType type) >- { >- switch (type) { >- case FECOMPONENTTRANSFER_TYPE_UNKNOWN: >- return emptyString(); >- case FECOMPONENTTRANSFER_TYPE_IDENTITY: >- return "identity"_s; >- case FECOMPONENTTRANSFER_TYPE_TABLE: >- return "table"_s; >- case FECOMPONENTTRANSFER_TYPE_DISCRETE: >- return "discrete"_s; >- case FECOMPONENTTRANSFER_TYPE_LINEAR: >- return "linear"_s; >- case FECOMPONENTTRANSFER_TYPE_GAMMA: >- return "gamma"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static ComponentTransferType fromString(const String& value) >- { >- if (value == "identity") >- return FECOMPONENTTRANSFER_TYPE_IDENTITY; >- if (value == "table") >- return FECOMPONENTTRANSFER_TYPE_TABLE; >- if (value == "discrete") >- return FECOMPONENTTRANSFER_TYPE_DISCRETE; >- if (value == "linear") >- return FECOMPONENTTRANSFER_TYPE_LINEAR; >- if (value == "gamma") >- return FECOMPONENTTRANSFER_TYPE_GAMMA; >- return FECOMPONENTTRANSFER_TYPE_UNKNOWN; >- } >-}; >- > class SVGComponentTransferFunctionElement : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGComponentTransferFunctionElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGComponentTransferFunctionElement, SVGElement>; >+ > public: > ComponentTransferFunction transferFunction() const; > >@@ -91,13 +52,11 @@ public: > protected: > SVGComponentTransferFunctionElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGComponentTransferFunctionElement, SVGElement>; >- const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } >- >- void parseAttribute(const QualifiedName&, const AtomicString&) override; >- void svgAttributeChanged(const QualifiedName&) override; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >+ void parseAttribute(const QualifiedName&, const AtomicString&) final; >+ void svgAttributeChanged(const QualifiedName&) final; > >- bool rendererIsNeeded(const RenderStyle&) override { return false; } >+ bool rendererIsNeeded(const RenderStyle&) final { return false; } > > private: > PropertyRegistry m_propertyRegistry { *this }; >diff --git a/Source/WebCore/svg/SVGCursorElement.h b/Source/WebCore/svg/SVGCursorElement.h >index 9b812ebc8b4f11be972025aaa64458642fba6aed..6a123811d846e9ca18f89869cc60916253bd34a1 100644 >--- a/Source/WebCore/svg/SVGCursorElement.h >+++ b/Source/WebCore/svg/SVGCursorElement.h >@@ -32,6 +32,8 @@ class CSSCursorImageValue; > > class SVGCursorElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGTests, public SVGURIReference { > WTF_MAKE_ISO_ALLOCATED(SVGCursorElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGCursorElement, SVGElement, SVGExternalResourcesRequired, SVGTests, SVGURIReference>; >+ > public: > static Ref<SVGCursorElement> create(const QualifiedName&, Document&); > >@@ -49,9 +51,7 @@ public: > private: > SVGCursorElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGCursorElement, SVGElement, SVGExternalResourcesRequired, SVGTests, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGDefsElement.h b/Source/WebCore/svg/SVGDefsElement.h >index 8fbbef843bd8a9db43647c4653e9d7d41e96db37..6a44c918eca7c9b282ded0144ac8f90aeebfb79f 100644 >--- a/Source/WebCore/svg/SVGDefsElement.h >+++ b/Source/WebCore/svg/SVGDefsElement.h >@@ -28,13 +28,14 @@ namespace WebCore { > > class SVGDefsElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGDefsElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGDefsElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ > public: > static Ref<SVGDefsElement> create(const QualifiedName&, Document&); > > private: > SVGDefsElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGDefsElement, SVGGraphicsElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > > bool isValid() const final; >diff --git a/Source/WebCore/svg/SVGDescElement.h b/Source/WebCore/svg/SVGDescElement.h >index 5f5e1d8124ba903472704858ddc6b7a83774ab2f..32b2263ed1650dd87451c18e124dc87081e95311 100644 >--- a/Source/WebCore/svg/SVGDescElement.h >+++ b/Source/WebCore/svg/SVGDescElement.h >@@ -26,6 +26,8 @@ namespace WebCore { > > class SVGDescElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGDescElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGDescElement, SVGElement>; >+ > public: > static Ref<SVGDescElement> create(const QualifiedName&, Document&); > >@@ -34,7 +36,10 @@ public: > private: > SVGDescElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGElement.cpp b/Source/WebCore/svg/SVGElement.cpp >index cc5b6fd25e85b7f9ca9eca2e1aead4ef458f6189..e03decc2e558b87bb5f340627027ef6561ac5862 100644 >--- a/Source/WebCore/svg/SVGElement.cpp >+++ b/Source/WebCore/svg/SVGElement.cpp >@@ -238,17 +238,31 @@ void SVGElement::reportAttributeParsingError(SVGParsingError error, const Qualif > String errorString = "<" + tagName() + "> attribute " + name.toString() + "=\"" + value + "\""; > SVGDocumentExtensions& extensions = document().accessSVGExtensions(); > >- if (error == NegativeValueForbiddenError) { >+ switch (error) { >+ case NoError: >+ ASSERT_NOT_REACHED(); >+ break; >+ >+ case UnexpectedEndOfAttributeError: >+ extensions.reportError("Unexpected end of attribute for " + errorString); >+ break; >+ >+ case ZeroValueForbiddenError: >+ extensions.reportError("Invalid zero value for " + errorString); >+ break; >+ >+ case NegativeValueForbiddenError: > extensions.reportError("Invalid negative value for " + errorString); >- return; >- } >+ break; >+ >+ case UnrecognizedEnumValueError: >+ extensions.reportError("Unrecognized enumerated value for " + errorString); >+ break; > >- if (error == ParsingAttributeFailedError) { >+ case ParsingAttributeFailedError: > extensions.reportError("Invalid value for " + errorString); >- return; >+ break; > } >- >- ASSERT_NOT_REACHED(); > } > > void SVGElement::removedFromAncestor(RemovalType removalType, ContainerNode& oldParentOfRemovedTree) >@@ -574,7 +588,7 @@ void SVGElement::commitPropertyChange(SVGProperty* property) > // We want to dirty the top-level property when a descendant changes. For example > // a change in an SVGLength item in SVGLengthList should set the dirty flag on > // SVGLengthList and not the SVGLength. >- property->setDirty(); >+ property->setState(SVGPropertyState::Dirty); > > invalidateSVGAttributes(); > svgAttributeChanged(propertyRegistry().propertyAttributeName(*property)); >@@ -588,7 +602,7 @@ void SVGElement::commitPropertyChange(SVGAnimatedProperty& animatedProperty) > // A change in a style property, e.g SVGRectElement::x should be serialized to > // the attribute immediately. Otherwise it is okay to be lazy in this regard. > if (!propertyRegistry().isAnimatedStylePropertyAttribute(attributeName)) >- animatedProperty.setDirty(); >+ animatedProperty.setState(SVGPropertyState::Dirty); > else > setSynchronizedLazyAttribute(attributeName, animatedProperty.baseValAsString()); > >diff --git a/Source/WebCore/svg/SVGElement.h b/Source/WebCore/svg/SVGElement.h >index b4a701d1ed82a944906fec755897b625f8bf7170..bd04b93bd955974e50c1771216bbb73124248b5d 100644 >--- a/Source/WebCore/svg/SVGElement.h >+++ b/Source/WebCore/svg/SVGElement.h >@@ -49,7 +49,10 @@ void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, CSSPropertyID>* proper > > class SVGElement : public StyledElement, public SVGLangSpace, public SVGPropertyOwner { > WTF_MAKE_ISO_ALLOCATED(SVGElement); >+ > public: >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGElement>; >+ > bool isOutermostSVGSVGElement() const; > > SVGSVGElement* ownerSVGElement() const; >@@ -126,8 +129,7 @@ public: > class InstanceUpdateBlocker; > class InstanceInvalidationGuard; > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGElement>; >- virtual const SVGPropertyRegistry& propertyRegistry() const { return m_propertyRegistry; } >+ virtual const SVGPropertyRegistry& propertyRegistry() const = 0; > void detachAllProperties() { propertyRegistry().detachAllProperties(); } > > bool isAnimatedPropertyAttribute(const QualifiedName&) const; >@@ -200,7 +202,6 @@ private: > > std::unique_ptr<SVGPropertyAnimatorFactory> m_propertyAnimatorFactory; > >- PropertyRegistry m_propertyRegistry { *this }; > Ref<SVGAnimatedString> m_className { SVGAnimatedString::create(this) }; > }; > >diff --git a/Source/WebCore/svg/SVGEllipseElement.h b/Source/WebCore/svg/SVGEllipseElement.h >index 0fdca3767c4bb23fc62246777dc83a89117e9886..e3b1ea187eee28b5e9a1fd8f78d1630b4eed8f1c 100644 >--- a/Source/WebCore/svg/SVGEllipseElement.h >+++ b/Source/WebCore/svg/SVGEllipseElement.h >@@ -29,6 +29,8 @@ namespace WebCore { > > class SVGEllipseElement final : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGEllipseElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGEllipseElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ > public: > static Ref<SVGEllipseElement> create(const QualifiedName&, Document&); > >@@ -45,9 +47,7 @@ public: > private: > SVGEllipseElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGEllipseElement, SVGGeometryElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGExternalResourcesRequired.h b/Source/WebCore/svg/SVGExternalResourcesRequired.h >index 9919af6d1fa07c5dc559bc708810faf444eaea30..41ebe9c9973b20d050bdf40d4ccbffd89aa69adc 100644 >--- a/Source/WebCore/svg/SVGExternalResourcesRequired.h >+++ b/Source/WebCore/svg/SVGExternalResourcesRequired.h >@@ -36,7 +36,10 @@ class SVGElement; > // FIXME: When implementing animVal support, make sure that animVal==baseVal for externalResourcesRequired > class SVGExternalResourcesRequired { > WTF_MAKE_NONCOPYABLE(SVGExternalResourcesRequired); >+ > public: >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGExternalResourcesRequired>; >+ > virtual ~SVGExternalResourcesRequired() = default; > > void parseAttribute(const QualifiedName&, const AtomicString&); >@@ -44,8 +47,6 @@ public: > > static void addSupportedAttributes(HashSet<QualifiedName>&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGExternalResourcesRequired>; >- > bool externalResourcesRequired() const { return m_externalResourcesRequired->currentValue(); } > SVGAnimatedBoolean& externalResourcesRequiredAnimated() { return m_externalResourcesRequired; } > >diff --git a/Source/WebCore/svg/SVGFEBlendElement.h b/Source/WebCore/svg/SVGFEBlendElement.h >index a9c98e427664b2e13c167078f1f0dc7cd50230ba..d155ca5fd8c2ec90ceb03f68e0a87fddbccaef45 100644 >--- a/Source/WebCore/svg/SVGFEBlendElement.h >+++ b/Source/WebCore/svg/SVGFEBlendElement.h >@@ -27,28 +27,10 @@ > > namespace WebCore { > >-template<> >-struct SVGPropertyTraits<BlendMode> { >- static unsigned highestEnumValue() { return static_cast<unsigned>(BlendMode::Luminosity); } >- >- static BlendMode fromString(const String& string) >- { >- BlendMode mode = BlendMode::Normal; >- parseBlendMode(string, mode); >- return mode; >- } >- >- static String toString(BlendMode type) >- { >- if (type < BlendMode::PlusDarker) >- return blendModeName(type); >- >- return emptyString(); >- } >-}; >- > class SVGFEBlendElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEBlendElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEBlendElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEBlendElement> create(const QualifiedName&, Document&); > >@@ -63,9 +45,7 @@ public: > private: > SVGFEBlendElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEBlendElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFEColorMatrixElement.h b/Source/WebCore/svg/SVGFEColorMatrixElement.h >index 3ef24c94224868da77d0e80bcdf0c7465393f23e..064d390963497a55b9a2a8f02d7599a480962da8 100644 >--- a/Source/WebCore/svg/SVGFEColorMatrixElement.h >+++ b/Source/WebCore/svg/SVGFEColorMatrixElement.h >@@ -26,45 +26,10 @@ > > namespace WebCore { > >-template<> >-struct SVGPropertyTraits<ColorMatrixType> { >- static unsigned highestEnumValue() { return FECOLORMATRIX_TYPE_LUMINANCETOALPHA; } >- >- static String toString(ColorMatrixType type) >- { >- switch (type) { >- case FECOLORMATRIX_TYPE_UNKNOWN: >- return emptyString(); >- case FECOLORMATRIX_TYPE_MATRIX: >- return "matrix"_s; >- case FECOLORMATRIX_TYPE_SATURATE: >- return "saturate"_s; >- case FECOLORMATRIX_TYPE_HUEROTATE: >- return "hueRotate"_s; >- case FECOLORMATRIX_TYPE_LUMINANCETOALPHA: >- return "luminanceToAlpha"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static ColorMatrixType fromString(const String& value) >- { >- if (value == "matrix") >- return FECOLORMATRIX_TYPE_MATRIX; >- if (value == "saturate") >- return FECOLORMATRIX_TYPE_SATURATE; >- if (value == "hueRotate") >- return FECOLORMATRIX_TYPE_HUEROTATE; >- if (value == "luminanceToAlpha") >- return FECOLORMATRIX_TYPE_LUMINANCETOALPHA; >- return FECOLORMATRIX_TYPE_UNKNOWN; >- } >-}; >- > class SVGFEColorMatrixElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEColorMatrixElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEColorMatrixElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEColorMatrixElement> create(const QualifiedName&, Document&); > >@@ -79,9 +44,7 @@ public: > private: > SVGFEColorMatrixElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEColorMatrixElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFEComponentTransferElement.h b/Source/WebCore/svg/SVGFEComponentTransferElement.h >index 526216e56016fab5224aabe9132064cdb03ad0bb..d175ba1b8391ef18e566a8a1d331645e4b3b22f1 100644 >--- a/Source/WebCore/svg/SVGFEComponentTransferElement.h >+++ b/Source/WebCore/svg/SVGFEComponentTransferElement.h >@@ -28,6 +28,8 @@ namespace WebCore { > > class SVGFEComponentTransferElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEComponentTransferElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEComponentTransferElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEComponentTransferElement> create(const QualifiedName&, Document&); > >@@ -37,9 +39,7 @@ public: > private: > SVGFEComponentTransferElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEComponentTransferElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > // FIXME: svgAttributeChanged missing. > void parseAttribute(const QualifiedName&, const AtomicString&) override; > >diff --git a/Source/WebCore/svg/SVGFECompositeElement.h b/Source/WebCore/svg/SVGFECompositeElement.h >index a33c982b3495e3abfd4f18756aa110299fc9c2c5..47d73911bd01423a6390be51885336ca7786c4f6 100644 >--- a/Source/WebCore/svg/SVGFECompositeElement.h >+++ b/Source/WebCore/svg/SVGFECompositeElement.h >@@ -26,60 +26,10 @@ > > namespace WebCore { > >-template<> >-inline unsigned SVGIDLEnumLimits<CompositeOperationType>::highestExposedEnumValue() { return FECOMPOSITE_OPERATOR_ARITHMETIC; } >- >-template<> >-struct SVGPropertyTraits<CompositeOperationType> { >- static unsigned highestEnumValue() { return FECOMPOSITE_OPERATOR_LIGHTER; } >- >- static String toString(CompositeOperationType type) >- { >- switch (type) { >- case FECOMPOSITE_OPERATOR_UNKNOWN: >- return emptyString(); >- case FECOMPOSITE_OPERATOR_OVER: >- return "over"_s; >- case FECOMPOSITE_OPERATOR_IN: >- return "in"_s; >- case FECOMPOSITE_OPERATOR_OUT: >- return "out"_s; >- case FECOMPOSITE_OPERATOR_ATOP: >- return "atop"_s; >- case FECOMPOSITE_OPERATOR_XOR: >- return "xor"_s; >- case FECOMPOSITE_OPERATOR_ARITHMETIC: >- return "arithmetic"_s; >- case FECOMPOSITE_OPERATOR_LIGHTER: >- return "lighter"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static CompositeOperationType fromString(const String& value) >- { >- if (value == "over") >- return FECOMPOSITE_OPERATOR_OVER; >- if (value == "in") >- return FECOMPOSITE_OPERATOR_IN; >- if (value == "out") >- return FECOMPOSITE_OPERATOR_OUT; >- if (value == "atop") >- return FECOMPOSITE_OPERATOR_ATOP; >- if (value == "xor") >- return FECOMPOSITE_OPERATOR_XOR; >- if (value == "arithmetic") >- return FECOMPOSITE_OPERATOR_ARITHMETIC; >- if (value == "lighter") >- return FECOMPOSITE_OPERATOR_LIGHTER; >- return FECOMPOSITE_OPERATOR_UNKNOWN; >- } >-}; >- > class SVGFECompositeElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFECompositeElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFECompositeElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFECompositeElement> create(const QualifiedName&, Document&); > >@@ -102,9 +52,7 @@ public: > private: > SVGFECompositeElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFECompositeElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFEConvolveMatrixElement.h b/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >index cea1123faa918d5f1f15d2d433ec011f70211002..2181ddebdab3d5987f678829e28c8168c798867a 100644 >--- a/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >+++ b/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >@@ -25,42 +25,10 @@ > > namespace WebCore { > >-template<> >-struct SVGPropertyTraits<EdgeModeType> { >- static unsigned highestEnumValue() { return EDGEMODE_NONE; } >- static EdgeModeType initialValue() { return EDGEMODE_NONE; } >- >- static String toString(EdgeModeType type) >- { >- switch (type) { >- case EDGEMODE_UNKNOWN: >- return emptyString(); >- case EDGEMODE_DUPLICATE: >- return "duplicate"_s; >- case EDGEMODE_WRAP: >- return "wrap"_s; >- case EDGEMODE_NONE: >- return "none"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static EdgeModeType fromString(const String& value) >- { >- if (value == "duplicate") >- return EDGEMODE_DUPLICATE; >- if (value == "wrap") >- return EDGEMODE_WRAP; >- if (value == "none") >- return EDGEMODE_NONE; >- return EDGEMODE_UNKNOWN; >- } >-}; >- > class SVGFEConvolveMatrixElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEConvolveMatrixElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEConvolveMatrixElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEConvolveMatrixElement> create(const QualifiedName&, Document&); > >@@ -96,9 +64,7 @@ public: > private: > SVGFEConvolveMatrixElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEConvolveMatrixElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFEDiffuseLightingElement.h b/Source/WebCore/svg/SVGFEDiffuseLightingElement.h >index 8d795990cf23e0c414920e2f17b1cce784c7f135..4b81b166f7dd7eed799bb414b25b9614e0883edb 100644 >--- a/Source/WebCore/svg/SVGFEDiffuseLightingElement.h >+++ b/Source/WebCore/svg/SVGFEDiffuseLightingElement.h >@@ -32,6 +32,8 @@ class SVGColor; > > class SVGFEDiffuseLightingElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEDiffuseLightingElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDiffuseLightingElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEDiffuseLightingElement> create(const QualifiedName&, Document&); > void lightElementAttributeChanged(const SVGFELightElement*, const QualifiedName&); >@@ -51,9 +53,7 @@ public: > private: > SVGFEDiffuseLightingElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDiffuseLightingElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFEDisplacementMapElement.h b/Source/WebCore/svg/SVGFEDisplacementMapElement.h >index 422f0cf7ea9505427b07bf0aefffb3b8444197fa..9de85da3400483684116f93587d604354c2e00e0 100644 >--- a/Source/WebCore/svg/SVGFEDisplacementMapElement.h >+++ b/Source/WebCore/svg/SVGFEDisplacementMapElement.h >@@ -25,45 +25,10 @@ > > namespace WebCore { > >-template<> >-struct SVGPropertyTraits<ChannelSelectorType> { >- static unsigned highestEnumValue() { return CHANNEL_A; } >- >- static String toString(ChannelSelectorType type) >- { >- switch (type) { >- case CHANNEL_UNKNOWN: >- return emptyString(); >- case CHANNEL_R: >- return "R"_s; >- case CHANNEL_G: >- return "G"_s; >- case CHANNEL_B: >- return "B"_s; >- case CHANNEL_A: >- return "A"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static ChannelSelectorType fromString(const String& value) >- { >- if (value == "R") >- return CHANNEL_R; >- if (value == "G") >- return CHANNEL_G; >- if (value == "B") >- return CHANNEL_B; >- if (value == "A") >- return CHANNEL_A; >- return CHANNEL_UNKNOWN; >- } >-}; >- > class SVGFEDisplacementMapElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEDisplacementMapElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDisplacementMapElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEDisplacementMapElement> create(const QualifiedName&, Document&); > >@@ -84,9 +49,7 @@ public: > private: > SVGFEDisplacementMapElement(const QualifiedName& tagName, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDisplacementMapElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFEDropShadowElement.h b/Source/WebCore/svg/SVGFEDropShadowElement.h >index 061cca2bed96c1aab0534d7a0913c314ce1be5f4..60061b2e4b854a882bf234f36d6e5738c77e5bcc 100644 >--- a/Source/WebCore/svg/SVGFEDropShadowElement.h >+++ b/Source/WebCore/svg/SVGFEDropShadowElement.h >@@ -27,6 +27,8 @@ namespace WebCore { > > class SVGFEDropShadowElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEDropShadowElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDropShadowElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEDropShadowElement> create(const QualifiedName&, Document&); > >@@ -47,9 +49,7 @@ public: > private: > SVGFEDropShadowElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDropShadowElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFEFloodElement.h b/Source/WebCore/svg/SVGFEFloodElement.h >index b96a43aa313e75e4a3167248a1b6f5cf51fee911..70b23ed2b59f5bf7cd1068c7c392049dc3e7bc8b 100644 >--- a/Source/WebCore/svg/SVGFEFloodElement.h >+++ b/Source/WebCore/svg/SVGFEFloodElement.h >@@ -26,17 +26,17 @@ namespace WebCore { > > class SVGFEFloodElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEFloodElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEFloodElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEFloodElement> create(const QualifiedName&, Document&); > > private: > SVGFEFloodElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEFloodElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) final; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const final; > > PropertyRegistry m_propertyRegistry { *this }; > }; >diff --git a/Source/WebCore/svg/SVGFEGaussianBlurElement.h b/Source/WebCore/svg/SVGFEGaussianBlurElement.h >index b2d5e83cecd6da463b4a8c059f4f30ec2a4b5365..367d01a2475fc10ba3253e10f92d9e60380b7057 100644 >--- a/Source/WebCore/svg/SVGFEGaussianBlurElement.h >+++ b/Source/WebCore/svg/SVGFEGaussianBlurElement.h >@@ -29,6 +29,8 @@ namespace WebCore { > > class SVGFEGaussianBlurElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEGaussianBlurElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEGaussianBlurElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEGaussianBlurElement> create(const QualifiedName&, Document&); > >@@ -47,9 +49,7 @@ public: > private: > SVGFEGaussianBlurElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEGaussianBlurElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFEImageElement.h b/Source/WebCore/svg/SVGFEImageElement.h >index 7624990b358ab527b4d19e57f9dcdcebf9f5310e..17a50ea278321c66d5153f267aa60f943fda2988 100644 >--- a/Source/WebCore/svg/SVGFEImageElement.h >+++ b/Source/WebCore/svg/SVGFEImageElement.h >@@ -32,6 +32,8 @@ namespace WebCore { > > class SVGFEImageElement final : public SVGFilterPrimitiveStandardAttributes, public SVGExternalResourcesRequired, public SVGURIReference, public CachedImageClient { > WTF_MAKE_ISO_ALLOCATED(SVGFEImageElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEImageElement, SVGFilterPrimitiveStandardAttributes, SVGExternalResourcesRequired, SVGURIReference>; >+ > public: > static Ref<SVGFEImageElement> create(const QualifiedName&, Document&); > >@@ -45,9 +47,7 @@ public: > private: > SVGFEImageElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEImageElement, SVGFilterPrimitiveStandardAttributes, SVGExternalResourcesRequired, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFELightElement.h b/Source/WebCore/svg/SVGFELightElement.h >index 2534d1d7ac9d54e8d06445e7a7e2f85abd0b4c5e..6ebdc429cb0f6a5b3935687ff44fc05e5883ad74 100644 >--- a/Source/WebCore/svg/SVGFELightElement.h >+++ b/Source/WebCore/svg/SVGFELightElement.h >@@ -31,6 +31,8 @@ class SVGFilterBuilder; > > class SVGFELightElement : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGFELightElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFELightElement, SVGElement>; >+ > public: > virtual Ref<LightSource> lightSource(SVGFilterBuilder&) const = 0; > static SVGFELightElement* findLightElement(const SVGElement*); >@@ -63,9 +65,7 @@ protected: > bool rendererIsNeeded(const RenderStyle&) override { return false; } > > private: >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFELightElement, SVGElement>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > void childrenChanged(const ChildChange&) override; >diff --git a/Source/WebCore/svg/SVGFEMergeElement.h b/Source/WebCore/svg/SVGFEMergeElement.h >index 745086816f6976c6697dc51075802d283cf4e3c2..abeb6c1b17955aeb8c66f9093c5019d888a5b257 100644 >--- a/Source/WebCore/svg/SVGFEMergeElement.h >+++ b/Source/WebCore/svg/SVGFEMergeElement.h >@@ -26,15 +26,15 @@ namespace WebCore { > > class SVGFEMergeElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEMergeElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMergeElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEMergeElement> create(const QualifiedName&, Document&); > > private: > SVGFEMergeElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMergeElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > > PropertyRegistry m_propertyRegistry { *this }; >diff --git a/Source/WebCore/svg/SVGFEMergeNodeElement.h b/Source/WebCore/svg/SVGFEMergeNodeElement.h >index 8da92361408a23b88f1a6af04b7a532b2a9cb070..b13dfe0878cf5ad63955eefd2803b39e2421b123 100644 >--- a/Source/WebCore/svg/SVGFEMergeNodeElement.h >+++ b/Source/WebCore/svg/SVGFEMergeNodeElement.h >@@ -27,6 +27,8 @@ namespace WebCore { > > class SVGFEMergeNodeElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGFEMergeNodeElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMergeNodeElement, SVGElement>; >+ > public: > static Ref<SVGFEMergeNodeElement> create(const QualifiedName&, Document&); > >@@ -36,9 +38,7 @@ public: > private: > SVGFEMergeNodeElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMergeNodeElement, SVGElement>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGFEMorphologyElement.h b/Source/WebCore/svg/SVGFEMorphologyElement.h >index 99933555361a20541577b11245b48239b6d33b2d..6c32d2b1a9eb32c1e1f5fbe3b31621645dc32fb9 100644 >--- a/Source/WebCore/svg/SVGFEMorphologyElement.h >+++ b/Source/WebCore/svg/SVGFEMorphologyElement.h >@@ -25,37 +25,10 @@ > > namespace WebCore { > >-template<> >-struct SVGPropertyTraits<MorphologyOperatorType> { >- static unsigned highestEnumValue() { return FEMORPHOLOGY_OPERATOR_DILATE; } >- >- static String toString(MorphologyOperatorType type) >- { >- switch (type) { >- case FEMORPHOLOGY_OPERATOR_UNKNOWN: >- return emptyString(); >- case FEMORPHOLOGY_OPERATOR_ERODE: >- return "erode"_s; >- case FEMORPHOLOGY_OPERATOR_DILATE: >- return "dilate"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static MorphologyOperatorType fromString(const String& value) >- { >- if (value == "erode") >- return FEMORPHOLOGY_OPERATOR_ERODE; >- if (value == "dilate") >- return FEMORPHOLOGY_OPERATOR_DILATE; >- return FEMORPHOLOGY_OPERATOR_UNKNOWN; >- } >-}; >- > class SVGFEMorphologyElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEMorphologyElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMorphologyElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEMorphologyElement> create(const QualifiedName&, Document&); > >@@ -74,9 +47,7 @@ public: > private: > SVGFEMorphologyElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMorphologyElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFEOffsetElement.h b/Source/WebCore/svg/SVGFEOffsetElement.h >index 3d8d77dbef7839109e3b0bc70af01a9f0e62ba54..1c508b2c288e903fab45b75868d3e6362b927570 100644 >--- a/Source/WebCore/svg/SVGFEOffsetElement.h >+++ b/Source/WebCore/svg/SVGFEOffsetElement.h >@@ -27,6 +27,8 @@ namespace WebCore { > > class SVGFEOffsetElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEOffsetElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEOffsetElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFEOffsetElement> create(const QualifiedName&, Document&); > >@@ -41,9 +43,7 @@ public: > private: > SVGFEOffsetElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEOffsetElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFESpecularLightingElement.h b/Source/WebCore/svg/SVGFESpecularLightingElement.h >index ce23cb5ae22c3f751e115c7082aba158b5a3cc09..7a756df5e49bfea6b21a73d90e635205c6185403 100644 >--- a/Source/WebCore/svg/SVGFESpecularLightingElement.h >+++ b/Source/WebCore/svg/SVGFESpecularLightingElement.h >@@ -30,6 +30,8 @@ namespace WebCore { > > class SVGFESpecularLightingElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFESpecularLightingElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFESpecularLightingElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFESpecularLightingElement> create(const QualifiedName&, Document&); > void lightElementAttributeChanged(const SVGFELightElement*, const QualifiedName&); >@@ -51,9 +53,7 @@ public: > private: > SVGFESpecularLightingElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFESpecularLightingElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFETileElement.h b/Source/WebCore/svg/SVGFETileElement.h >index adcc7a8d304cb332d9bae7ba582849c261f4b4d8..65647201912da637fa19b5c7f83e65ee6c822300 100644 >--- a/Source/WebCore/svg/SVGFETileElement.h >+++ b/Source/WebCore/svg/SVGFETileElement.h >@@ -27,6 +27,8 @@ namespace WebCore { > > class SVGFETileElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFETileElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFETileElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: > static Ref<SVGFETileElement> create(const QualifiedName&, Document&); > >@@ -36,9 +38,7 @@ public: > private: > SVGFETileElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFETileElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGFETurbulenceElement.cpp b/Source/WebCore/svg/SVGFETurbulenceElement.cpp >index 3e35d220e48a1ac5757f937bd33d06ad4d0d1eb6..58e7ca678e28ad2a74bd4371e827b4802606635c 100644 >--- a/Source/WebCore/svg/SVGFETurbulenceElement.cpp >+++ b/Source/WebCore/svg/SVGFETurbulenceElement.cpp >@@ -121,7 +121,7 @@ RefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter& fi > { > if (baseFrequencyX() < 0 || baseFrequencyY() < 0) > return nullptr; >- return FETurbulence::create(filter, type(), baseFrequencyX(), baseFrequencyY(), numOctaves(), seed(), stitchTiles() == SVG_STITCHTYPE_STITCH); >+ return FETurbulence::create(filter, type(), baseFrequencyX(), baseFrequencyY(), numOctaves(), seed(), stitchTiles() == SVGStitchTypeStitch); > } > > } >diff --git a/Source/WebCore/svg/SVGFETurbulenceElement.h b/Source/WebCore/svg/SVGFETurbulenceElement.h >index cca7f85783f4886ec981f6fa1db962b9cb416c2e..7ca5e28bbbfc68e47f1259c9dcb8613b41892d8e 100644 >--- a/Source/WebCore/svg/SVGFETurbulenceElement.h >+++ b/Source/WebCore/svg/SVGFETurbulenceElement.h >@@ -26,73 +26,18 @@ > > namespace WebCore { > >-enum SVGStitchOptions { >- SVG_STITCHTYPE_UNKNOWN = 0, >- SVG_STITCHTYPE_STITCH = 1, >- SVG_STITCHTYPE_NOSTITCH = 2 >-}; >- >-template<> >-struct SVGPropertyTraits<SVGStitchOptions> { >- static unsigned highestEnumValue() { return SVG_STITCHTYPE_NOSTITCH; } >- >- static String toString(SVGStitchOptions type) >- { >- switch (type) { >- case SVG_STITCHTYPE_UNKNOWN: >- return emptyString(); >- case SVG_STITCHTYPE_STITCH: >- return "stitch"_s; >- case SVG_STITCHTYPE_NOSTITCH: >- return "noStitch"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static SVGStitchOptions fromString(const String& value) >- { >- if (value == "stitch") >- return SVG_STITCHTYPE_STITCH; >- if (value == "noStitch") >- return SVG_STITCHTYPE_NOSTITCH; >- return SVG_STITCHTYPE_UNKNOWN; >- } >-}; >- >-template<> >-struct SVGPropertyTraits<TurbulenceType> { >- static unsigned highestEnumValue() { return static_cast<unsigned>(TurbulenceType::Turbulence); } >- >- static String toString(TurbulenceType type) >- { >- switch (type) { >- case TurbulenceType::Unknown: >- return emptyString(); >- case TurbulenceType::FractalNoise: >- return "fractalNoise"_s; >- case TurbulenceType::Turbulence: >- return "turbulence"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static TurbulenceType fromString(const String& value) >- { >- if (value == "fractalNoise") >- return TurbulenceType::FractalNoise; >- if (value == "turbulence") >- return TurbulenceType::Turbulence; >- return TurbulenceType::Unknown; >- } >-}; >- > class SVGFETurbulenceElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFETurbulenceElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFETurbulenceElement, SVGFilterPrimitiveStandardAttributes>; >+ > public: >+ // Forward declare enumerations in the W3C naming scheme, for IDL generation. >+ enum { >+ SVG_STITCHTYPE_UNKNOWN = SVGStitchTypeUnknown, >+ SVG_STITCHTYPE_STITCH = SVGStitchTypeStitch, >+ SVG_STITCHTYPE_NOSTITCH = SVGStitchTypeNoStitch, >+ }; >+ > static Ref<SVGFETurbulenceElement> create(const QualifiedName&, Document&); > > float baseFrequencyX() const { return m_baseFrequencyX->currentValue(); } >@@ -112,9 +57,7 @@ public: > private: > SVGFETurbulenceElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFETurbulenceElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >@@ -126,7 +69,7 @@ private: > Ref<SVGAnimatedNumber> m_baseFrequencyY { SVGAnimatedNumber::create(this) }; > Ref<SVGAnimatedInteger> m_numOctaves { SVGAnimatedInteger::create(this, 1) }; > Ref<SVGAnimatedNumber> m_seed { SVGAnimatedNumber::create(this) }; >- Ref<SVGAnimatedEnumeration> m_stitchTiles { SVGAnimatedEnumeration::create(this, SVG_STITCHTYPE_NOSTITCH) }; >+ Ref<SVGAnimatedEnumeration> m_stitchTiles { SVGAnimatedEnumeration::create(this, SVGStitchTypeNoStitch) }; > Ref<SVGAnimatedEnumeration> m_type { SVGAnimatedEnumeration::create(this, TurbulenceType::Turbulence) }; > }; > >diff --git a/Source/WebCore/svg/SVGFilterElement.h b/Source/WebCore/svg/SVGFilterElement.h >index e1f2f5bcec563df15c27f9fd4fe44bc88a34657c..11155e8b1c384d50ebe006528e5fda693db45f84 100644 >--- a/Source/WebCore/svg/SVGFilterElement.h >+++ b/Source/WebCore/svg/SVGFilterElement.h >@@ -32,6 +32,8 @@ namespace WebCore { > > class SVGFilterElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGURIReference { > WTF_MAKE_ISO_ALLOCATED(SVGFilterElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFilterElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >+ > public: > static Ref<SVGFilterElement> create(const QualifiedName&, Document&); > >@@ -52,9 +54,7 @@ public: > private: > SVGFilterElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFilterElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > void childrenChanged(const ChildChange&) final; >diff --git a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >index eb25b53a94d8e5fdd89285b583b732313e232010..cb81902cd1a7219b285ce43282f7c49798633bac 100644 >--- a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >+++ b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >@@ -36,14 +36,14 @@ class SVGFilterBuilder; > class SVGFilterPrimitiveStandardAttributes : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGFilterPrimitiveStandardAttributes); > public: >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFilterPrimitiveStandardAttributes, SVGElement>; >+ > void setStandardAttributes(FilterEffect*) const; > > virtual RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const = 0; > // Returns true, if the new value is different from the old one. > virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFilterPrimitiveStandardAttributes, SVGElement>; >- > const SVGLengthValue& x() const { return m_x->currentValue(); } > const SVGLengthValue& y() const { return m_y->currentValue(); } > const SVGLengthValue& width() const { return m_width->currentValue(); } >diff --git a/Source/WebCore/svg/SVGFitToViewBox.cpp b/Source/WebCore/svg/SVGFitToViewBox.cpp >index d15e3546c1213e00dfa57c81b4a00b2efe30a973..3e37800bec2d6603bcc504ca77cdf543e14ad826 100644 >--- a/Source/WebCore/svg/SVGFitToViewBox.cpp >+++ b/Source/WebCore/svg/SVGFitToViewBox.cpp >@@ -35,7 +35,7 @@ > namespace WebCore { > > SVGFitToViewBox::SVGFitToViewBox(SVGElement* contextElement, SVGPropertyAccess access) >- : m_viewBox(SVGAnimatedRect::create(contextElement, access)) >+ : m_viewBox(SVGAnimatedRect::create(contextElement, access, SVGPropertyState::Invalid)) > , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(contextElement, access)) > { > static std::once_flag onceFlag; >@@ -48,13 +48,13 @@ SVGFitToViewBox::SVGFitToViewBox(SVGElement* contextElement, SVGPropertyAccess a > void SVGFitToViewBox::setViewBox(const FloatRect& viewBox) > { > m_viewBox->setBaseValInternal(viewBox); >- m_isViewBoxValid = true; >+ m_viewBox->setState(SVGPropertyState::Clean); > } > > void SVGFitToViewBox::resetViewBox() > { > m_viewBox->setBaseValInternal({ }); >- m_isViewBoxValid = false; >+ m_viewBox->setState(SVGPropertyState::Invalid); > } > > void SVGFitToViewBox::reset() >@@ -63,35 +63,41 @@ void SVGFitToViewBox::reset() > resetPreserveAspectRatio(); > } > >-bool SVGFitToViewBox::parseAttribute(const QualifiedName& name, const AtomicString& value) >+Optional<SVGParsingError> SVGFitToViewBox::parseAttribute(const QualifiedName& name, const AtomicString& value) > { >- if (name == SVGNames::viewBoxAttr) { >+ if (name.matches(SVGNames::viewBoxAttr)) { > FloatRect viewBox; >- if (!value.isNull() && parseViewBox(value, viewBox)) >- setViewBox(viewBox); >- else >+ if (auto error = parseViewBox(value, viewBox)) { > resetViewBox(); >- return true; >+ return error; >+ } >+ setViewBox(viewBox); >+ return NoError; > } > >- if (name == SVGNames::preserveAspectRatioAttr) { >+ if (name.matches(SVGNames::preserveAspectRatioAttr)) { > SVGPreserveAspectRatioValue preserveAspectRatio; >- preserveAspectRatio.parse(value); >+ if (!preserveAspectRatio.parse(value)) { >+ resetPreserveAspectRatio(); >+ return ParsingAttributeFailedError; >+ } > setPreserveAspectRatio(preserveAspectRatio); >- return true; >+ return NoError; > } > >- return false; >+ return { }; > } > >-bool SVGFitToViewBox::parseViewBox(const AtomicString& value, FloatRect& viewBox) >+SVGParsingError SVGFitToViewBox::parseViewBox(const AtomicString& value, FloatRect& viewBox) > { >+ if (value.isNull()) >+ return UnexpectedEndOfAttributeError; > auto upconvertedCharacters = StringView(value).upconvertedCharacters(); > const UChar* characters = upconvertedCharacters; > return parseViewBox(characters, characters + value.length(), viewBox); > } > >-bool SVGFitToViewBox::parseViewBox(const UChar*& c, const UChar* end, FloatRect& viewBox, bool validate) >+SVGParsingError SVGFitToViewBox::parseViewBox(const UChar*& c, const UChar* end, FloatRect& viewBox) > { > String str(c, end - c); > >@@ -103,36 +109,24 @@ bool SVGFitToViewBox::parseViewBox(const UChar*& c, const UChar* end, FloatRect& > float height = 0.0f; > bool valid = parseNumber(c, end, x) && parseNumber(c, end, y) && parseNumber(c, end, width) && parseNumber(c, end, height, false); > >- if (validate) { >- Document& document = m_viewBox->contextElement()->document(); >+ if (!valid) >+ return ParsingAttributeFailedError; > >- if (!valid) { >- document.accessSVGExtensions().reportWarning("Problem parsing viewBox=\"" + str + "\""); >- return false; >- } >+ // Check that width is positive. >+ if (width < 0.0) >+ return NegativeValueForbiddenError; > >- // Check that width is positive. >- if (width < 0.0) { >- document.accessSVGExtensions().reportError("A negative value for ViewBox width is not allowed"); >- return false; >- } >+ // Check that height is positive. >+ if (height < 0.0) >+ return NegativeValueForbiddenError; > >- // Check that height is positive. >- if (height < 0.0) { >- document.accessSVGExtensions().reportError("A negative value for ViewBox height is not allowed"); >- return false; >- } >- >- // Nothing should come after the last, fourth number. >- skipOptionalSVGSpaces(c, end); >- if (c < end) { >- document.accessSVGExtensions().reportWarning("Problem parsing viewBox=\"" + str + "\""); >- return false; >- } >- } >+ // Nothing should come after the last, fourth number. >+ skipOptionalSVGSpaces(c, end); >+ if (c < end) >+ return ParsingAttributeFailedError; > > viewBox = { x, y, width, height }; >- return true; >+ return NoError; > } > > AffineTransform SVGFitToViewBox::viewBoxToViewTransform(const FloatRect& viewBoxRect, const SVGPreserveAspectRatioValue& preserveAspectRatio, float viewWidth, float viewHeight) >diff --git a/Source/WebCore/svg/SVGFitToViewBox.h b/Source/WebCore/svg/SVGFitToViewBox.h >index 7cc4231416019319d7e2b4d2d7d7636c379b8a4f..b311f4ba2204f5e9d6743879f6976e247dfec815 100644 >--- a/Source/WebCore/svg/SVGFitToViewBox.h >+++ b/Source/WebCore/svg/SVGFitToViewBox.h >@@ -36,42 +36,41 @@ class AffineTransform; > class SVGFitToViewBox { > WTF_MAKE_NONCOPYABLE(SVGFitToViewBox); > public: >- static AffineTransform viewBoxToViewTransform(const FloatRect& viewBoxRect, const SVGPreserveAspectRatioValue&, float viewWidth, float viewHeight); >- > using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFitToViewBox>; > >+ static AffineTransform viewBoxToViewTransform(const FloatRect& viewBoxRect, const SVGPreserveAspectRatioValue&, float viewWidth, float viewHeight); >+ > const FloatRect& viewBox() const { return m_viewBox->currentValue(); } > const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); } > > SVGAnimatedRect& viewBoxAnimated() { return m_viewBox; } > SVGAnimatedPreserveAspectRatio& preserveAspectRatioAnimated() { return m_preserveAspectRatio; } > >+ String viewBoxString() const { return SVGPropertyTraits<FloatRect>::toString(viewBox()); } >+ String preserveAspectRatioString() const { return preserveAspectRatio().valueAsString(); } > void setViewBox(const FloatRect&); >- void resetViewBox(); > > void setPreserveAspectRatio(const SVGPreserveAspectRatioValue& preserveAspectRatio) { m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio); } >- void resetPreserveAspectRatio() { m_preserveAspectRatio->setBaseValInternal({ }); } >- >- String viewBoxString() const { return SVGPropertyTraits<FloatRect>::toString(viewBox()); } >- String preserveAspectRatioString() const { return preserveAspectRatio().valueAsString(); } >+ void reset(); > >- bool hasValidViewBox() const { return m_isViewBoxValid; } >- bool hasEmptyViewBox() const { return m_isViewBoxValid && viewBox().isEmpty(); } >+ bool hasValidViewBox() const { return m_viewBox->state() != SVGPropertyState::Invalid; } >+ bool hasEmptyViewBox() const { return hasValidViewBox() && viewBox().isEmpty(); } > > protected: > SVGFitToViewBox(SVGElement* contextElement, SVGPropertyAccess = SVGPropertyAccess::ReadWrite); > > static bool isKnownAttribute(const QualifiedName& attributeName) { return PropertyRegistry::isKnownAttribute(attributeName); } > >- void reset(); >- bool parseAttribute(const QualifiedName&, const AtomicString&); >- bool parseViewBox(const AtomicString& value, FloatRect& viewBox); >- bool parseViewBox(const UChar*& start, const UChar* end, FloatRect& viewBox, bool validate = true); >+ Optional<SVGParsingError> parseAttribute(const QualifiedName&, const AtomicString&); >+ SVGParsingError parseViewBox(const AtomicString& value, FloatRect& viewBox); >+ SVGParsingError parseViewBox(const UChar*& start, const UChar* end, FloatRect& viewBox); > > private: >+ void resetViewBox(); >+ void resetPreserveAspectRatio() { m_preserveAspectRatio->setBaseValInternal({ }); } >+ > Ref<SVGAnimatedRect> m_viewBox; > Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio; >- bool m_isViewBoxValid { false }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFontElement.h b/Source/WebCore/svg/SVGFontElement.h >index cd1e8ea0b274d8cc8d647eaab61d0ef75bd95748..a662a0bd8ee9cb5e3d3a6da2190631b8872f2eec 100644 >--- a/Source/WebCore/svg/SVGFontElement.h >+++ b/Source/WebCore/svg/SVGFontElement.h >@@ -44,16 +44,16 @@ struct SVGKerningPair { > > class SVGFontElement final : public SVGElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGFontElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFontElement, SVGElement, SVGExternalResourcesRequired>; >+ > public: > static Ref<SVGFontElement> create(const QualifiedName&, Document&); > > private: > SVGFontElement(const QualifiedName&, Document&); > >- bool rendererIsNeeded(const RenderStyle&) final { return false; } >- >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFontElement, SVGElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >+ bool rendererIsNeeded(const RenderStyle&) final { return false; } > > PropertyRegistry m_propertyRegistry { *this }; > }; >diff --git a/Source/WebCore/svg/SVGFontFaceElement.h b/Source/WebCore/svg/SVGFontFaceElement.h >index 8f8ba5892be280798ee41dc00bd1b3cb7d3098a9..24f74eebd843829fad683c03051208ae21cdf9e4 100644 >--- a/Source/WebCore/svg/SVGFontFaceElement.h >+++ b/Source/WebCore/svg/SVGFontFaceElement.h >@@ -32,6 +32,8 @@ class StyleRuleFontFace; > > class SVGFontFaceElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGFontFaceElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFontFaceElement, SVGElement>; >+ > public: > static Ref<SVGFontFaceElement> create(const QualifiedName&, Document&); > >@@ -57,6 +59,7 @@ private: > SVGFontFaceElement(const QualifiedName&, Document&); > ~SVGFontFaceElement(); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > > void childrenChanged(const ChildChange&) final; >@@ -65,6 +68,7 @@ private: > > bool rendererIsNeeded(const RenderStyle&) final { return false; } > >+ PropertyRegistry m_propertyRegistry { *this }; > Ref<StyleRuleFontFace> m_fontFaceRule; > SVGFontElement* m_fontElement; > }; >diff --git a/Source/WebCore/svg/SVGFontFaceFormatElement.h b/Source/WebCore/svg/SVGFontFaceFormatElement.h >index 056075ee9ab37cf8ce874632980e7c210843538f..235e0c8f83a31c7d9534dc118c8f5e16d76c5d43 100644 >--- a/Source/WebCore/svg/SVGFontFaceFormatElement.h >+++ b/Source/WebCore/svg/SVGFontFaceFormatElement.h >@@ -27,14 +27,19 @@ namespace WebCore { > > class SVGFontFaceFormatElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGFontFaceFormatElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFontFaceFormatElement, SVGElement>; >+ > public: > static Ref<SVGFontFaceFormatElement> create(const QualifiedName&, Document&); > > private: > SVGFontFaceFormatElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > void childrenChanged(const ChildChange&) final; > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFontFaceNameElement.h b/Source/WebCore/svg/SVGFontFaceNameElement.h >index 867cdc85f6ed4474922f72e8d9370931593686b6..42b20f6d6587cdd26d5710211d1d0d9786b6c568 100644 >--- a/Source/WebCore/svg/SVGFontFaceNameElement.h >+++ b/Source/WebCore/svg/SVGFontFaceNameElement.h >@@ -29,6 +29,8 @@ class CSSFontFaceSrcValue; > > class SVGFontFaceNameElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGFontFaceNameElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFontFaceNameElement, SVGElement>; >+ > public: > static Ref<SVGFontFaceNameElement> create(const QualifiedName&, Document&); > >@@ -37,7 +39,10 @@ public: > private: > SVGFontFaceNameElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFontFaceSrcElement.h b/Source/WebCore/svg/SVGFontFaceSrcElement.h >index 416968c61f5af19216624da2b1c6189f7bd7429a..7befa862c598053e041b71c88e48df0f7c227cb8 100644 >--- a/Source/WebCore/svg/SVGFontFaceSrcElement.h >+++ b/Source/WebCore/svg/SVGFontFaceSrcElement.h >@@ -29,6 +29,8 @@ class CSSValueList; > > class SVGFontFaceSrcElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGFontFaceSrcElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFontFaceSrcElement, SVGElement>; >+ > public: > static Ref<SVGFontFaceSrcElement> create(const QualifiedName&, Document&); > >@@ -37,8 +39,11 @@ public: > private: > SVGFontFaceSrcElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > void childrenChanged(const ChildChange&) final; > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFontFaceUriElement.h b/Source/WebCore/svg/SVGFontFaceUriElement.h >index c78a2bca97f4fa359df1a67f0ede0048199810b3..d7c90db84cd50bb83ad669fb42c09632b8a52b53 100644 >--- a/Source/WebCore/svg/SVGFontFaceUriElement.h >+++ b/Source/WebCore/svg/SVGFontFaceUriElement.h >@@ -31,6 +31,8 @@ class CSSFontFaceSrcValue; > > class SVGFontFaceUriElement final : public SVGElement, public CachedFontClient { > WTF_MAKE_ISO_ALLOCATED(SVGFontFaceUriElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFontFaceUriElement, SVGElement>; >+ > public: > static Ref<SVGFontFaceUriElement> create(const QualifiedName&, Document&); > >@@ -40,14 +42,17 @@ public: > > private: > SVGFontFaceUriElement(const QualifiedName&, Document&); >- >+ >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void childrenChanged(const ChildChange&) final; >+ > InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) final; > bool rendererIsNeeded(const RenderStyle&) final { return false; } > > void loadFont(); > >+ PropertyRegistry m_propertyRegistry { *this }; > CachedResourceHandle<CachedFont> m_cachedFont; > }; > >diff --git a/Source/WebCore/svg/SVGForeignObjectElement.h b/Source/WebCore/svg/SVGForeignObjectElement.h >index fb57468a06fba108a512f9be5e26011b2879f6f7..0ac851dd69fa0dc031f83b62b89a092aac3e2c28 100644 >--- a/Source/WebCore/svg/SVGForeignObjectElement.h >+++ b/Source/WebCore/svg/SVGForeignObjectElement.h >@@ -28,6 +28,8 @@ namespace WebCore { > > class SVGForeignObjectElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGForeignObjectElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGForeignObjectElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ > public: > static Ref<SVGForeignObjectElement> create(const QualifiedName&, Document&); > >@@ -44,9 +46,7 @@ public: > private: > SVGForeignObjectElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGForeignObjectElement, SVGGraphicsElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGGElement.h b/Source/WebCore/svg/SVGGElement.h >index cb206ae34ad2cbbbf34801c12ae40197902b6f5f..adaebbed1535164a1a09a292caaa54276d95b999 100644 >--- a/Source/WebCore/svg/SVGGElement.h >+++ b/Source/WebCore/svg/SVGGElement.h >@@ -28,6 +28,8 @@ namespace WebCore { > > class SVGGElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGGElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ > public: > static Ref<SVGGElement> create(const QualifiedName&, Document&); > static Ref<SVGGElement> create(Document&); >@@ -37,9 +39,7 @@ private: > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGElement, SVGGraphicsElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGGeometryElement.h b/Source/WebCore/svg/SVGGeometryElement.h >index d24e622d1e02a259d03bc8d6ff52d1f06cb86f56..3cf247d7dec01f975f0a4c21eb94e711a8dba3e0 100644 >--- a/Source/WebCore/svg/SVGGeometryElement.h >+++ b/Source/WebCore/svg/SVGGeometryElement.h >@@ -33,15 +33,16 @@ class SVGPoint; > > class SVGGeometryElement : public SVGGraphicsElement { > WTF_MAKE_ISO_ALLOCATED(SVGGeometryElement); >+ > public: >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGeometryElement, SVGGraphicsElement>; >+ > virtual float getTotalLength() const; > virtual Ref<SVGPoint> getPointAtLength(float distance) const; > > bool isPointInFill(DOMPointInit&&); > bool isPointInStroke(DOMPointInit&&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGeometryElement, SVGGraphicsElement>; >- > float pathLength() const { return m_pathLength->currentValue(); } > SVGAnimatedNumber& pathLengthAnimated() { return m_pathLength; } > >diff --git a/Source/WebCore/svg/SVGGlyphElement.h b/Source/WebCore/svg/SVGGlyphElement.h >index 9ff991e720cb82f8fa0a06a60080500ba6988d81..90c693895fd30a7afda2beb7df70b233e45bd484 100644 >--- a/Source/WebCore/svg/SVGGlyphElement.h >+++ b/Source/WebCore/svg/SVGGlyphElement.h >@@ -29,6 +29,8 @@ namespace WebCore { > > class SVGGlyphElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGGlyphElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGlyphElement, SVGElement>; >+ > public: > static Ref<SVGGlyphElement> create(const QualifiedName&, Document&); > >@@ -38,7 +40,10 @@ public: > private: > SVGGlyphElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGGlyphRefElement.h b/Source/WebCore/svg/SVGGlyphRefElement.h >index be046ee73625aed90bcd7df56abe9e1d715d9869..592b8cfab8316a7f9729f0ca99253b71c5250139 100644 >--- a/Source/WebCore/svg/SVGGlyphRefElement.h >+++ b/Source/WebCore/svg/SVGGlyphRefElement.h >@@ -29,6 +29,8 @@ namespace WebCore { > > class SVGGlyphRefElement final : public SVGElement, public SVGURIReference { > WTF_MAKE_ISO_ALLOCATED(SVGGlyphRefElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGlyphRefElement, SVGElement, SVGURIReference>; >+ > public: > static Ref<SVGGlyphRefElement> create(const QualifiedName&, Document&); > >@@ -46,9 +48,7 @@ public: > private: > SVGGlyphRefElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGlyphRefElement, SVGElement, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > bool rendererIsNeeded(const RenderStyle&) final { return false; } > >diff --git a/Source/WebCore/svg/SVGGradientElement.h b/Source/WebCore/svg/SVGGradientElement.h >index 21b210c5951dcb1cec5c642ea89ec3622481f7af..0b6c7d5f2dd932ca59c1a3f25553025dc3159ca4 100644 >--- a/Source/WebCore/svg/SVGGradientElement.h >+++ b/Source/WebCore/svg/SVGGradientElement.h >@@ -30,49 +30,12 @@ > > namespace WebCore { > >-enum SVGSpreadMethodType { >- SVGSpreadMethodUnknown = 0, >- SVGSpreadMethodPad, >- SVGSpreadMethodReflect, >- SVGSpreadMethodRepeat >-}; >- >-template<> >-struct SVGPropertyTraits<SVGSpreadMethodType> { >- static unsigned highestEnumValue() { return SVGSpreadMethodRepeat; } >- >- static String toString(SVGSpreadMethodType type) >- { >- switch (type) { >- case SVGSpreadMethodUnknown: >- return emptyString(); >- case SVGSpreadMethodPad: >- return "pad"_s; >- case SVGSpreadMethodReflect: >- return "reflect"_s; >- case SVGSpreadMethodRepeat: >- return "repeat"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static SVGSpreadMethodType fromString(const String& value) >- { >- if (value == "pad") >- return SVGSpreadMethodPad; >- if (value == "reflect") >- return SVGSpreadMethodReflect; >- if (value == "repeat") >- return SVGSpreadMethodRepeat; >- return SVGSpreadMethodUnknown; >- } >-}; >- > class SVGGradientElement : public SVGElement, public SVGExternalResourcesRequired, public SVGURIReference { > WTF_MAKE_ISO_ALLOCATED(SVGGradientElement); >+ > public: >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGradientElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >+ > enum { > SVG_SPREADMETHOD_UNKNOWN = SVGSpreadMethodUnknown, > SVG_SPREADMETHOD_PAD = SVGSpreadMethodReflect, >@@ -82,8 +45,6 @@ public: > > Vector<Gradient::ColorStop> buildStops(); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGradientElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >- > SVGSpreadMethodType spreadMethod() const { return m_spreadMethod->currentValue<SVGSpreadMethodType>(); } > SVGUnitTypes::SVGUnitType gradientUnits() const { return m_gradientUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } > const SVGTransformList& gradientTransform() const { return m_gradientTransform->currentValue(); } >diff --git a/Source/WebCore/svg/SVGGraphicsElement.h b/Source/WebCore/svg/SVGGraphicsElement.h >index d516e59b385906b287982cb90fd8f760ffa7754a..7ec44f1bc3fc1a1360b20bc094047206b06ac1ac 100644 >--- a/Source/WebCore/svg/SVGGraphicsElement.h >+++ b/Source/WebCore/svg/SVGGraphicsElement.h >@@ -34,7 +34,10 @@ class SVGMatrix; > > class SVGGraphicsElement : public SVGElement, public SVGTransformable, public SVGTests { > WTF_MAKE_ISO_ALLOCATED(SVGGraphicsElement); >+ > public: >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGraphicsElement, SVGElement, SVGTests>; >+ > virtual ~SVGGraphicsElement(); > > Ref<SVGMatrix> getCTMForBindings(); >@@ -62,8 +65,6 @@ public: > > size_t approximateMemoryCost() const override { return sizeof(*this); } > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGraphicsElement, SVGElement, SVGTests>; >- > const SVGTransformList& transform() const { return m_transform->currentValue(); } > SVGAnimatedTransformList& transformAnimated() { return m_transform; } > >diff --git a/Source/WebCore/svg/SVGHKernElement.h b/Source/WebCore/svg/SVGHKernElement.h >index 747b0327d698637c8f65e7be9044088454365133..f2935f00d206df3315e101e57435ab5de0ce90e0 100644 >--- a/Source/WebCore/svg/SVGHKernElement.h >+++ b/Source/WebCore/svg/SVGHKernElement.h >@@ -29,6 +29,8 @@ namespace WebCore { > > class SVGHKernElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGHKernElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGHKernElement, SVGElement>; >+ > public: > static Ref<SVGHKernElement> create(const QualifiedName&, Document&); > >@@ -37,7 +39,10 @@ public: > private: > SVGHKernElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGImageElement.h b/Source/WebCore/svg/SVGImageElement.h >index dcd7a0826ad49a2efd6d108bb11a289e963954d4..d31f032db9cc91dd814f022e2f8d0edd7c02579b 100644 >--- a/Source/WebCore/svg/SVGImageElement.h >+++ b/Source/WebCore/svg/SVGImageElement.h >@@ -30,6 +30,8 @@ namespace WebCore { > > class SVGImageElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired, public SVGURIReference { > WTF_MAKE_ISO_ALLOCATED(SVGImageElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGImageElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; >+ > public: > static Ref<SVGImageElement> create(const QualifiedName&, Document&); > >@@ -51,9 +53,7 @@ public: > private: > SVGImageElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGImageElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGLength.h b/Source/WebCore/svg/SVGLength.h >index ff0fd3514b263e138d5cca907f3a7987b6f3b9ef..9bbb5df8255aef60a58c134f2458ae18fc9021b6 100644 >--- a/Source/WebCore/svg/SVGLength.h >+++ b/Source/WebCore/svg/SVGLength.h >@@ -66,6 +66,23 @@ public: > return adoptRef(*new SVGLength(owner, access, value)); > } > >+ static Expected<Ref<SVGLength>, SVGParsingError> create(const UChar*& ptr, const UChar* end, SVGLengthMode lengthMode) >+ { >+ const UChar* start = ptr; >+ while (ptr < end && *ptr != ',' && !isSVGSpace(*ptr)) >+ ptr++; >+ >+ String string(start, ptr - start); >+ if (string.isEmpty()) >+ return makeUnexpected(ParsingAttributeFailedError); >+ >+ SVGLengthValue value(lengthMode); >+ if (value.setValueAsString(string).hasException()) >+ return makeUnexpected(ParsingAttributeFailedError); >+ >+ return SVGLength::create(value); >+ } >+ > template<typename T> > static ExceptionOr<Ref<SVGLength>> create(ExceptionOr<T>&& value) > { >diff --git a/Source/WebCore/svg/SVGLengthList.h b/Source/WebCore/svg/SVGLengthList.h >index b0147fa234f4d9a88f9fc9f31d5f388973167695..dfe65698589369587d0d9836c2974a5490fbde08 100644 >--- a/Source/WebCore/svg/SVGLengthList.h >+++ b/Source/WebCore/svg/SVGLengthList.h >@@ -52,46 +52,11 @@ public: > > SVGLengthMode lengthMode() const { return m_lengthMode; } > >- bool parse(const String& value) >+ SVGParsingError parse(const String& value) > { >- clearItems(); >- >- auto upconvertedCharacters = StringView(value).upconvertedCharacters(); >- const UChar* ptr = upconvertedCharacters; >- const UChar* end = ptr + value.length(); >- while (ptr < end) { >- const UChar* start = ptr; >- while (ptr < end && *ptr != ',' && !isSVGSpace(*ptr)) >- ptr++; >- if (ptr == start) >- break; >- >- String valueString(start, ptr - start); >- SVGLengthValue value(m_lengthMode); >- if (value.setValueAsString(valueString).hasException()) >- break; >- >- append(SVGLength::create(value)); >- skipOptionalSVGSpacesOrDelimiter(ptr, end); >- } >- >- return ptr == end; >+ return Base::parse(value, m_lengthMode); > } > >- String valueAsString() const override >- { >- StringBuilder builder; >- >- for (const auto& length : m_items) { >- if (builder.length()) >- builder.append(' '); >- >- builder.append(length->value().valueAsString()); >- } >- >- return builder.toString(); >- } >- > private: > SVGLengthList(SVGLengthMode lengthMode) > : m_lengthMode(lengthMode) >diff --git a/Source/WebCore/svg/SVGLengthValue.h b/Source/WebCore/svg/SVGLengthValue.h >index 92661b21e53e700ca1bafee51e1f7c5ac9d6e345..97b55137d248516236b535f49c766261b2b04ba6 100644 >--- a/Source/WebCore/svg/SVGLengthValue.h >+++ b/Source/WebCore/svg/SVGLengthValue.h >@@ -145,17 +145,6 @@ private: > unsigned m_unit; > }; > >-template<> struct SVGPropertyTraits<SVGLengthValue> { >- static SVGLengthValue initialValue() { return { }; } >- static Optional<SVGLengthValue> parse(const QualifiedName& attrName, const String& string) >- { >- SVGLengthValue length; >- length.setValueAsString(string, SVGLengthValue::lengthModeForAnimatedLengthAttribute(attrName)).hasException(); >- return length; >- } >- static String toString(const SVGLengthValue& length) { return length.valueAsString(); } >-}; >- > WTF::TextStream& operator<<(WTF::TextStream&, const SVGLengthValue&); > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGLineElement.h b/Source/WebCore/svg/SVGLineElement.h >index dd029a3d5bed8250248799c94ccc6c781d27a2cf..e1fbea9e250ceb4779beb74f7f3e245d48ba4705 100644 >--- a/Source/WebCore/svg/SVGLineElement.h >+++ b/Source/WebCore/svg/SVGLineElement.h >@@ -29,6 +29,8 @@ namespace WebCore { > > class SVGLineElement final : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGLineElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGLineElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ > public: > static Ref<SVGLineElement> create(const QualifiedName&, Document&); > >@@ -45,9 +47,7 @@ public: > private: > SVGLineElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGLineElement, SVGGeometryElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGLinearGradientElement.h b/Source/WebCore/svg/SVGLinearGradientElement.h >index 04a31dd47c0b219163838af5c5e09a9285c3a26f..8ad1ea9d2499025b533ce6aa069ddeb3694f2148 100644 >--- a/Source/WebCore/svg/SVGLinearGradientElement.h >+++ b/Source/WebCore/svg/SVGLinearGradientElement.h >@@ -30,6 +30,8 @@ struct LinearGradientAttributes; > > class SVGLinearGradientElement final : public SVGGradientElement { > WTF_MAKE_ISO_ALLOCATED(SVGLinearGradientElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGLinearGradientElement, SVGGradientElement>; >+ > public: > static Ref<SVGLinearGradientElement> create(const QualifiedName&, Document&); > >@@ -48,9 +50,7 @@ public: > private: > SVGLinearGradientElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGLinearGradientElement, SVGGradientElement>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGMPathElement.h b/Source/WebCore/svg/SVGMPathElement.h >index d65903ceb83a9bcf6154b78ccaa4a6ba354b3fe6..670e64d9abc3397877794a2ba137fb4e2ad30949 100644 >--- a/Source/WebCore/svg/SVGMPathElement.h >+++ b/Source/WebCore/svg/SVGMPathElement.h >@@ -31,6 +31,8 @@ class SVGPathElement; > > class SVGMPathElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGURIReference { > WTF_MAKE_ISO_ALLOCATED(SVGMPathElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMPathElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >+ > public: > static Ref<SVGMPathElement> create(const QualifiedName&, Document&); > >@@ -43,9 +45,7 @@ public: > private: > SVGMPathElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMPathElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGMarkerElement.h b/Source/WebCore/svg/SVGMarkerElement.h >index f034584403baba263f18bec1c1438c76e8681b50..a63bc5350bf85887154991fab84398b37644798c 100644 >--- a/Source/WebCore/svg/SVGMarkerElement.h >+++ b/Source/WebCore/svg/SVGMarkerElement.h >@@ -30,6 +30,8 @@ namespace WebCore { > > class SVGMarkerElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGFitToViewBox { > WTF_MAKE_ISO_ALLOCATED(SVGMarkerElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMarkerElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; >+ > public: > // Forward declare enumerations in the W3C naming scheme, for IDL generation. > enum { >@@ -71,9 +73,7 @@ public: > private: > SVGMarkerElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMarkerElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > void childrenChanged(const ChildChange&) override; >diff --git a/Source/WebCore/svg/SVGMarkerTypes.h b/Source/WebCore/svg/SVGMarkerTypes.h >index b811d2e9dbcb4d263bbfc3c00c274c372a38e07a..826a0f54485e085044a4697b989193c0b817f8fd 100644 >--- a/Source/WebCore/svg/SVGMarkerTypes.h >+++ b/Source/WebCore/svg/SVGMarkerTypes.h >@@ -26,99 +26,32 @@ > #pragma once > > #include "SVGAngleValue.h" >+#include "SVGEnumType.h" > #include "SVGPropertyTraits.h" > > namespace WebCore { > >-enum SVGMarkerUnitsType { >- SVGMarkerUnitsUnknown = 0, >- SVGMarkerUnitsUserSpaceOnUse, >- SVGMarkerUnitsStrokeWidth >-}; >- >-enum SVGMarkerOrientType { >- SVGMarkerOrientUnknown = 0, >- SVGMarkerOrientAuto, >- SVGMarkerOrientAngle, >- SVGMarkerOrientAutoStartReverse, >- >- // Add new elements before here. >- SVGMarkerOrientMax >-}; >- > template<> >-struct SVGPropertyTraits<SVGMarkerUnitsType> { >- static unsigned highestEnumValue() { return SVGMarkerUnitsStrokeWidth; } >- static String toString(SVGMarkerUnitsType type) >- { >- switch (type) { >- case SVGMarkerUnitsUnknown: >- return emptyString(); >- case SVGMarkerUnitsUserSpaceOnUse: >- return "userSpaceOnUse"_s; >- case SVGMarkerUnitsStrokeWidth: >- return "strokeWidth"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- static SVGMarkerUnitsType fromString(const String& value) >+struct SVGPropertyTraits<std::pair<SVGAngleValue, SVGMarkerOrientType>> { >+ static Expected<std::pair<SVGAngleValue, SVGMarkerOrientType>, SVGParsingError> parse(const String& string) > { >- if (value == "userSpaceOnUse") >- return SVGMarkerUnitsUserSpaceOnUse; >- if (value == "strokeWidth") >- return SVGMarkerUnitsStrokeWidth; >- return SVGMarkerUnitsUnknown; >- } >-}; >+ SVGAngleValue angle; >+ if (string.isEmpty()) >+ return std::make_pair(angle, SVGMarkerOrientAngle); > >-template<> >-struct SVGPropertyTraits<SVGMarkerOrientType> { >- static const String autoString() >- { >- static const NeverDestroyed<String> autoString = MAKE_STATIC_STRING_IMPL("auto"); >- return autoString; >- } >- static const String autoStartReverseString() >- { >- static const NeverDestroyed<String> autoStartReverseString = MAKE_STATIC_STRING_IMPL("auto-start-reverse"); >- return autoStartReverseString; >- } >- static unsigned highestEnumValue() { return SVGMarkerOrientAutoStartReverse; } >- static SVGMarkerOrientType fromString(const String& string) >- { >- if (string == autoString()) >- return SVGMarkerOrientAuto; >- if (string == autoStartReverseString()) >- return SVGMarkerOrientAutoStartReverse; >- return SVGMarkerOrientUnknown; >- } >- static String toString(SVGMarkerOrientType type) >- { >- if (type == SVGMarkerOrientAuto) >- return autoString(); >- if (type == SVGMarkerOrientAutoStartReverse) >- return autoStartReverseString(); >- return emptyString(); >- } >-}; >+ SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>::fromString(string); >+ if (orientType != SVGMarkerOrientUnknown) >+ return std::make_pair(angle, orientType); > >-template<> >-inline unsigned SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue() { return SVGMarkerOrientAngle; } >+ auto result = angle.setValueAsString(string); >+ if (result.hasException()) >+ return makeUnexpected(ParsingAttributeFailedError); > >-template<> >-struct SVGPropertyTraits<std::pair<SVGAngleValue, SVGMarkerOrientType>> { >+ return std::make_pair(angle, SVGMarkerOrientAngle); >+ } > static std::pair<SVGAngleValue, SVGMarkerOrientType> fromString(const String& string) > { >- SVGAngleValue angle; >- SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>::fromString(string); >- if (orientType == SVGMarkerOrientUnknown) { >- auto result = angle.setValueAsString(string); >- if (!result.hasException()) >- orientType = SVGMarkerOrientAngle; >- } >- return std::make_pair(angle, orientType); >+ return parse(string).value_or(std::make_pair<SVGAngleValue, SVGMarkerOrientType>({ }, SVGMarkerOrientUnknown)); > } > }; > >diff --git a/Source/WebCore/svg/SVGMaskElement.h b/Source/WebCore/svg/SVGMaskElement.h >index c5e358dffba9de4d703f6c48207cdf1a36a4c0be..c3162f3854472c9bf1c8d6f0d8a1bd56d4acfd6d 100644 >--- a/Source/WebCore/svg/SVGMaskElement.h >+++ b/Source/WebCore/svg/SVGMaskElement.h >@@ -30,6 +30,8 @@ namespace WebCore { > > class SVGMaskElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGTests { > WTF_MAKE_ISO_ALLOCATED(SVGMaskElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMaskElement, SVGElement, SVGExternalResourcesRequired, SVGTests>; >+ > public: > static Ref<SVGMaskElement> create(const QualifiedName&, Document&); > >@@ -50,9 +52,7 @@ public: > private: > SVGMaskElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMaskElement, SVGElement, SVGExternalResourcesRequired, SVGTests>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > void childrenChanged(const ChildChange&) final; >diff --git a/Source/WebCore/svg/SVGMetadataElement.h b/Source/WebCore/svg/SVGMetadataElement.h >index 6b04112b7fa1437a9a4d30dde6112a75861c2602..db9be7801f329012b5b1215b4d673495cc15634e 100644 >--- a/Source/WebCore/svg/SVGMetadataElement.h >+++ b/Source/WebCore/svg/SVGMetadataElement.h >@@ -26,13 +26,18 @@ namespace WebCore { > > class SVGMetadataElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGMetadataElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMetadataElement, SVGElement>; >+ > public: > static Ref<SVGMetadataElement> create(const QualifiedName&, Document&); > > private: > SVGMetadataElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGMissingGlyphElement.h b/Source/WebCore/svg/SVGMissingGlyphElement.h >index 44b3746a827e5f57ed9555a0ce6fd7ccac5a147a..449d41447d41399796247d393202aa587d2fbc0d 100644 >--- a/Source/WebCore/svg/SVGMissingGlyphElement.h >+++ b/Source/WebCore/svg/SVGMissingGlyphElement.h >@@ -28,13 +28,18 @@ namespace WebCore { > > class SVGMissingGlyphElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGMissingGlyphElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMissingGlyphElement, SVGElement>; >+ > public: > static Ref<SVGMissingGlyphElement> create(const QualifiedName&, Document&); > > private: > SVGMissingGlyphElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGNumber.h b/Source/WebCore/svg/SVGNumber.h >index 23c82e44e677d8d360c96154c795dab8776a1fa4..92f5a1ad8ce4abcfdde7ca4b6e0d7bfd50998f46 100644 >--- a/Source/WebCore/svg/SVGNumber.h >+++ b/Source/WebCore/svg/SVGNumber.h >@@ -45,6 +45,14 @@ public: > return adoptRef(*new SVGNumber(owner, access, value)); > } > >+ static Expected<Ref<SVGNumber>, SVGParsingError> create(const UChar*& ptr, const UChar* end) >+ { >+ float number = 0; >+ if (!parseNumber(ptr, end, number)) >+ return makeUnexpected(ParsingAttributeFailedError); >+ return SVGNumber::create(number); >+ } >+ > template<typename T> > static ExceptionOr<Ref<SVGNumber>> create(ExceptionOr<T>&& value) > { >diff --git a/Source/WebCore/svg/SVGNumberList.h b/Source/WebCore/svg/SVGNumberList.h >index 5b5d57e846f431aaf5c08dbc9a4c34abe84d6d1f..a5e73e1909dbf4614ac07ef31e3ab45272eff31d 100644 >--- a/Source/WebCore/svg/SVGNumberList.h >+++ b/Source/WebCore/svg/SVGNumberList.h >@@ -49,40 +49,6 @@ public: > { > return adoptRef(*new SVGNumberList(other, access)); > } >- >- bool parse(const String& value) >- { >- clearItems(); >- >- float number = 0; >- auto upconvertedCharacters = StringView(value).upconvertedCharacters(); >- const UChar* ptr = upconvertedCharacters; >- const UChar* end = ptr + value.length(); >- >- // The spec (section 4.1) strangely doesn't allow leading whitespace. >- // We might choose to violate that intentionally. >- while (ptr < end) { >- if (!parseNumber(ptr, end, number)) >- break; >- append(SVGNumber::create(number)); >- } >- >- return ptr == end; >- } >- >- String valueAsString() const override >- { >- StringBuilder builder; >- >- for (const auto& number : m_items) { >- if (builder.length()) >- builder.append(' '); >- >- builder.appendFixedPrecisionNumber(number->value()); >- } >- >- return builder.toString(); >- } > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGParsingError.h b/Source/WebCore/svg/SVGParsingError.h >index 1b9a701b9b28996568550ad7b89b373d74363972..54afdbf7c275f42fc85da315bcfd7b9b61f2a88e 100644 >--- a/Source/WebCore/svg/SVGParsingError.h >+++ b/Source/WebCore/svg/SVGParsingError.h >@@ -1,6 +1,6 @@ > /* > * Copyright (C) Research In Motion Limited 2011. All rights reserved. >- * Copyright (C) 2011 Apple, Inc. All rights reserved. >+ * Copyright (C) 2011-2019 Apple, Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,8 +30,40 @@ namespace WebCore { > > enum SVGParsingError { > NoError, >- ParsingAttributeFailedError, >- NegativeValueForbiddenError >+ UnexpectedEndOfAttributeError, >+ ZeroValueForbiddenError, >+ NegativeValueForbiddenError, >+ UnrecognizedEnumValueError, >+ ParsingAttributeFailedError > }; > >+enum SVGParsingOptions { >+ NoOptions = 0, >+ ForbidNegative = 1 << 0, >+ ForbidZero = 1 << 2, >+ ForbidZeroAndNegative = ForbidNegative | ForbidZero, >+ AllowPercentage = 1 << 3 >+}; >+ >+template<typename T> struct SVGNumericParsingValidator; >+ >+template<typename T> >+struct SVGNumericParsingValidator { >+ static constexpr SVGParsingError validate(T t, SVGParsingOptions parsingOptions) >+ { >+ static_assert(std::is_arithmetic<T>::value, "This function can only check the value of a numeric."); >+ if ((parsingOptions & ForbidNegative) && t < 0) >+ return NegativeValueForbiddenError; >+ if ((parsingOptions & ForbidZero) && !t) >+ return ZeroValueForbiddenError; >+ return NoError; >+ } >+}; >+ >+template<typename T> >+constexpr auto validateNumeric(T t, SVGParsingOptions parsingOptions) >+{ >+ return SVGNumericParsingValidator<T>::validate(t, parsingOptions); >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathElement.cpp b/Source/WebCore/svg/SVGPathElement.cpp >index 07fc2a9a33f41875354ec9816776446913a253a8..c21f0b0109848dfd4aa37ddc4e240800da201d9b 100644 >--- a/Source/WebCore/svg/SVGPathElement.cpp >+++ b/Source/WebCore/svg/SVGPathElement.cpp >@@ -109,23 +109,17 @@ void SVGPathElement::removedFromAncestor(RemovalType removalType, ContainerNode& > > float SVGPathElement::getTotalLength() const > { >- float totalLength = 0; >- getTotalLengthOfSVGPathByteStream(pathByteStream(), totalLength); >- return totalLength; >+ return totalLengthOfSVGPathByteStream(pathByteStream()).valueOr(0); > } > > Ref<SVGPoint> SVGPathElement::getPointAtLength(float length) const > { >- FloatPoint point; >- getPointAtLengthOfSVGPathByteStream(pathByteStream(), length, point); >- return SVGPoint::create(point); >+ return SVGPoint::create(pointAtLengthOfSVGPathByteStream(pathByteStream(), length).valueOr(FloatPoint())); > } > > unsigned SVGPathElement::getPathSegAtLength(float length) const > { >- unsigned pathSeg = 0; >- getSVGPathSegAtLengthFromSVGPathByteStream(pathByteStream(), length, pathSeg); >- return pathSeg; >+ return pathSegAtLengthFromSVGPathByteStream(pathByteStream(), length).valueOr(0); > } > > FloatRect SVGPathElement::getBBox(StyleUpdateStrategy styleUpdateStrategy) >diff --git a/Source/WebCore/svg/SVGPathElement.h b/Source/WebCore/svg/SVGPathElement.h >index 6774d0698aa42fb53737de1d895070831358e7a7..f2508cae90dc74cf616d8f1e30ca6b3d555f7d1c 100644 >--- a/Source/WebCore/svg/SVGPathElement.h >+++ b/Source/WebCore/svg/SVGPathElement.h >@@ -35,6 +35,8 @@ class SVGPoint; > > class SVGPathElement final : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGPathElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPathElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ > public: > static Ref<SVGPathElement> create(const QualifiedName&, Document&); > >@@ -108,9 +110,7 @@ public: > private: > SVGPathElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPathElement, SVGGeometryElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGPathUtilities.cpp b/Source/WebCore/svg/SVGPathUtilities.cpp >index db8f929ad19b5be0f7949ba5b5244180fcaa7aa8..5d426eedb027a7126b514fa99f92749e67e0a49b 100644 >--- a/Source/WebCore/svg/SVGPathUtilities.cpp >+++ b/Source/WebCore/svg/SVGPathUtilities.cpp >@@ -193,48 +193,49 @@ bool addToSVGPathByteStream(SVGPathByteStream& streamToAppendTo, const SVGPathBy > return SVGPathBlender::addAnimatedPath(fromSource, bySource, builder, repeatCount); > } > >-bool getSVGPathSegAtLengthFromSVGPathByteStream(const SVGPathByteStream& stream, float length, unsigned& pathSeg) >+Optional<unsigned> pathSegAtLengthFromSVGPathByteStream(const SVGPathByteStream& stream, float length) > { > if (stream.isEmpty()) >- return false; >+ return WTF::nullopt; > > PathTraversalState traversalState(PathTraversalState::Action::SegmentAtLength); > SVGPathTraversalStateBuilder builder(traversalState, length); > > SVGPathByteStreamSource source(stream); >- bool ok = SVGPathParser::parse(source, builder); >- pathSeg = builder.pathSegmentIndex(); >- return ok; >+ if (!SVGPathParser::parse(source, builder)) >+ return WTF::nullopt; >+ >+ return builder.pathSegmentIndex(); > } > >-bool getTotalLengthOfSVGPathByteStream(const SVGPathByteStream& stream, float& totalLength) >+Optional<float> totalLengthOfSVGPathByteStream(const SVGPathByteStream& stream) > { > if (stream.isEmpty()) >- return false; >+ return WTF::nullopt; > > PathTraversalState traversalState(PathTraversalState::Action::TotalLength); >- > SVGPathTraversalStateBuilder builder(traversalState); > > SVGPathByteStreamSource source(stream); >- bool ok = SVGPathParser::parse(source, builder); >- totalLength = builder.totalLength(); >- return ok; >+ if (!SVGPathParser::parse(source, builder)) >+ return WTF::nullopt; >+ >+ return builder.totalLength(); > } > >-bool getPointAtLengthOfSVGPathByteStream(const SVGPathByteStream& stream, float length, FloatPoint& point) >+Optional<FloatPoint> pointAtLengthOfSVGPathByteStream(const SVGPathByteStream& stream, float length) > { > if (stream.isEmpty()) >- return false; >+ return WTF::nullopt; > > PathTraversalState traversalState(PathTraversalState::Action::VectorAtLength); >- > SVGPathTraversalStateBuilder builder(traversalState, length); > > SVGPathByteStreamSource source(stream); >- bool ok = SVGPathParser::parse(source, builder); >- point = builder.currentPoint(); >- return ok; >+ if (!SVGPathParser::parse(source, builder)) >+ return WTF::nullopt; >+ >+ return builder.currentPoint(); > } > > } >diff --git a/Source/WebCore/svg/SVGPathUtilities.h b/Source/WebCore/svg/SVGPathUtilities.h >index 490ff7c660c9d95f9f1e454341f117fa8126d378..11bb53df51bfe8b5f6b89dfa04f44aedbaff5767 100644 >--- a/Source/WebCore/svg/SVGPathUtilities.h >+++ b/Source/WebCore/svg/SVGPathUtilities.h >@@ -53,8 +53,8 @@ bool canBlendSVGPathByteStreams(const SVGPathByteStream& from, const SVGPathByte > bool buildAnimatedSVGPathByteStream(const SVGPathByteStream& from, const SVGPathByteStream& to, SVGPathByteStream& result, float progress); > bool addToSVGPathByteStream(SVGPathByteStream& streamToAppendTo, const SVGPathByteStream& from, unsigned repeatCount = 1); > >-bool getSVGPathSegAtLengthFromSVGPathByteStream(const SVGPathByteStream&, float length, unsigned& pathSeg); >-bool getTotalLengthOfSVGPathByteStream(const SVGPathByteStream&, float& totalLength); >-bool getPointAtLengthOfSVGPathByteStream(const SVGPathByteStream&, float length, FloatPoint&); >+Optional<unsigned> pathSegAtLengthFromSVGPathByteStream(const SVGPathByteStream&, float length); >+Optional<float> totalLengthOfSVGPathByteStream(const SVGPathByteStream&); >+Optional<FloatPoint> pointAtLengthOfSVGPathByteStream(const SVGPathByteStream&, float length); > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPatternElement.h b/Source/WebCore/svg/SVGPatternElement.h >index 36cdefb0b7634db27ddded816608c9c176c1be0f..e92d3151c940b9f5ccb044a2b702115701f341dc 100644 >--- a/Source/WebCore/svg/SVGPatternElement.h >+++ b/Source/WebCore/svg/SVGPatternElement.h >@@ -35,6 +35,8 @@ struct PatternAttributes; > > class SVGPatternElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGFitToViewBox, public SVGTests, public SVGURIReference { > WTF_MAKE_ISO_ALLOCATED(SVGPatternElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPatternElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGTests, SVGURIReference>; >+ > public: > static Ref<SVGPatternElement> create(const QualifiedName&, Document&); > >@@ -61,9 +63,7 @@ public: > private: > SVGPatternElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPatternElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGTests, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > void childrenChanged(const ChildChange&) final; >diff --git a/Source/WebCore/svg/SVGPoint.h b/Source/WebCore/svg/SVGPoint.h >index 77445b9fcb1fb40b51396e192e734586c6354b52..b1faf612c056add573f7205434d54a0e9bcf1391 100644 >--- a/Source/WebCore/svg/SVGPoint.h >+++ b/Source/WebCore/svg/SVGPoint.h >@@ -44,6 +44,19 @@ public: > return adoptRef(*new SVGPoint(value)); > } > >+ static Expected<Ref<SVGPoint>, SVGParsingError> create(const UChar*& ptr, const UChar* end) >+ { >+ float xPos = 0.0f; >+ if (!parseNumber(ptr, end, xPos)) >+ return makeUnexpected(ParsingAttributeFailedError); >+ >+ float yPos = 0.0f; >+ if (!parseNumber(ptr, end, yPos, false)) >+ return makeUnexpected(ParsingAttributeFailedError); >+ >+ return SVGPoint::create({ xPos, yPos }); >+ } >+ > template<typename T> > static ExceptionOr<Ref<SVGPoint>> create(ExceptionOr<T>&& value) > { >@@ -88,7 +101,6 @@ public: > return adoptRef(*new SVGPoint(newPoint)); > } > >-private: > String valueAsString() const override > { > return SVGPropertyTraits<FloatPoint>::toString(m_value); >diff --git a/Source/WebCore/svg/SVGPointList.h b/Source/WebCore/svg/SVGPointList.h >index 8c6c50b0e3bace536ae50ebb28c1b46e15749e81..dbec89bfa8989e4320370e2cc04267b5ce247f3f 100644 >--- a/Source/WebCore/svg/SVGPointList.h >+++ b/Source/WebCore/svg/SVGPointList.h >@@ -49,57 +49,6 @@ public: > { > return adoptRef(*new SVGPointList(other, access)); > } >- >- bool parse(const String& value) >- { >- clearItems(); >- >- auto upconvertedCharacters = StringView(value).upconvertedCharacters(); >- const UChar* cur = upconvertedCharacters; >- const UChar* end = cur + value.length(); >- >- skipOptionalSVGSpaces(cur, end); >- >- bool delimParsed = false; >- while (cur < end) { >- delimParsed = false; >- float xPos = 0.0f; >- if (!parseNumber(cur, end, xPos)) >- return false; >- >- float yPos = 0.0f; >- if (!parseNumber(cur, end, yPos, false)) >- return false; >- >- skipOptionalSVGSpaces(cur, end); >- >- if (cur < end && *cur == ',') { >- delimParsed = true; >- cur++; >- } >- skipOptionalSVGSpaces(cur, end); >- >- append(SVGPoint::create({ xPos, yPos })); >- } >- >- return !delimParsed; >- } >- >- String valueAsString() const override >- { >- StringBuilder builder; >- >- for (const auto& point : m_items) { >- if (builder.length()) >- builder.append(' '); >- >- builder.appendFixedPrecisionNumber(point->x()); >- builder.append(' '); >- builder.appendFixedPrecisionNumber(point->y()); >- } >- >- return builder.toString(); >- } > }; > > } >diff --git a/Source/WebCore/svg/SVGPolyElement.cpp b/Source/WebCore/svg/SVGPolyElement.cpp >index c2fe2eaa897d78b69b095c6dcf350c29f0fcbbb6..c9552c66b46b0eb21060f61adcb83ef5d222a9e7 100644 >--- a/Source/WebCore/svg/SVGPolyElement.cpp >+++ b/Source/WebCore/svg/SVGPolyElement.cpp >@@ -46,7 +46,7 @@ SVGPolyElement::SVGPolyElement(const QualifiedName& tagName, Document& document) > void SVGPolyElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::pointsAttr) { >- if (!m_points->baseVal()->parse(value)) >+ if (m_points->baseVal()->parse(value) != NoError) > document().accessSVGExtensions().reportError("Problem parsing points=\"" + value + "\""); > return; > } >diff --git a/Source/WebCore/svg/SVGPolyElement.h b/Source/WebCore/svg/SVGPolyElement.h >index 67224903ef6310e2bd2b17912189634459d25f2b..f226819c05b6353e54a85455f66b439bd50b3dec 100644 >--- a/Source/WebCore/svg/SVGPolyElement.h >+++ b/Source/WebCore/svg/SVGPolyElement.h >@@ -29,6 +29,8 @@ namespace WebCore { > > class SVGPolyElement : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGPolyElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPolyElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ > public: > const SVGPointList& points() const { return m_points->currentValue(); } > >@@ -41,9 +43,7 @@ protected: > SVGPolyElement(const QualifiedName&, Document&); > > private: >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPolyElement, SVGGeometryElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGPreserveAspectRatioValue.cpp b/Source/WebCore/svg/SVGPreserveAspectRatioValue.cpp >index d0bc716620f7a8a51ec634af7be94bbf5101e755..7e446e2caf056f7318adfa8c92ecd9aa7569f5ef 100644 >--- a/Source/WebCore/svg/SVGPreserveAspectRatioValue.cpp >+++ b/Source/WebCore/svg/SVGPreserveAspectRatioValue.cpp >@@ -58,11 +58,11 @@ ExceptionOr<void> SVGPreserveAspectRatioValue::setMeetOrSlice(unsigned short mee > return { }; > } > >-void SVGPreserveAspectRatioValue::parse(const String& value) >+bool SVGPreserveAspectRatioValue::parse(const String& value) > { > auto upconvertedCharacters = StringView(value).upconvertedCharacters(); > const UChar* begin = upconvertedCharacters; >- parseInternal(begin, begin + value.length(), true); >+ return parseInternal(begin, begin + value.length(), true); > } > > bool SVGPreserveAspectRatioValue::parse(const UChar*& currParam, const UChar* end, bool validate) >diff --git a/Source/WebCore/svg/SVGPreserveAspectRatioValue.h b/Source/WebCore/svg/SVGPreserveAspectRatioValue.h >index 415b8723f8d30864c1b3fd788cc3b989bad7ef9c..f2d6096a336847a060bd96aafe22604d23c8936b 100644 >--- a/Source/WebCore/svg/SVGPreserveAspectRatioValue.h >+++ b/Source/WebCore/svg/SVGPreserveAspectRatioValue.h >@@ -64,7 +64,7 @@ public: > > AffineTransform getCTM(float logicalX, float logicalY, float logicalWidth, float logicalHeight, float physicalWidth, float physicalHeight) const; > >- void parse(const String&); >+ bool parse(const String&); > bool parse(const UChar*& currParam, const UChar* end, bool validate); > > String valueAsString() const; >@@ -76,11 +76,4 @@ private: > bool parseInternal(const UChar*& currParam, const UChar* end, bool validate); > }; > >-template<> struct SVGPropertyTraits<SVGPreserveAspectRatioValue> { >- static SVGPreserveAspectRatioValue initialValue() { return SVGPreserveAspectRatioValue(); } >- static SVGPreserveAspectRatioValue fromString(const String& string) { return SVGPreserveAspectRatioValue(string); } >- static Optional<SVGPreserveAspectRatioValue> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >- static String toString(const SVGPreserveAspectRatioValue& type) { return type.valueAsString(); } >-}; >- > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGRadialGradientElement.h b/Source/WebCore/svg/SVGRadialGradientElement.h >index b88a35a4328af8c6640f22eda614f91ebfe6a597..51bb84cd6f0c12c71ff7307d1ec66b23e83854b9 100644 >--- a/Source/WebCore/svg/SVGRadialGradientElement.h >+++ b/Source/WebCore/svg/SVGRadialGradientElement.h >@@ -30,6 +30,8 @@ struct RadialGradientAttributes; > > class SVGRadialGradientElement final : public SVGGradientElement { > WTF_MAKE_ISO_ALLOCATED(SVGRadialGradientElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGRadialGradientElement, SVGGradientElement>; >+ > public: > static Ref<SVGRadialGradientElement> create(const QualifiedName&, Document&); > >@@ -52,9 +54,7 @@ public: > private: > SVGRadialGradientElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGRadialGradientElement, SVGGradientElement>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGRect.h b/Source/WebCore/svg/SVGRect.h >index 90018e186b192ac3be6f0550df811627fbd7e9f2..42f79375020a31d2773d76c371ad56f50c768f7c 100644 >--- a/Source/WebCore/svg/SVGRect.h >+++ b/Source/WebCore/svg/SVGRect.h >@@ -41,6 +41,11 @@ public: > return adoptRef(*new SVGRect(owner, access, value)); > } > >+ static Ref<SVGRect> create(SVGPropertyOwner* owner, SVGPropertyAccess access, SVGPropertyState state) >+ { >+ return adoptRef(*new SVGRect(owner, access, state)); >+ } >+ > template<typename T> > static ExceptionOr<Ref<SVGRect>> create(ExceptionOr<T>&& value) > { >diff --git a/Source/WebCore/svg/SVGRectElement.h b/Source/WebCore/svg/SVGRectElement.h >index c392e1e2e5c6e497dd7c89f2b3709cbf75776056..80460829817c77d6368cd400d0178db6eee0e333 100644 >--- a/Source/WebCore/svg/SVGRectElement.h >+++ b/Source/WebCore/svg/SVGRectElement.h >@@ -29,6 +29,8 @@ namespace WebCore { > > class SVGRectElement final : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGRectElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGRectElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ > public: > static Ref<SVGRectElement> create(const QualifiedName&, Document&); > >@@ -49,9 +51,7 @@ public: > private: > SVGRectElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGRectElement, SVGGeometryElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGSVGElement.cpp b/Source/WebCore/svg/SVGSVGElement.cpp >index 9bf0342332aeb44dcdb49ba9432b11cbce026baa..b7fc7fd438507195b473c96175b07b18f3d7a899 100644 >--- a/Source/WebCore/svg/SVGSVGElement.cpp >+++ b/Source/WebCore/svg/SVGSVGElement.cpp >@@ -252,12 +252,16 @@ void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString > m_height->setBaseValInternal(length); > } > >- reportAttributeParsingError(parseError, name, value); >- > SVGGraphicsElement::parseAttribute(name, value); > SVGExternalResourcesRequired::parseAttribute(name, value); >- SVGFitToViewBox::parseAttribute(name, value); >- SVGZoomAndPan::parseAttribute(name, value); >+ >+ if (auto error = SVGFitToViewBox::parseAttribute(name, value)) >+ parseError = *error; >+ >+ if (auto error = SVGZoomAndPan::parseAttribute(name, value)) >+ parseError = *error; >+ >+ reportAttributeParsingError(parseError, name, value); > } > > void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) >@@ -651,7 +655,7 @@ bool SVGSVGElement::scrollToFragment(const String& fragmentIdentifier) > if (fragmentIdentifier.startsWith("svgView(")) { > if (!view) > view = ¤tView(); // Create the SVGViewSpec. >- if (view->parseViewSpec(fragmentIdentifier)) >+ if (view->parseViewSpec(fragmentIdentifier) == NoError) > m_useCurrentView = true; > else > view->reset(); >diff --git a/Source/WebCore/svg/SVGSVGElement.h b/Source/WebCore/svg/SVGSVGElement.h >index 960f85ada0afee58accb00c41e0b44fe7b6798e1..69982d4abc9b0a6f5ccf39517cfb24ebfb5539b0 100644 >--- a/Source/WebCore/svg/SVGSVGElement.h >+++ b/Source/WebCore/svg/SVGSVGElement.h >@@ -40,6 +40,8 @@ class SVGViewSpec; > > class SVGSVGElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired, public SVGFitToViewBox, public SVGZoomAndPan { > WTF_MAKE_ISO_ALLOCATED(SVGSVGElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGSVGElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGFitToViewBox>; >+ > public: // DOM > const AtomicString& contentScriptType() const; > void setContentScriptType(const AtomicString&); >@@ -131,11 +133,10 @@ private: > SVGSVGElement(const QualifiedName&, Document&); > virtual ~SVGSVGElement(); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGSVGElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGFitToViewBox>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; >+ > bool selfHasRelativeLengths() const override; > bool isValid() const override; > >diff --git a/Source/WebCore/svg/SVGScriptElement.h b/Source/WebCore/svg/SVGScriptElement.h >index f15f3b7cf6f93af148d5032a10dd2b0167afabaf..0a26ea83c583ce5ecafd92274b9f4dba8b1a5ef3 100644 >--- a/Source/WebCore/svg/SVGScriptElement.h >+++ b/Source/WebCore/svg/SVGScriptElement.h >@@ -31,6 +31,8 @@ namespace WebCore { > > class SVGScriptElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGURIReference, public ScriptElement { > WTF_MAKE_ISO_ALLOCATED(SVGScriptElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGScriptElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >+ > public: > static Ref<SVGScriptElement> create(const QualifiedName&, Document&, bool wasInsertedByParser); > >@@ -40,9 +42,7 @@ public: > private: > SVGScriptElement(const QualifiedName&, Document&, bool wasInsertedByParser, bool alreadyStarted); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGScriptElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGStopElement.h b/Source/WebCore/svg/SVGStopElement.h >index 8104fbbd7f6cfcdb73c60d3703d4ee668741a30a..b8c4c06c4375bf582d17bf323239a78c815ff39b 100644 >--- a/Source/WebCore/svg/SVGStopElement.h >+++ b/Source/WebCore/svg/SVGStopElement.h >@@ -27,6 +27,8 @@ namespace WebCore { > > class SVGStopElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGStopElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGStopElement, SVGElement>; >+ > public: > static Ref<SVGStopElement> create(const QualifiedName&, Document&); > >@@ -38,9 +40,7 @@ public: > private: > SVGStopElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGStopElement, SVGElement>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >diff --git a/Source/WebCore/svg/SVGStringList.h b/Source/WebCore/svg/SVGStringList.h >index d1e01069b12c7e90602af002fe293c40d4b70ec5..350e8a8135701b21b1c16cc4c2632ddcfb8678b0 100644 >--- a/Source/WebCore/svg/SVGStringList.h >+++ b/Source/WebCore/svg/SVGStringList.h >@@ -25,7 +25,6 @@ > > #pragma once > >-#include "SVGParserUtilities.h" > #include "SVGPrimitiveList.h" > #include <wtf/text/StringBuilder.h> > >@@ -42,47 +41,15 @@ public: > return adoptRef(*new SVGStringList(owner)); > } > >- void reset(const String& string) >+ SVGParsingError parse(const String& string) > { >- parse(string, ' '); >+ SVGParsingError error = Base::parse(string); > > // Add empty string, if list is empty. > if (m_items.isEmpty()) > m_items.append(emptyString()); >- } >- >- bool parse(const String& data, UChar delimiter) >- { >- clearItems(); >- >- auto upconvertedCharacters = StringView(data).upconvertedCharacters(); >- const UChar* ptr = upconvertedCharacters; >- const UChar* end = ptr + data.length(); >- while (ptr < end) { >- const UChar* start = ptr; >- while (ptr < end && *ptr != delimiter && !isSVGSpace(*ptr)) >- ptr++; >- if (ptr == start) >- break; >- m_items.append(String(start, ptr - start)); >- skipOptionalSVGSpacesOrDelimiter(ptr, end, delimiter); >- } >- >- return ptr == end; >- } >- >- String valueAsString() const override >- { >- StringBuilder builder; >- >- for (auto string : m_items) { >- if (builder.length()) >- builder.append(' '); >- >- builder.append(string); >- } >- >- return builder.toString(); >+ >+ return error; > } > }; > >diff --git a/Source/WebCore/svg/SVGStyleElement.h b/Source/WebCore/svg/SVGStyleElement.h >index 41a937ed19e849e5403a4174f639034735fe3462..c180e0c5ef81592cfa430940bf8caca38f7de21a 100644 >--- a/Source/WebCore/svg/SVGStyleElement.h >+++ b/Source/WebCore/svg/SVGStyleElement.h >@@ -28,6 +28,8 @@ namespace WebCore { > > class SVGStyleElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGStyleElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGStyleElement, SVGElement>; >+ > public: > static Ref<SVGStyleElement> create(const QualifiedName&, Document&, bool createdByParser); > virtual ~SVGStyleElement(); >@@ -46,6 +48,7 @@ public: > private: > SVGStyleElement(const QualifiedName&, Document&, bool createdByParser); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) final; > void removedFromAncestor(RemovalType, ContainerNode&) final; >@@ -62,6 +65,7 @@ private: > > String title() const final; > >+ PropertyRegistry m_propertyRegistry { *this }; > InlineStyleSheetOwner m_styleSheetOwner; > Timer m_svgLoadEventTimer; > }; >diff --git a/Source/WebCore/svg/SVGSwitchElement.h b/Source/WebCore/svg/SVGSwitchElement.h >index 3d14a4faffa14e741ab996a38281f4270a75e284..8df1d2d0c9b68c24e9f77fcc74df2ab5a32fa2af 100644 >--- a/Source/WebCore/svg/SVGSwitchElement.h >+++ b/Source/WebCore/svg/SVGSwitchElement.h >@@ -28,13 +28,14 @@ namespace WebCore { > > class SVGSwitchElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGSwitchElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGSwitchElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ > public: > static Ref<SVGSwitchElement> create(const QualifiedName&, Document&); > > private: > SVGSwitchElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGSwitchElement, SVGGraphicsElement, SVGExternalResourcesRequired>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > > bool isValid() const final { return SVGTests::isValid(); } >diff --git a/Source/WebCore/svg/SVGSymbolElement.h b/Source/WebCore/svg/SVGSymbolElement.h >index 8c4afdedc9c2bb0ffa2ef0ecf3806d3c3f483b76..e21d50752d0766f4e05f32574a870aabc8f90f86 100644 >--- a/Source/WebCore/svg/SVGSymbolElement.h >+++ b/Source/WebCore/svg/SVGSymbolElement.h >@@ -29,17 +29,18 @@ namespace WebCore { > > class SVGSymbolElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGFitToViewBox { > WTF_MAKE_ISO_ALLOCATED(SVGSymbolElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGSymbolElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; >+ > public: > static Ref<SVGSymbolElement> create(const QualifiedName&, Document&); > > private: > SVGSymbolElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGSymbolElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; >+ > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; > > bool selfHasRelativeLengths() const override; >diff --git a/Source/WebCore/svg/SVGTRefElement.h b/Source/WebCore/svg/SVGTRefElement.h >index 8e816f5469bcec8b9f53080408ae6347a6c0613c..90d0bd229fe5a3f9e65f5c30e3ecfe4c37bae4ba 100644 >--- a/Source/WebCore/svg/SVGTRefElement.h >+++ b/Source/WebCore/svg/SVGTRefElement.h >@@ -30,6 +30,8 @@ class SVGTRefTargetEventListener; > > class SVGTRefElement final : public SVGTextPositioningElement, public SVGURIReference { > WTF_MAKE_ISO_ALLOCATED(SVGTRefElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTRefElement, SVGTextPositioningElement, SVGURIReference>; >+ > public: > static Ref<SVGTRefElement> create(const QualifiedName&, Document&); > >@@ -39,9 +41,7 @@ private: > SVGTRefElement(const QualifiedName&, Document&); > virtual ~SVGTRefElement(); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTRefElement, SVGTextPositioningElement, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGTSpanElement.h b/Source/WebCore/svg/SVGTSpanElement.h >index 5b22ea02c8a45a5262ac02ec49ab887809cff3cd..ea3c1f11cc153e067cd833d51333aecb0a3e4423 100644 >--- a/Source/WebCore/svg/SVGTSpanElement.h >+++ b/Source/WebCore/svg/SVGTSpanElement.h >@@ -26,15 +26,20 @@ namespace WebCore { > > class SVGTSpanElement final : public SVGTextPositioningElement { > WTF_MAKE_ISO_ALLOCATED(SVGTSpanElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTSpanElement, SVGTextPositioningElement>; >+ > public: > static Ref<SVGTSpanElement> create(const QualifiedName&, Document&); > > private: > SVGTSpanElement(const QualifiedName&, Document&); >- >+ >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; > bool childShouldCreateRenderer(const Node&) const override; > bool rendererIsNeeded(const RenderStyle&) override; >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTests.cpp b/Source/WebCore/svg/SVGTests.cpp >index 45523044f84066fe022c03d1595e8f32a9f7c0d5..9bc70019c17348e880e1430eea63425eb6ec40ca 100644 >--- a/Source/WebCore/svg/SVGTests.cpp >+++ b/Source/WebCore/svg/SVGTests.cpp >@@ -150,11 +150,11 @@ bool SVGTests::isValid() const > void SVGTests::parseAttribute(const QualifiedName& attributeName, const AtomicString& value) > { > if (attributeName == requiredFeaturesAttr) >- m_requiredFeatures->reset(value); >+ m_requiredFeatures->parse(value); > if (attributeName == requiredExtensionsAttr) >- m_requiredExtensions->reset(value); >+ m_requiredExtensions->parse(value); > if (attributeName == systemLanguageAttr) >- m_systemLanguage->reset(value); >+ m_systemLanguage->parse(value); > } > > void SVGTests::svgAttributeChanged(const QualifiedName& attrName) >diff --git a/Source/WebCore/svg/SVGTests.h b/Source/WebCore/svg/SVGTests.h >index 449270d9f9d0f897ddff9e7c15cceb080647e174..55bad76d26f02c2383b3a6ef27891e1a43422e9d 100644 >--- a/Source/WebCore/svg/SVGTests.h >+++ b/Source/WebCore/svg/SVGTests.h >@@ -35,11 +35,11 @@ class SVGPropertyOwnerRegistry; > class SVGTests { > WTF_MAKE_NONCOPYABLE(SVGTests); > public: >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTests>; >+ > static bool hasExtension(const String&); > bool isValid() const; > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTests>; >- > void parseAttribute(const QualifiedName&, const AtomicString&); > void svgAttributeChanged(const QualifiedName&); > >diff --git a/Source/WebCore/svg/SVGTextContentElement.h b/Source/WebCore/svg/SVGTextContentElement.h >index 0e6da5c67785cf41657434aa2b95c6fc17e0f0dc..8066c4be4e74abe83ed7efa77de35c3c38d9e3ec 100644 >--- a/Source/WebCore/svg/SVGTextContentElement.h >+++ b/Source/WebCore/svg/SVGTextContentElement.h >@@ -28,43 +28,11 @@ namespace WebCore { > > struct DOMPointInit; > >-enum SVGLengthAdjustType { >- SVGLengthAdjustUnknown, >- SVGLengthAdjustSpacing, >- SVGLengthAdjustSpacingAndGlyphs >-}; >- >-template<> struct SVGPropertyTraits<SVGLengthAdjustType> { >- static unsigned highestEnumValue() { return SVGLengthAdjustSpacingAndGlyphs; } >- >- static String toString(SVGLengthAdjustType type) >- { >- switch (type) { >- case SVGLengthAdjustUnknown: >- return emptyString(); >- case SVGLengthAdjustSpacing: >- return "spacing"_s; >- case SVGLengthAdjustSpacingAndGlyphs: >- return "spacingAndGlyphs"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static SVGLengthAdjustType fromString(const String& value) >- { >- if (value == "spacingAndGlyphs") >- return SVGLengthAdjustSpacingAndGlyphs; >- if (value == "spacing") >- return SVGLengthAdjustSpacing; >- return SVGLengthAdjustUnknown; >- } >-}; >- > class SVGTextContentElement : public SVGGraphicsElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGTextContentElement); > public: >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTextContentElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ > enum { > LENGTHADJUST_UNKNOWN = SVGLengthAdjustUnknown, > LENGTHADJUST_SPACING = SVGLengthAdjustSpacing, >@@ -83,8 +51,6 @@ public: > > static SVGTextContentElement* elementFromRenderer(RenderObject*); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTextContentElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >- > const SVGLengthValue& specifiedTextLength() const { return m_specifiedTextLength; } > const SVGLengthValue& textLength() const { return m_textLength->currentValue(); } > SVGLengthAdjustType lengthAdjust() const { return m_lengthAdjust->currentValue<SVGLengthAdjustType>(); } >diff --git a/Source/WebCore/svg/SVGTextElement.h b/Source/WebCore/svg/SVGTextElement.h >index aa9445d92b6fb4a515916115ef1ad3d855c643d2..8354ca993a0676179551f9e244d153b59c8ce5ff 100644 >--- a/Source/WebCore/svg/SVGTextElement.h >+++ b/Source/WebCore/svg/SVGTextElement.h >@@ -26,6 +26,8 @@ namespace WebCore { > > class SVGTextElement final : public SVGTextPositioningElement { > WTF_MAKE_ISO_ALLOCATED(SVGTextElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTextElement, SVGTextPositioningElement>; >+ > public: > static Ref<SVGTextElement> create(const QualifiedName&, Document&); > >@@ -34,8 +36,11 @@ public: > private: > SVGTextElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; > bool childShouldCreateRenderer(const Node&) const override; >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTextPathElement.h b/Source/WebCore/svg/SVGTextPathElement.h >index 435387bfaf57be437f9da25eba5697c77fba7c9d..805f5bcb021cb67cd505d6b40d6e565d4e4fcd67 100644 >--- a/Source/WebCore/svg/SVGTextPathElement.h >+++ b/Source/WebCore/svg/SVGTextPathElement.h >@@ -26,78 +26,10 @@ > > namespace WebCore { > >-enum SVGTextPathMethodType { >- SVGTextPathMethodUnknown = 0, >- SVGTextPathMethodAlign, >- SVGTextPathMethodStretch >-}; >- >-enum SVGTextPathSpacingType { >- SVGTextPathSpacingUnknown = 0, >- SVGTextPathSpacingAuto, >- SVGTextPathSpacingExact >-}; >- >-template<> >-struct SVGPropertyTraits<SVGTextPathMethodType> { >- static unsigned highestEnumValue() { return SVGTextPathMethodStretch; } >- >- static String toString(SVGTextPathMethodType type) >- { >- switch (type) { >- case SVGTextPathMethodUnknown: >- return emptyString(); >- case SVGTextPathMethodAlign: >- return "align"_s; >- case SVGTextPathMethodStretch: >- return "stretch"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static SVGTextPathMethodType fromString(const String& value) >- { >- if (value == "align") >- return SVGTextPathMethodAlign; >- if (value == "stretch") >- return SVGTextPathMethodStretch; >- return SVGTextPathMethodUnknown; >- } >-}; >- >-template<> >-struct SVGPropertyTraits<SVGTextPathSpacingType> { >- static unsigned highestEnumValue() { return SVGTextPathSpacingExact; } >- >- static String toString(SVGTextPathSpacingType type) >- { >- switch (type) { >- case SVGTextPathSpacingUnknown: >- return emptyString(); >- case SVGTextPathSpacingAuto: >- return "auto"_s; >- case SVGTextPathSpacingExact: >- return "exact"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static SVGTextPathSpacingType fromString(const String& value) >- { >- if (value == "auto") >- return SVGTextPathSpacingAuto; >- if (value == "exact") >- return SVGTextPathSpacingExact; >- return SVGTextPathSpacingUnknown; >- } >-}; >- > class SVGTextPathElement final : public SVGTextContentElement, public SVGURIReference { > WTF_MAKE_ISO_ALLOCATED(SVGTextPathElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTextPathElement, SVGTextContentElement, SVGURIReference>; >+ > public: > // Forward declare enumerations in the W3C naming scheme, for IDL generation. > enum { >@@ -126,9 +58,7 @@ private: > SVGTextPathElement(const QualifiedName&, Document&); > virtual ~SVGTextPathElement(); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTextPathElement, SVGTextContentElement, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGTextPositioningElement.h b/Source/WebCore/svg/SVGTextPositioningElement.h >index a4862ec4762965997430fa84d68d9719b34765ba..61c7db16214f6e59374dbb8253f72af5deaf62fc 100644 >--- a/Source/WebCore/svg/SVGTextPositioningElement.h >+++ b/Source/WebCore/svg/SVGTextPositioningElement.h >@@ -27,11 +27,12 @@ namespace WebCore { > > class SVGTextPositioningElement : public SVGTextContentElement { > WTF_MAKE_ISO_ALLOCATED(SVGTextPositioningElement); >-public: >- static SVGTextPositioningElement* elementFromRenderer(RenderBoxModelObject&); > >+public: > using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTextPositioningElement, SVGTextContentElement>; > >+ static SVGTextPositioningElement* elementFromRenderer(RenderBoxModelObject&); >+ > const SVGLengthList& x() const { return m_x->currentValue(); } > const SVGLengthList& y() const { return m_y->currentValue(); } > const SVGLengthList& dx() const { return m_dx->currentValue(); } >@@ -54,9 +55,6 @@ private: > bool isPresentationAttribute(const QualifiedName&) const final; > void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final; > >- const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } >- >- PropertyRegistry m_propertyRegistry { *this }; > Ref<SVGAnimatedLengthList> m_x { SVGAnimatedLengthList::create(this, LengthModeWidth) }; > Ref<SVGAnimatedLengthList> m_y { SVGAnimatedLengthList::create(this, LengthModeHeight) }; > Ref<SVGAnimatedLengthList> m_dx { SVGAnimatedLengthList::create(this, LengthModeWidth) }; >diff --git a/Source/WebCore/svg/SVGTitleElement.h b/Source/WebCore/svg/SVGTitleElement.h >index 3f533356707d3e854c44307c340cb8b107c43e8d..9afe40694ca8d9cb1f5cc9abfea77a5009bb661e 100644 >--- a/Source/WebCore/svg/SVGTitleElement.h >+++ b/Source/WebCore/svg/SVGTitleElement.h >@@ -27,17 +27,22 @@ namespace WebCore { > > class SVGTitleElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGTitleElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTitleElement, SVGElement>; >+ > public: > static Ref<SVGTitleElement> create(const QualifiedName&, Document&); > > private: > SVGTitleElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >+ bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ > InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) final; > void removedFromAncestor(RemovalType, ContainerNode&) final; > void childrenChanged(const ChildChange&) final; > >- bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTransform.h b/Source/WebCore/svg/SVGTransform.h >index 6a29c72cf3e7f313f709657a4012481c223b8dcd..77b899614fbce38919d73b52bf981ee3f6a8d7e0 100644 >--- a/Source/WebCore/svg/SVGTransform.h >+++ b/Source/WebCore/svg/SVGTransform.h >@@ -27,6 +27,7 @@ > > #include "SVGMatrix.h" > #include "SVGTransformValue.h" >+#include "SVGTransformable.h" > #include "SVGValueProperty.h" > > namespace WebCore { >@@ -48,6 +49,19 @@ public: > return adoptRef(*new SVGTransform(value.type(), value.matrix()->value(), value.angle(), value.rotationCenter())); > } > >+ static Expected<Ref<SVGTransform>, SVGParsingError> create(const UChar*& ptr, const UChar* end) >+ { >+ SVGTransformValue::SVGTransformType type = SVGTransformValue::SVG_TRANSFORM_UNKNOWN; >+ if (!SVGTransformable::parseAndSkipType(ptr, end, type)) >+ return makeUnexpected(ParsingAttributeFailedError); >+ >+ Ref<SVGTransform> transform = SVGTransform::create(type); >+ if (!SVGTransformable::parseTransformValue(type, ptr, end, transform->value())) >+ return makeUnexpected(ParsingAttributeFailedError); >+ >+ return transform; >+ } >+ > template<typename T> > static ExceptionOr<Ref<SVGTransform>> create(ExceptionOr<T>&& value) > { >@@ -130,6 +144,11 @@ public: > return { }; > } > >+ String valueAsString() const override >+ { >+ return m_value.valueAsString(); >+ } >+ > private: > using Base = SVGValueProperty<SVGTransformValue>; > >@@ -147,11 +166,6 @@ private: > owner()->commitPropertyChange(this); > m_value.matrixDidChange(); > } >- >- String valueAsString() const override >- { >- return m_value.valueAsString(); >- } > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTransformList.h b/Source/WebCore/svg/SVGTransformList.h >index 544d60b2e635c1c209934ee435cf4125e6a71f2b..7754b71fb4e961b2e7f06cf71610eb35f4c10240 100644 >--- a/Source/WebCore/svg/SVGTransformList.h >+++ b/Source/WebCore/svg/SVGTransformList.h >@@ -22,13 +22,11 @@ > #pragma once > > #include "SVGTransform.h" >-#include "SVGTransformable.h" > #include "SVGValuePropertyList.h" > > namespace WebCore { > > class SVGTransformList final : public SVGValuePropertyList<SVGTransform> { >- friend class SVGViewSpec; > using Base = SVGValuePropertyList<SVGTransform>; > using Base::Base; > >@@ -75,16 +73,6 @@ public: > return makeRefPtr(item.get()); > } > >- void parse(const String& value) >- { >- clearItems(); >- >- auto upconvertedCharacters = StringView(value).upconvertedCharacters(); >- const UChar* start = upconvertedCharacters; >- if (!parse(start, start + value.length())) >- clearItems(); >- } >- > AffineTransform concatenate() const > { > AffineTransform result; >@@ -93,44 +81,13 @@ public: > return result; > } > >- String valueAsString() const override >+ SVGParsingError parse(const String& string) > { >- StringBuilder builder; >- for (const auto& transfrom : m_items) { >- if (builder.length()) >- builder.append(' '); >- >- builder.append(transfrom->value().valueAsString()); >- } >- return builder.toString(); >- } >- >-private: >- bool parse(const UChar*& start, const UChar* end) >- { >- bool delimParsed = false; >- while (start < end) { >- delimParsed = false; >- SVGTransformValue::SVGTransformType type = SVGTransformValue::SVG_TRANSFORM_UNKNOWN; >- skipOptionalSVGSpaces(start, end); >- >- if (!SVGTransformable::parseAndSkipType(start, end, type)) >- return false; >- >- Ref<SVGTransform> transform = SVGTransform::create(type); >- if (!SVGTransformable::parseTransformValue(type, start, end, transform->value())) >- return false; >- >- append(WTFMove(transform)); >- skipOptionalSVGSpaces(start, end); >- if (start < end && *start == ',') { >- delimParsed = true; >- ++start; >- } >- >- skipOptionalSVGSpaces(start, end); >+ if (auto error = Base::parse(string)) { >+ clearItems(); >+ return error; > } >- return !delimParsed; >+ return NoError; > } > }; > >diff --git a/Source/WebCore/svg/SVGURIReference.h b/Source/WebCore/svg/SVGURIReference.h >index 201b6c71bed7139a9c6e2ed00d62b2df41f6d750..0f98840da27840b62950966972d3a743ddc99508 100644 >--- a/Source/WebCore/svg/SVGURIReference.h >+++ b/Source/WebCore/svg/SVGURIReference.h >@@ -32,7 +32,7 @@ class SVGElement; > class SVGURIReference { > WTF_MAKE_NONCOPYABLE(SVGURIReference); > public: >- virtual ~SVGURIReference() = default; >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGURIReference>; > > void parseAttribute(const QualifiedName&, const AtomicString&); > >@@ -56,13 +56,12 @@ public: > return !equalIgnoringFragmentIdentifier(url, document.url()); > } > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGURIReference>; >- > String href() const { return m_href->currentValue(); } > SVGAnimatedString& hrefAnimated() { return m_href; } > > protected: > SVGURIReference(SVGElement* contextElement); >+ virtual ~SVGURIReference() = default; > > static bool isKnownAttribute(const QualifiedName& attributeName); > >diff --git a/Source/WebCore/svg/SVGUnitTypes.h b/Source/WebCore/svg/SVGUnitTypes.h >index f44485f7e05df2453faabe69b0c2882fec5004be..4a989c9dc9ba9ef906cb24ddf5312922646b268b 100644 >--- a/Source/WebCore/svg/SVGUnitTypes.h >+++ b/Source/WebCore/svg/SVGUnitTypes.h >@@ -19,7 +19,6 @@ > > #pragma once > >-#include "SVGPropertyTraits.h" > #include <wtf/RefCounted.h> > > namespace WebCore { >@@ -31,38 +30,8 @@ public: > SVG_UNIT_TYPE_USERSPACEONUSE = 1, > SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2 > }; >- > private: >- SVGUnitTypes() { } >-}; >- >-template<> >-struct SVGPropertyTraits<SVGUnitTypes::SVGUnitType> { >- static unsigned highestEnumValue() { return SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX; } >- >- static String toString(SVGUnitTypes::SVGUnitType type) >- { >- switch (type) { >- case SVGUnitTypes::SVG_UNIT_TYPE_UNKNOWN: >- return emptyString(); >- case SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE: >- return "userSpaceOnUse"_s; >- case SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: >- return "objectBoundingBox"_s; >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >- } >- >- static SVGUnitTypes::SVGUnitType fromString(const String& value) >- { >- if (value == "userSpaceOnUse") >- return SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE; >- if (value == "objectBoundingBox") >- return SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX; >- return SVGUnitTypes::SVG_UNIT_TYPE_UNKNOWN; >- } >+ SVGUnitTypes() = default; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGUnknownElement.h b/Source/WebCore/svg/SVGUnknownElement.h >index a15c7af9787ad21f2ca7c3293c8200682e1babed..964452cc80ab1d8e5f35ff77f7393328a2dce7d1 100644 >--- a/Source/WebCore/svg/SVGUnknownElement.h >+++ b/Source/WebCore/svg/SVGUnknownElement.h >@@ -37,6 +37,8 @@ namespace WebCore { > // false to make sure we don't attempt to render such elements. > class SVGUnknownElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGUnknownElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGUnknownElement, SVGElement>; >+ > public: > static Ref<SVGUnknownElement> create(const QualifiedName& tagName, Document& document) > { >@@ -49,7 +51,10 @@ private: > { > } > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGUseElement.h b/Source/WebCore/svg/SVGUseElement.h >index 039081d166eada7b5200b604b70e39c4feaa1bdb..9c3963346f6fe690e665b8347b24e6fc64eb4e93 100644 >--- a/Source/WebCore/svg/SVGUseElement.h >+++ b/Source/WebCore/svg/SVGUseElement.h >@@ -34,6 +34,8 @@ class SVGGElement; > > class SVGUseElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired, public SVGURIReference, private CachedSVGDocumentClient { > WTF_MAKE_ISO_ALLOCATED(SVGUseElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGUseElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; >+ > public: > static Ref<SVGUseElement> create(const QualifiedName&, Document&); > virtual ~SVGUseElement(); >@@ -63,9 +65,7 @@ private: > void removedFromAncestor(RemovalType, ContainerNode&) override; > void buildPendingResource() override; > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGUseElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >diff --git a/Source/WebCore/svg/SVGVKernElement.h b/Source/WebCore/svg/SVGVKernElement.h >index 78c8d5501896d16cec707b526ae1d7d02ac0dfa6..1ec072c0c3cd36380ae5ccebd21f8bf135f4fdbe 100644 >--- a/Source/WebCore/svg/SVGVKernElement.h >+++ b/Source/WebCore/svg/SVGVKernElement.h >@@ -28,6 +28,8 @@ namespace WebCore { > > class SVGVKernElement final : public SVGElement { > WTF_MAKE_ISO_ALLOCATED(SVGVKernElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGVKernElement, SVGElement>; >+ > public: > static Ref<SVGVKernElement> create(const QualifiedName&, Document&); > >@@ -36,7 +38,10 @@ public: > private: > SVGVKernElement(const QualifiedName&, Document&); > >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > bool rendererIsNeeded(const RenderStyle&) final { return false; } >+ >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGViewElement.cpp b/Source/WebCore/svg/SVGViewElement.cpp >index 3396c6e98236b64e8695ff0419e80269577b473a..0aec3276ec4adc0b21a62f74fb5379a85397bb2a 100644 >--- a/Source/WebCore/svg/SVGViewElement.cpp >+++ b/Source/WebCore/svg/SVGViewElement.cpp >@@ -51,7 +51,7 @@ Ref<SVGViewElement> SVGViewElement::create(const QualifiedName& tagName, Documen > void SVGViewElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::viewTargetAttr) { >- m_viewTarget->reset(value); >+ m_viewTarget->parse(value); > return; > } > >diff --git a/Source/WebCore/svg/SVGViewElement.h b/Source/WebCore/svg/SVGViewElement.h >index b0eef19d7c495051878a8815ae462da95084e07c..75d182f4d8528d4de5f9eee42b623e5057ec4350 100644 >--- a/Source/WebCore/svg/SVGViewElement.h >+++ b/Source/WebCore/svg/SVGViewElement.h >@@ -31,6 +31,8 @@ namespace WebCore { > > class SVGViewElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGFitToViewBox, public SVGZoomAndPan { > WTF_MAKE_ISO_ALLOCATED(SVGViewElement); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGViewElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; >+ > public: > static Ref<SVGViewElement> create(const QualifiedName&, Document&); > >@@ -42,9 +44,7 @@ public: > private: > SVGViewElement(const QualifiedName&, Document&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGViewElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >- > // FIXME(webkit.org/b/196554): svgAttributeChanged missing. > void parseAttribute(const QualifiedName&, const AtomicString&) final; > >diff --git a/Source/WebCore/svg/SVGViewSpec.cpp b/Source/WebCore/svg/SVGViewSpec.cpp >index 8f423516b5bdbc5287cda44adf49fc618ddc32ec..78b89c5980c1bf964d9e1daf791a81ccf2bb03a3 100644 >--- a/Source/WebCore/svg/SVGViewSpec.cpp >+++ b/Source/WebCore/svg/SVGViewSpec.cpp >@@ -23,11 +23,8 @@ > > #include "Document.h" > #include "SVGElement.h" >-#include "SVGFitToViewBox.h" > #include "SVGNames.h" >-#include "SVGParserUtilities.h" > #include "SVGTransformList.h" >-#include "SVGTransformable.h" > > namespace WebCore { > >@@ -60,99 +57,104 @@ void SVGViewSpec::reset() > SVGZoomAndPan::reset(); > } > >-static const UChar svgViewSpec[] = {'s', 'v', 'g', 'V', 'i', 'e', 'w'}; >-static const UChar viewBoxSpec[] = {'v', 'i', 'e', 'w', 'B', 'o', 'x'}; >-static const UChar preserveAspectRatioSpec[] = {'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'A', 's', 'p', 'e', 'c', 't', 'R', 'a', 't', 'i', 'o'}; >-static const UChar transformSpec[] = {'t', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm'}; >-static const UChar zoomAndPanSpec[] = {'z', 'o', 'o', 'm', 'A', 'n', 'd', 'P', 'a', 'n'}; >-static const UChar viewTargetSpec[] = {'v', 'i', 'e', 'w', 'T', 'a', 'r', 'g', 'e', 't'}; >+static Optional<Vector<std::pair<String, String>>> parseNamesValues(const String& string) >+{ >+ Vector<std::pair<String, String>> result; >+ >+ for (size_t position = 0; position < string.length(); ) { >+ size_t start = position; >+ >+ // Find of the end of the attributue name. >+ position = string.find('(', start); >+ if (position == notFound) >+ return WTF::nullopt; >+ >+ // Extract the name and stip the white spaces. >+ String name = string.substring(start, position - start).stripWhiteSpace(); >+ >+ // Keep track of opend left parentheses but store the postions of the closed ones >+ Vector<size_t> leftParentheses { position }; >+ Vector<std::pair<size_t, size_t>> parentheses; >+ start = position++; >+ >+ while (position < string.length() && !leftParentheses.isEmpty()) { >+ if (string[position] == '(') >+ leftParentheses.append(position); >+ else if (string[position] == ')') >+ parentheses.append(std::make_pair(leftParentheses.takeLast(), position)); >+ ++position; >+ } >+ >+ // Unbalanced parentheses. >+ if (!leftParentheses.isEmpty()) >+ return WTF::nullopt; > >-bool SVGViewSpec::parseViewSpec(const String& viewSpec) >+ size_t end = position; >+ >+ // Remove unnecessary parentheses. >+ for (; !parentheses.isEmpty(); ++start, --end) { >+ auto pair = parentheses.takeLast(); >+ if (pair.first != start || pair.second != end -1) >+ break; >+ } >+ >+ // Extract the value and stip the white spaces. >+ String value = string.substring(start, end - start).stripWhiteSpace(); >+ result.append(std::make_pair(name, value)); >+ >+ // Skip the semicolon if it separates the attributes. >+ if (position < string.length() && string[position] == ';') >+ ++position; >+ } >+ >+ return result; >+} >+ >+SVGParsingError SVGViewSpec::parseAttribute(const QualifiedName& name, const AtomicString& value) >+{ >+ if (name == SVGNames::transformAttr) >+ return m_transform->parse(value); >+ >+ if (auto error = SVGFitToViewBox::parseAttribute(name, value)) >+ return *error; >+ >+ if (auto error = SVGZoomAndPan::parseAttribute(name, value)) >+ return *error; >+ >+ return ParsingAttributeFailedError; >+} >+ >+SVGParsingError SVGViewSpec::parseViewSpec(const String& viewSpec) > { >- auto upconvertedCharacters = StringView(viewSpec).upconvertedCharacters(); >- const UChar* currViewSpec = upconvertedCharacters; >- const UChar* end = currViewSpec + viewSpec.length(); >- >- if (currViewSpec >= end || !m_contextElement) >- return false; >- >- if (!skipString(currViewSpec, end, svgViewSpec, WTF_ARRAY_LENGTH(svgViewSpec))) >- return false; >- >- if (currViewSpec >= end || *currViewSpec != '(') >- return false; >- currViewSpec++; >- >- while (currViewSpec < end && *currViewSpec != ')') { >- if (*currViewSpec == 'v') { >- if (skipString(currViewSpec, end, viewBoxSpec, WTF_ARRAY_LENGTH(viewBoxSpec))) { >- if (currViewSpec >= end || *currViewSpec != '(') >- return false; >- currViewSpec++; >- FloatRect viewBox; >- if (!SVGFitToViewBox::parseViewBox(currViewSpec, end, viewBox, false)) >- return false; >- setViewBox(viewBox); >- if (currViewSpec >= end || *currViewSpec != ')') >- return false; >- currViewSpec++; >- } else if (skipString(currViewSpec, end, viewTargetSpec, WTF_ARRAY_LENGTH(viewTargetSpec))) { >- if (currViewSpec >= end || *currViewSpec != '(') >- return false; >- const UChar* viewTargetStart = ++currViewSpec; >- while (currViewSpec < end && *currViewSpec != ')') >- currViewSpec++; >- if (currViewSpec >= end) >- return false; >- m_viewTargetString = String(viewTargetStart, currViewSpec - viewTargetStart); >- currViewSpec++; >- } else >- return false; >- } else if (*currViewSpec == 'z') { >- if (!skipString(currViewSpec, end, zoomAndPanSpec, WTF_ARRAY_LENGTH(zoomAndPanSpec))) >- return false; >- if (currViewSpec >= end || *currViewSpec != '(') >- return false; >- currViewSpec++; >- if (!SVGZoomAndPan::parseZoomAndPan(currViewSpec, end)) >- return false; >- if (currViewSpec >= end || *currViewSpec != ')') >- return false; >- currViewSpec++; >- } else if (*currViewSpec == 'p') { >- if (!skipString(currViewSpec, end, preserveAspectRatioSpec, WTF_ARRAY_LENGTH(preserveAspectRatioSpec))) >- return false; >- if (currViewSpec >= end || *currViewSpec != '(') >- return false; >- currViewSpec++; >- SVGPreserveAspectRatioValue preserveAspectRatio; >- if (!preserveAspectRatio.parse(currViewSpec, end, false)) >- return false; >- setPreserveAspectRatio(preserveAspectRatio); >- if (currViewSpec >= end || *currViewSpec != ')') >- return false; >- currViewSpec++; >- } else if (*currViewSpec == 't') { >- if (!skipString(currViewSpec, end, transformSpec, WTF_ARRAY_LENGTH(transformSpec))) >- return false; >- if (currViewSpec >= end || *currViewSpec != '(') >- return false; >- currViewSpec++; >- m_transform->parse(currViewSpec, end); >- if (currViewSpec >= end || *currViewSpec != ')') >- return false; >- currViewSpec++; >- } else >- return false; >- >- if (currViewSpec < end && *currViewSpec == ';') >- currViewSpec++; >+ auto result = parseNamesValues(viewSpec); >+ if (!result || result->size() != 1 || (*result)[0].first != "svgView") >+ return ParsingAttributeFailedError; >+ >+ auto namesValues = parseNamesValues((*result)[0].second); >+ if (!namesValues || namesValues->isEmpty()) >+ return ParsingAttributeFailedError; >+ >+ StringBuilder transfrom; >+ for (auto& nameValue : *namesValues) { >+ QualifiedName name(emptyAtom(), nameValue.first, emptyAtom()); >+ if (name.matches(SVGNames::viewTargetAttr)) { >+ // viewTarget can't be an empty string. >+ if (nameValue.second.isEmpty()) >+ return UnexpectedEndOfAttributeError; >+ m_viewTargetString = nameValue.second; >+ } else if (name.matches(SVGNames::transformAttr)) { >+ // transform can exist multiple times. Collect values and parse at the end. >+ if (transfrom.length()) >+ transfrom.append(' '); >+ transfrom.append(nameValue.second); >+ } else if (auto error = parseAttribute(name, nameValue.second)) >+ return error; > } >- >- if (currViewSpec >= end || *currViewSpec != ')') >- return false; > >- return true; >+ if (transfrom.length()) >+ return parseAttribute(SVGNames::transformAttr, transfrom.toString()); >+ >+ return NoError; > } > > } >diff --git a/Source/WebCore/svg/SVGViewSpec.h b/Source/WebCore/svg/SVGViewSpec.h >index 2e7ef9786c1a886fd25acfea037fc850d79de520..6f88c0caf929d417a032cf553299f1e6c6a09610 100644 >--- a/Source/WebCore/svg/SVGViewSpec.h >+++ b/Source/WebCore/svg/SVGViewSpec.h >@@ -30,13 +30,15 @@ class SVGElement; > class SVGTransformList; > > class SVGViewSpec final : public RefCounted<SVGViewSpec>, public SVGFitToViewBox, public SVGZoomAndPan { >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGViewSpec, SVGFitToViewBox>; >+ > public: > static Ref<SVGViewSpec> create(SVGElement& contextElement) > { > return adoptRef(*new SVGViewSpec(contextElement)); > } > >- bool parseViewSpec(const String&); >+ SVGParsingError parseViewSpec(const String&); > void reset(); > void resetContextElement() { m_contextElement = nullptr; } > >@@ -51,7 +53,7 @@ public: > private: > explicit SVGViewSpec(SVGElement&); > >- using PropertyRegistry = SVGPropertyOwnerRegistry<SVGViewSpec, SVGFitToViewBox>; >+ SVGParsingError parseAttribute(const QualifiedName&, const AtomicString&); > > WeakPtr<SVGElement> m_contextElement; > String m_viewTargetString; >diff --git a/Source/WebCore/svg/SVGZoomAndPan.cpp b/Source/WebCore/svg/SVGZoomAndPan.cpp >index 14d8fcb77ea5801d65109f453da250362311276d..9a0e02313e89866c7bdfbcad63c2a04fa307c049 100644 >--- a/Source/WebCore/svg/SVGZoomAndPan.cpp >+++ b/Source/WebCore/svg/SVGZoomAndPan.cpp >@@ -24,28 +24,17 @@ > > namespace WebCore { > >-bool SVGZoomAndPan::parseZoomAndPan(const UChar*& start, const UChar* end) >+Optional<SVGParsingError> SVGZoomAndPan::parseAttribute(const QualifiedName& name, const AtomicString& value) > { >- static const UChar disable[] = { 'd', 'i', 's', 'a', 'b', 'l', 'e' }; >- if (skipString(start, end, disable, WTF_ARRAY_LENGTH(disable))) { >- m_zoomAndPan = SVGZoomAndPanDisable; >- return true; >- } >+ if (!name.matches(SVGNames::zoomAndPanAttr)) >+ return WTF::nullopt; > >- static const UChar magnify[] = { 'm', 'a', 'g', 'n', 'i', 'f', 'y' }; >- if (skipString(start, end, magnify, WTF_ARRAY_LENGTH(magnify))) { >- m_zoomAndPan = SVGZoomAndPanMagnify; >- return true; >- } >- >- return false; >-} >- >-void SVGZoomAndPan::parseAttribute(const QualifiedName& attributeName, const AtomicString& value) >-{ >- if (attributeName != SVGNames::zoomAndPanAttr) >- return; >- m_zoomAndPan = SVGPropertyTraits<SVGZoomAndPanType>::fromString(value); >+ auto expectedZoomAndPan = SVGPropertyTraits<SVGZoomAndPanType>::parse(value); >+ if (!expectedZoomAndPan) >+ return expectedZoomAndPan.error(); >+ >+ m_zoomAndPan = *expectedZoomAndPan; >+ return NoError; > } > > } >diff --git a/Source/WebCore/svg/SVGZoomAndPan.h b/Source/WebCore/svg/SVGZoomAndPan.h >index 9fbcfb09ac3ad016b8fe2d292dab23562a5254a7..90638f9108bc95ba69067e7a7e25b0c898da6c1d 100644 >--- a/Source/WebCore/svg/SVGZoomAndPan.h >+++ b/Source/WebCore/svg/SVGZoomAndPan.h >@@ -23,8 +23,8 @@ > > #include "ExceptionOr.h" > #include "QualifiedName.h" >+#include "SVGEnumType.h" > #include "SVGNames.h" >-#include "SVGZoomAndPanType.h" > > namespace WebCore { > >@@ -41,17 +41,15 @@ public: > SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; } > void setZoomAndPan(SVGZoomAndPanType zoomAndPan) { m_zoomAndPan = zoomAndPan; } > ExceptionOr<void> setZoomAndPan(unsigned) { return Exception { NoModificationAllowedError }; } >- void reset() { m_zoomAndPan = SVGPropertyTraits<SVGZoomAndPanType>::initialValue(); } >+ void reset() { m_zoomAndPan = SVGZoomAndPanMagnify; } > >- void parseAttribute(const QualifiedName&, const AtomicString&); >+ Optional<SVGParsingError> parseAttribute(const QualifiedName&, const AtomicString&); > > protected: > SVGZoomAndPan() = default; > >- bool parseZoomAndPan(const UChar*&, const UChar*); >- > private: >- SVGZoomAndPanType m_zoomAndPan { SVGPropertyTraits<SVGZoomAndPanType>::initialValue() }; >+ SVGZoomAndPanType m_zoomAndPan { SVGZoomAndPanMagnify }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGZoomAndPanType.h b/Source/WebCore/svg/SVGZoomAndPanType.h >deleted file mode 100644 >index 120fa93f63766d327015ae61916970e5c86af66a..0000000000000000000000000000000000000000 >--- a/Source/WebCore/svg/SVGZoomAndPanType.h >+++ /dev/null >@@ -1,52 +0,0 @@ >-/* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#include "SVGPropertyTraits.h" >- >-namespace WebCore { >- >-enum SVGZoomAndPanType { >- SVGZoomAndPanUnknown, >- SVGZoomAndPanDisable, >- SVGZoomAndPanMagnify >-}; >- >-template<> >-struct SVGPropertyTraits<SVGZoomAndPanType> { >- static SVGZoomAndPanType initialValue() { return SVGZoomAndPanMagnify; } >- static String toString(SVGZoomAndPanType) { return emptyString(); } >- static SVGZoomAndPanType fromString(const String& value) >- { >- if (value == "disable") >- return SVGZoomAndPanDisable; >- if (value == "magnify") >- return SVGZoomAndPanMagnify; >- return SVGZoomAndPanUnknown; >- } >-}; >- >-} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedDecoratedProperty.h b/Source/WebCore/svg/properties/SVGAnimatedDecoratedProperty.h >index e5efaaea7111bc6c957d972d74548de92d8a133e..badfb9ea4ff00816758bc1494ffd332ff36c646c 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedDecoratedProperty.h >+++ b/Source/WebCore/svg/properties/SVGAnimatedDecoratedProperty.h >@@ -97,8 +97,8 @@ public: > } > > // Managing the relationship with the owner. >- void setDirty() override { m_state = SVGPropertyState::Dirty; } >- bool isDirty() const override { return m_state == SVGPropertyState::Dirty; } >+ SVGPropertyState state() const override { return m_state; } >+ void setState(SVGPropertyState state) override { m_state = state; } > Optional<String> synchronize() override > { > if (m_state == SVGPropertyState::Clean) >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h b/Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h >index c425619200df0485671bc7319eb57f6d3ca8ad8d..a02ea27a54b5d6674a4ab231d4d67b98c6380649 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h >+++ b/Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h >@@ -87,8 +87,8 @@ public: > } > > // Managing the relationship with the owner. >- void setDirty() override { m_state = SVGPropertyState::Dirty; } >- bool isDirty() const override { return m_state == SVGPropertyState::Dirty; } >+ SVGPropertyState state() const override { return m_state; } >+ void setState(SVGPropertyState state) override { m_state = state; } > Optional<String> synchronize() override > { > if (m_state == SVGPropertyState::Clean) >diff --git a/Source/WebCore/svg/properties/SVGAnimatedProperty.h b/Source/WebCore/svg/properties/SVGAnimatedProperty.h >index c6f932e6df69ccefafc965e32cd56620a1fc3364..8a9e9138d0e6e55bc594e46637ab8fe18bfe240d 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedProperty.h >+++ b/Source/WebCore/svg/properties/SVGAnimatedProperty.h >@@ -45,10 +45,10 @@ public: > > virtual String baseValAsString() const { return emptyString(); } > virtual String animValAsString() const { return emptyString(); } >- >+ > // Control the synchronization between the attribute and its reflection in baseVal. >- virtual bool isDirty() const { return false; } >- virtual void setDirty() { } >+ virtual SVGPropertyState state() const { return SVGPropertyState::Clean; } >+ virtual void setState(SVGPropertyState) { } > virtual Optional<String> synchronize() { return WTF::nullopt; } > > // Control the animation life cycle. >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyList.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyList.h >index f4255d7f6e75b14aca88a880bff36e656383f716..077c837df864c04025bcd3bfd4ee843a4229828c 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedPropertyList.h >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyList.h >@@ -68,8 +68,8 @@ public: > } > > // Managing the relationship with the owner. >- void setDirty() override { m_baseVal->setDirty(); } >- bool isDirty() const override { return m_baseVal->isDirty(); } >+ SVGPropertyState state() const override { return m_baseVal->state(); } >+ void setState(SVGPropertyState state) override { m_baseVal->setState(state); } > Optional<String> synchronize() override { return m_baseVal->synchronize(); } > > // Used by RenderSVGElements and DumpRenderTree. >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h >index d47e4ae5579006d25ba094595b3f6716e1758e74..297f0efc4cdb8ee85c0010d41d29c7a615fe0c7e 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h >@@ -48,8 +48,8 @@ public: > private: > Optional<String> synchronize(const OwnerType& owner) const final > { >- bool dirty1 = property1(owner)->isDirty(); >- bool dirty2 = property2(owner)->isDirty(); >+ bool dirty1 = property1(owner)->state() == SVGPropertyState::Dirty; >+ bool dirty2 = property2(owner)->state() == SVGPropertyState::Dirty; > if (!(dirty1 || dirty2)) > return WTF::nullopt; > >@@ -85,8 +85,8 @@ public: > private: > Optional<String> synchronize(const OwnerType& owner) const final > { >- bool dirty1 = property1(owner)->isDirty(); >- bool dirty2 = property2(owner)->isDirty(); >+ bool dirty1 = property1(owner)->state() == SVGPropertyState::Dirty; >+ bool dirty2 = property2(owner)->state() == SVGPropertyState::Dirty; > if (!(dirty1 || dirty2)) > return WTF::nullopt; > >@@ -120,8 +120,8 @@ public: > private: > Optional<String> synchronize(const OwnerType& owner) const final > { >- bool dirty1 = property1(owner)->isDirty(); >- bool dirty2 = property2(owner)->isDirty(); >+ bool dirty1 = property1(owner)->state() == SVGPropertyState::Dirty; >+ bool dirty2 = property2(owner)->state() == SVGPropertyState::Dirty; > if (!(dirty1 || dirty2)) > return WTF::nullopt; > >diff --git a/Source/WebCore/svg/properties/SVGAnimatedValueProperty.h b/Source/WebCore/svg/properties/SVGAnimatedValueProperty.h >index dfdb171a0cb83fc7596059e7604a7fd89351f525..6127340c47cda94fa8e980d59b2ba4a900b423aa 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedValueProperty.h >+++ b/Source/WebCore/svg/properties/SVGAnimatedValueProperty.h >@@ -84,8 +84,8 @@ public: > } > > // Managing the relationship with the owner. >- void setDirty() override { m_baseVal->setDirty(); } >- bool isDirty() const override { return m_baseVal->isDirty(); } >+ SVGPropertyState state() const override { return m_baseVal->state(); } >+ void setState(SVGPropertyState state) override { m_baseVal->setState(state); } > Optional<String> synchronize() override { return m_baseVal->synchronize(); } > > // Used by RenderSVGElements and DumpRenderTree. >@@ -142,6 +142,12 @@ protected: > { > } > >+ SVGAnimatedValueProperty(SVGElement* contextElement, SVGPropertyAccess access, SVGPropertyState state) >+ : SVGAnimatedProperty(contextElement) >+ , m_baseVal(PropertyType::create(this, access, state)) >+ { >+ } >+ > RefPtr<PropertyType>& ensureAnimVal() > { > if (!m_animVal) >diff --git a/Source/WebCore/svg/properties/SVGDecoratedEnumeration.h b/Source/WebCore/svg/properties/SVGDecoratedEnumeration.h >index 264c36b69074ccf3e2e29d267721cf5374570311..106bcde455bc748f52d62cb631cd3c42cfadb748 100644 >--- a/Source/WebCore/svg/properties/SVGDecoratedEnumeration.h >+++ b/Source/WebCore/svg/properties/SVGDecoratedEnumeration.h >@@ -26,6 +26,7 @@ > #pragma once > > #include "SVGDecoratedPrimitive.h" >+#include "SVGEnumTraits.h" > > namespace WebCore { > >@@ -45,7 +46,7 @@ public: > private: > bool setValue(const DecorationType& value) override > { >- if (!value || value > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue()) >+ if (!SVGPropertyTraits<EnumType>::isValidEnum(value)) > return false; > Base::setValueInternal(value); > return true; >@@ -53,7 +54,7 @@ private: > > DecorationType value() const override > { >- if (Base::value() > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue()) >+ if (!SVGPropertyTraits<EnumType>::isValidEnum(Base::value())) > return m_outOfRangeEnumValue; > return Base::value(); > } >diff --git a/Source/WebCore/svg/properties/SVGDecoratedPrimitive.h b/Source/WebCore/svg/properties/SVGDecoratedPrimitive.h >index e2a5243124f073f85ad8dd6a96df4a65350b67c8..fd243a17d2b6f32055aa69e26120479dd889a950 100644 >--- a/Source/WebCore/svg/properties/SVGDecoratedPrimitive.h >+++ b/Source/WebCore/svg/properties/SVGDecoratedPrimitive.h >@@ -26,6 +26,7 @@ > #pragma once > > #include "SVGDecoratedProperty.h" >+#include "SVGEnumTypeTraits.h" > > namespace WebCore { > >diff --git a/Source/WebCore/svg/properties/SVGEnumTraits.h b/Source/WebCore/svg/properties/SVGEnumTraits.h >new file mode 100644 >index 0000000000000000000000000000000000000000..9cb346491996b4b03a0ff8881979876b02206b49 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGEnumTraits.h >@@ -0,0 +1,75 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGParsingError.h" >+#include "SVGPropertyTraits.h" >+#include <wtf/Expected.h> >+#include <wtf/Vector.h> >+ >+namespace WebCore { >+ >+template<typename> struct SVGEnumTraits; >+ >+template<typename EnumType> using SVGEnumValue = std::pair<EnumType, String>; >+ >+template<typename EnumType> using SVGEnumValues = Vector<SVGEnumValue<EnumType>>; >+ >+template<typename EnumType> >+struct SVGPropertyTraits<EnumType, std::enable_if_t<std::is_enum<EnumType>::value>> { >+ template<typename T> >+ static constexpr bool isValidEnum(T t) >+ { >+ static_assert(sizeof(T) >= std::underlying_type_t<EnumType>(), "Integral type must be at least the size of the underlying enum type"); >+ >+ if (t > static_cast<T>(SVGEnumTraits<EnumType>::highestExposedEnumValue())) >+ return false; >+ return SVGEnumTraits<EnumType>::values().findMatching([&](auto& item) { >+ return static_cast<T>(item.first) == t; >+ }) != notFound; >+ } >+ >+ static constexpr Expected<EnumType, SVGParsingError> parse(const String& string) >+ { >+ auto find = SVGEnumTraits<EnumType>::values().findMatching([&](auto& item) { >+ return item.second == string; >+ }); >+ if (find != notFound) >+ return SVGEnumTraits<EnumType>::values()[find].first; >+ return makeUnexpected(UnrecognizedEnumValueError); >+ } >+ static constexpr EnumType fromString(const String& string) { return parse(string).value_or(0); } >+ >+ static String toString(EnumType value) >+ { >+ auto find = SVGEnumTraits<EnumType>::values().findMatching([&](auto& item) { >+ return item.first == value; >+ }); >+ return find != notFound ? SVGEnumTraits<EnumType>::values()[find].second : emptyString(); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGEnumType.h b/Source/WebCore/svg/properties/SVGEnumType.h >new file mode 100644 >index 0000000000000000000000000000000000000000..e6187a38774755db188096e4d854450a1a2ee4dd >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGEnumType.h >@@ -0,0 +1,80 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+namespace WebCore { >+ >+enum SVGLengthAdjustType { >+ SVGLengthAdjustUnknown, >+ SVGLengthAdjustSpacing, >+ SVGLengthAdjustSpacingAndGlyphs >+}; >+ >+enum SVGMarkerUnitsType { >+ SVGMarkerUnitsUnknown = 0, >+ SVGMarkerUnitsUserSpaceOnUse, >+ SVGMarkerUnitsStrokeWidth >+}; >+ >+enum SVGMarkerOrientType { >+ SVGMarkerOrientUnknown = 0, >+ SVGMarkerOrientAuto, >+ SVGMarkerOrientAngle, >+ SVGMarkerOrientAutoStartReverse >+}; >+ >+enum SVGSpreadMethodType { >+ SVGSpreadMethodUnknown = 0, >+ SVGSpreadMethodPad, >+ SVGSpreadMethodReflect, >+ SVGSpreadMethodRepeat >+}; >+ >+enum SVGStitchOptions { >+ SVGStitchTypeUnknown = 0, >+ SVGStitchTypeStitch, >+ SVGStitchTypeNoStitch >+}; >+ >+enum SVGTextPathMethodType { >+ SVGTextPathMethodUnknown = 0, >+ SVGTextPathMethodAlign, >+ SVGTextPathMethodStretch >+}; >+ >+enum SVGTextPathSpacingType { >+ SVGTextPathSpacingUnknown = 0, >+ SVGTextPathSpacingAuto, >+ SVGTextPathSpacingExact >+}; >+ >+enum SVGZoomAndPanType { >+ SVGZoomAndPanUnknown = 0, >+ SVGZoomAndPanDisable, >+ SVGZoomAndPanMagnify >+}; >+ >+}; >diff --git a/Source/WebCore/svg/properties/SVGEnumTypeTraits.h b/Source/WebCore/svg/properties/SVGEnumTypeTraits.h >new file mode 100644 >index 0000000000000000000000000000000000000000..315f9556fa00f17e9081c2202322c7ca5f22e3a9 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGEnumTypeTraits.h >@@ -0,0 +1,274 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "FEColorMatrix.h" >+#include "FEComponentTransfer.h" >+#include "FEComposite.h" >+#include "FEConvolveMatrix.h" >+#include "FEDisplacementMap.h" >+#include "FEMorphology.h" >+#include "FETurbulence.h" >+#include "SVGEnumTraits.h" >+#include "SVGEnumType.h" >+#include "SVGUnitTypes.h" >+ >+namespace WebCore { >+ >+template<> struct SVGEnumTraits<BlendMode> { >+ static const SVGEnumValues<BlendMode>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<BlendMode>> values(std::initializer_list<SVGEnumValue<BlendMode>> { >+ { BlendMode::Normal, "normal"_s }, >+ { BlendMode::Multiply, "multiply"_s }, >+ { BlendMode::Screen, "screen"_s }, >+ { BlendMode::Darken, "darken"_s }, >+ { BlendMode::Lighten, "lighten"_s }, >+ { BlendMode::Overlay, "overlay"_s }, >+ { BlendMode::ColorDodge, "color-dodge"_s }, >+ { BlendMode::ColorBurn, "color-burn"_s }, >+ { BlendMode::HardLight, "hard-light"_s }, >+ { BlendMode::SoftLight, "soft-light"_s }, >+ { BlendMode::Difference, "difference"_s }, >+ { BlendMode::Exclusion, "exclusion"_s }, >+ { BlendMode::Hue, "hue"_s }, >+ { BlendMode::Saturation, "saturation"_s }, >+ { BlendMode::Color, "color"_s }, >+ { BlendMode::Luminosity, "luminosity"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return BlendMode::Luminosity; } >+}; >+ >+template<> struct SVGEnumTraits<ChannelSelectorType> { >+ static const SVGEnumValues<ChannelSelectorType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<ChannelSelectorType>> values(std::initializer_list<SVGEnumValue<ChannelSelectorType>> { >+ { CHANNEL_R, "R"_s }, >+ { CHANNEL_G, "G"_s }, >+ { CHANNEL_B, "B"_s }, >+ { CHANNEL_A, "A"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return CHANNEL_A; } >+}; >+ >+template<> struct SVGEnumTraits<ComponentTransferType> { >+ static const SVGEnumValues<ComponentTransferType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<ComponentTransferType>> values(std::initializer_list<SVGEnumValue<ComponentTransferType>> { >+ { FECOMPONENTTRANSFER_TYPE_IDENTITY, "identity"_s }, >+ { FECOMPONENTTRANSFER_TYPE_TABLE, "table"_s }, >+ { FECOMPONENTTRANSFER_TYPE_DISCRETE, "discrete"_s }, >+ { FECOMPONENTTRANSFER_TYPE_LINEAR, "linear"_s }, >+ { FECOMPONENTTRANSFER_TYPE_GAMMA, "gamma"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return FECOMPONENTTRANSFER_TYPE_GAMMA; } >+}; >+ >+template<> struct SVGEnumTraits<ColorMatrixType> { >+ static const SVGEnumValues<ColorMatrixType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<ColorMatrixType>> values(std::initializer_list<SVGEnumValue<ColorMatrixType>> { >+ { FECOLORMATRIX_TYPE_MATRIX, "matrix"_s }, >+ { FECOLORMATRIX_TYPE_SATURATE, "saturate"_s }, >+ { FECOLORMATRIX_TYPE_HUEROTATE, "hueRotate"_s }, >+ { FECOLORMATRIX_TYPE_LUMINANCETOALPHA, "luminanceToAlpha"_s }, >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return FECOLORMATRIX_TYPE_LUMINANCETOALPHA; } >+}; >+ >+template<> struct SVGEnumTraits<CompositeOperationType> { >+ static const SVGEnumValues<CompositeOperationType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<CompositeOperationType>> values(std::initializer_list<SVGEnumValue<CompositeOperationType>> { >+ { FECOMPOSITE_OPERATOR_OVER, "over"_s }, >+ { FECOMPOSITE_OPERATOR_IN, "in"_s }, >+ { FECOMPOSITE_OPERATOR_OUT, "out"_s }, >+ { FECOMPOSITE_OPERATOR_ATOP, "atop"_s }, >+ { FECOMPOSITE_OPERATOR_XOR, "xor"_s }, >+ { FECOMPOSITE_OPERATOR_ARITHMETIC, "arithmetic"_s }, >+ { FECOMPOSITE_OPERATOR_LIGHTER, "lighter"_s }, >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return FECOMPOSITE_OPERATOR_ARITHMETIC; } >+}; >+ >+template<> struct SVGEnumTraits<EdgeModeType> { >+ static const SVGEnumValues<EdgeModeType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<EdgeModeType>> values(std::initializer_list<SVGEnumValue<EdgeModeType>> { >+ { EDGEMODE_DUPLICATE, "duplicate"_s }, >+ { EDGEMODE_WRAP, "wrap"_s }, >+ { EDGEMODE_NONE, "none"_s }, >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return EDGEMODE_NONE; } >+}; >+ >+template<> struct SVGEnumTraits<MorphologyOperatorType> { >+ static const SVGEnumValues<MorphologyOperatorType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<MorphologyOperatorType>> values(std::initializer_list<SVGEnumValue<MorphologyOperatorType>> { >+ { FEMORPHOLOGY_OPERATOR_ERODE, "erode"_s }, >+ { FEMORPHOLOGY_OPERATOR_DILATE, "dilate"_s }, >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return FEMORPHOLOGY_OPERATOR_DILATE; } >+}; >+ >+template<> struct SVGEnumTraits<TurbulenceType> { >+ static const SVGEnumValues<TurbulenceType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<TurbulenceType>> values(std::initializer_list<SVGEnumValue<TurbulenceType>> { >+ { TurbulenceType::FractalNoise, "fractalNoise"_s }, >+ { TurbulenceType::Turbulence, "turbulence"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return TurbulenceType::Turbulence; } >+}; >+ >+template<> struct SVGEnumTraits<SVGLengthAdjustType> { >+ static const SVGEnumValues<SVGLengthAdjustType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<SVGLengthAdjustType>> values(std::initializer_list<SVGEnumValue<SVGLengthAdjustType>> { >+ { SVGLengthAdjustSpacing, "spacing"_s }, >+ { SVGLengthAdjustSpacingAndGlyphs, "spacingAndGlyphs"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return SVGLengthAdjustSpacingAndGlyphs; } >+}; >+ >+template<> struct SVGEnumTraits<SVGMarkerUnitsType> { >+ static const SVGEnumValues<SVGMarkerUnitsType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<SVGMarkerUnitsType>> values(std::initializer_list<SVGEnumValue<SVGMarkerUnitsType>> { >+ { SVGMarkerUnitsUserSpaceOnUse, "userSpaceOnUse"_s }, >+ { SVGMarkerUnitsStrokeWidth, "strokeWidth"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return SVGMarkerUnitsStrokeWidth; } >+}; >+ >+template<> struct SVGEnumTraits<SVGMarkerOrientType> { >+ static const SVGEnumValues<SVGMarkerOrientType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<SVGMarkerOrientType>> values(std::initializer_list<SVGEnumValue<SVGMarkerOrientType>> { >+ { SVGMarkerOrientAuto, "auto"_s }, >+ { SVGMarkerOrientAngle, emptyString() }, >+ { SVGMarkerOrientAutoStartReverse, "auto-start-reverse"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return SVGMarkerOrientAngle; } >+}; >+ >+template<> struct SVGEnumTraits<SVGSpreadMethodType> { >+ static const SVGEnumValues<SVGSpreadMethodType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<SVGSpreadMethodType>> values(std::initializer_list<SVGEnumValue<SVGSpreadMethodType>> { >+ { SVGSpreadMethodPad, "pad"_s }, >+ { SVGSpreadMethodReflect, "reflect"_s }, >+ { SVGSpreadMethodRepeat, "repeat"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return SVGSpreadMethodRepeat; } >+}; >+ >+template<> struct SVGEnumTraits<SVGStitchOptions> { >+ static const SVGEnumValues<SVGStitchOptions>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<SVGStitchOptions>> values(std::initializer_list<SVGEnumValue<SVGStitchOptions>> { >+ { SVGStitchTypeStitch, "stitch"_s }, >+ { SVGStitchTypeNoStitch, "noStitch"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return SVGStitchTypeNoStitch; } >+}; >+ >+template<> struct SVGEnumTraits<SVGTextPathMethodType> { >+ static const SVGEnumValues<SVGTextPathMethodType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<SVGTextPathMethodType>> values(std::initializer_list<SVGEnumValue<SVGTextPathMethodType>> { >+ { SVGTextPathMethodAlign, "align"_s }, >+ { SVGTextPathMethodStretch, "stretch"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return SVGTextPathMethodStretch; } >+}; >+ >+template<> struct SVGEnumTraits<SVGTextPathSpacingType> { >+ static const SVGEnumValues<SVGTextPathSpacingType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<SVGTextPathSpacingType>> values(std::initializer_list<SVGEnumValue<SVGTextPathSpacingType>> { >+ { SVGTextPathSpacingAuto, "auto"_s }, >+ { SVGTextPathSpacingExact, "exact"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return SVGTextPathSpacingExact; } >+}; >+ >+template<> struct SVGEnumTraits<SVGUnitTypes::SVGUnitType> { >+ static const SVGEnumValues<SVGUnitTypes::SVGUnitType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<SVGUnitTypes::SVGUnitType>> values(std::initializer_list<SVGEnumValue<SVGUnitTypes::SVGUnitType>> { >+ { SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE, "userSpaceOnUse"_s }, >+ { SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX, "objectBoundingBox"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX; } >+}; >+ >+template<> struct SVGEnumTraits<SVGZoomAndPanType> { >+ static const SVGEnumValues<SVGZoomAndPanType>& values() >+ { >+ static NeverDestroyed<SVGEnumValues<SVGZoomAndPanType>> values(std::initializer_list<SVGEnumValue<SVGZoomAndPanType>> { >+ { SVGZoomAndPanDisable, "disable"_s }, >+ { SVGZoomAndPanMagnify, "magnify"_s } >+ }); >+ return values; >+ } >+ static constexpr auto highestExposedEnumValue() { return SVGZoomAndPanMagnify; } >+}; >+ >+}; >diff --git a/Source/WebCore/svg/properties/SVGPrimitiveList.h b/Source/WebCore/svg/properties/SVGPrimitiveList.h >index 45731a3803167dde136b31ae351a980e7ec72659..a04ff3d34c469c4bd11a6e67305ac3b6d0ec1ec2 100644 >--- a/Source/WebCore/svg/properties/SVGPrimitiveList.h >+++ b/Source/WebCore/svg/properties/SVGPrimitiveList.h >@@ -26,15 +26,50 @@ > #pragma once > > #include "SVGList.h" >+#include "SVGParserUtilities.h" >+#include "SVGParsingError.h" >+#include "SVGPropertyTraits.h" > > namespace WebCore { > > template<typename PropertyType> > class SVGPrimitiveList : public SVGList<PropertyType> { >-protected: > using Base = SVGList<PropertyType>; > using Base::Base; >+ using Base::clearItems; > using Base::size; >+ >+public: >+ SVGParsingError parse(const String& string) >+ { >+ clearItems(); >+ >+ auto upconvertedCharacters = StringView(string).upconvertedCharacters(); >+ const UChar* ptr = upconvertedCharacters; >+ const UChar* end = ptr + string.length(); >+ >+ bool delimParsed = false; >+ while (skipOptionalSVGSpaces(ptr, end)) { >+ delimParsed = false; >+ >+ ASSERT(ptr < end); >+ const UChar* start = ptr; >+ while (ptr < end && !isSVGSpace(*ptr)) >+ ptr++; >+ >+ ASSERT(ptr > start); >+ append(SVGPropertyTraits<PropertyType>::fromString(String(start, ptr - start))); >+ >+ if (ptr < end && *ptr == ',') { >+ ++ptr; >+ delimParsed = true; >+ } >+ } >+ >+ return delimParsed ? UnexpectedEndOfAttributeError : NoError; >+ } >+ >+protected: > using Base::m_items; > > PropertyType at(unsigned index) const override >@@ -70,6 +105,19 @@ protected: > m_items.append(WTFMove(newItem)); > return at(size() - 1); > } >+ >+ String valueAsString() const override >+ { >+ StringBuilder builder; >+ >+ for (auto item : m_items) { >+ if (builder.length()) >+ builder.append(' '); >+ builder.append(SVGPropertyTraits<PropertyType>::toString(item)); >+ } >+ >+ return builder.toString(); >+ } > }; > > } >diff --git a/Source/WebCore/svg/properties/SVGProperty.h b/Source/WebCore/svg/properties/SVGProperty.h >index ce65cb110d1fb466e229ec79c9dd017e86129967..c701eff0987e49ba314aa7e4f942707233a7f308 100644 >--- a/Source/WebCore/svg/properties/SVGProperty.h >+++ b/Source/WebCore/svg/properties/SVGProperty.h >@@ -28,7 +28,7 @@ > namespace WebCore { > > enum class SVGPropertyAccess : uint8_t { ReadWrite, ReadOnly }; >-enum class SVGPropertyState : uint8_t { Clean, Dirty }; >+enum class SVGPropertyState : uint8_t { Clean, Dirty, Invalid }; > > class SVGProperty : public RefCounted<SVGProperty> { > public: >@@ -70,11 +70,11 @@ public: > bool isReadOnly() const { return m_access == SVGPropertyAccess::ReadOnly; } > > // Synchronizing the SVG attribute and its reflection here. >- bool isDirty() const { return m_state == SVGPropertyState::Dirty; } >- void setDirty() { m_state = SVGPropertyState::Dirty; } >+ SVGPropertyState state() const { return m_state; } >+ void setState(SVGPropertyState state) { m_state = state; } > Optional<String> synchronize() > { >- if (m_state == SVGPropertyState::Clean) >+ if (m_state != SVGPropertyState::Dirty) > return WTF::nullopt; > m_state = SVGPropertyState::Clean; > return valueAsString(); >@@ -88,9 +88,10 @@ public: > #if !COMPILER(MSVC) > protected: > #endif >- SVGProperty(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite) >+ SVGProperty(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite, SVGPropertyState state = SVGPropertyState::Clean) > : m_owner(owner) > , m_access(access) >+ , m_state(state) > { > } > >diff --git a/Source/WebCore/svg/properties/SVGPropertyTraits.h b/Source/WebCore/svg/properties/SVGPropertyTraits.h >index bb83e77d364ddd541c3d1cd4b19d4b3238b89c12..9eadd9e312996e1a43067a6b9693884f4ecf1762 100644 >--- a/Source/WebCore/svg/properties/SVGPropertyTraits.h >+++ b/Source/WebCore/svg/properties/SVGPropertyTraits.h >@@ -1,7 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) Research In Motion Limited 2010. All rights reserved. >- * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -25,124 +25,97 @@ > #include "Color.h" > #include "FloatPoint.h" > #include "FloatRect.h" >-#include "QualifiedName.h" > #include "SVGParserUtilities.h" >+#include "SVGParsingError.h" >+#include <wtf/Expected.h> > #include <wtf/text/StringBuilder.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { > >-template<typename PropertyType> >+template<typename PropertyType, class Enabler = void> > struct SVGPropertyTraits { }; > > template<> > struct SVGPropertyTraits<bool> { > static bool initialValue() { return false; } >- static bool fromString(const String& string) { return string == "true"; } >- static Optional<bool> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >- static String toString(bool type) { return type ? "true" : "false"; } >+ static Expected<bool, SVGParsingError> parse(const String& string) >+ { >+ if (string == "true") >+ return true; >+ if (string == "false") >+ return false; >+ return makeUnexpected(ParsingAttributeFailedError); >+ } >+ static bool fromString(const String& string) { return parse(string).value_or(initialValue()); } >+ static String toString(bool value) { return value ? "true" : "false"; } > }; > > template<> > struct SVGPropertyTraits<Color> { > static Color initialValue() { return Color(); } >- static Color fromString(const String& string) { return CSSParser::parseColor(string.stripWhiteSpace()); } >- static Optional<Color> parse(const QualifiedName&, const String& string) >+ static Expected<Color, SVGParsingError> parse(const String& string) > { >- Color color = CSSParser::parseColor(string.stripWhiteSpace()); >- if (!color.isValid()) >- return WTF::nullopt; >- return color; >+ Color value = CSSParser::parseColor(string.stripWhiteSpace()); >+ if (!value.isValid()) >+ return makeUnexpected(ParsingAttributeFailedError); >+ return value; > } >- static String toString(const Color& type) { return type.serialized(); } >-}; >- >-template<> >-struct SVGPropertyTraits<unsigned> { >- static unsigned initialValue() { return 0; } >- static Optional<unsigned> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >- static String toString(unsigned type) { return String::number(type); } >-}; >- >-template<> >-struct SVGPropertyTraits<int> { >- static int initialValue() { return 0; } >- static int fromString(const String&string) { return string.toIntStrict(); } >- static Optional<int> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >- static String toString(int type) { return String::number(type); } >+ static Color fromString(const String& string) { return parse(string).value_or(initialValue()); } >+ static String toString(const Color& value) { return value.serialized(); } > }; > > template<> >-struct SVGPropertyTraits<std::pair<int, int>> { >- static std::pair<int, int> initialValue() { return { }; } >- static std::pair<int, int> fromString(const String& string) >- { >- float firstNumber = 0, secondNumber = 0; >- if (!parseNumberOptionalNumber(string, firstNumber, secondNumber)) >- return { }; >- return std::make_pair(static_cast<int>(roundf(firstNumber)), static_cast<int>(roundf(secondNumber))); >- } >- static Optional<std::pair<int, int>> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >- static String toString(std::pair<int, int>) { ASSERT_NOT_REACHED(); return emptyString(); } >+struct SVGPropertyTraits<String> { >+ static String initialValue() { return String(); } >+ static Expected<String, SVGParsingError> parse(const String& string) { return string; } >+ static String fromString(const String& string) { return string; } >+ static String toString(const String& value) { return value; } > }; > > template<> > struct SVGPropertyTraits<float> { > static float initialValue() { return 0; } >- static float fromString(const String& string) >+ static Expected<float, SVGParsingError> parse(const String& string, SVGParsingOptions parsingOptions = NoOptions) > { >- float number = 0; >- if (!parseNumberFromString(string, number)) >- return 0; >- return number; >+ float value; >+ if ((parsingOptions & AllowPercentage) && string.endsWith('%')) >+ value = string.left(string.length() - 1).toFloat() / 100; >+ else >+ value = string.toFloat(); >+ if (auto error = validateNumeric(value, parsingOptions)) >+ return makeUnexpected(error); >+ return value; > } >- static Optional<float> parse(const QualifiedName&, const String& string) >- { >- float number; >- if (!parseNumberFromString(string, number)) >- return WTF::nullopt; >- return number; >- } >- static String toString(float type) { return String::numberToStringFixedPrecision(type); } >+ static float fromString(const String& string) { return parse(string).value_or(initialValue()); } >+ static String toString(float value) { return String::numberToStringFixedPrecision(value); } > }; > > template<> >-struct SVGPropertyTraits<std::pair<float, float>> { >- static std::pair<float, float> initialValue() { return { }; } >- static std::pair<float, float> fromString(const String& string) >- { >- float firstNumber = 0, secondNumber = 0; >- if (!parseNumberOptionalNumber(string, firstNumber, secondNumber)) >- return { }; >- return std::make_pair(firstNumber, secondNumber); >- } >- static Optional<std::pair<float, float>> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >- static String toString(std::pair<float, float>) { ASSERT_NOT_REACHED(); return emptyString(); } >+struct SVGPropertyTraits<int> { >+ static int initialValue() { return 0; } >+ static Expected<int, SVGParsingError> parse(const String& string) { return string.toIntStrict(); } >+ static int fromString(const String& string) { return parse(string).value_or(initialValue()); } >+ static String toString(int value) { return String::number(value); } > }; > > template<> > struct SVGPropertyTraits<FloatPoint> { > static FloatPoint initialValue() { return FloatPoint(); } >- static FloatPoint fromString(const String& string) >- { >- FloatPoint point; >- if (!parsePoint(string, point)) >- return { }; >- return point; >- } >- static Optional<FloatPoint> parse(const QualifiedName&, const String& string) >+ static Expected<FloatPoint, SVGParsingError> parse(const String& string) > { >- FloatPoint point; >- if (!parsePoint(string, point)) >- return WTF::nullopt; >- return point; >+ FloatPoint value; >+ if (!parsePoint(string, value)) >+ return makeUnexpected(ParsingAttributeFailedError); >+ return value; > } >- static String toString(const FloatPoint& type) >+ static FloatPoint fromString(const String& string) { return parse(string).value_or(initialValue()); } >+ static String toString(const FloatPoint& value) > { > StringBuilder builder; >- builder.appendFixedPrecisionNumber(type.x()); >+ builder.appendFixedPrecisionNumber(value.x()); > builder.append(' '); >- builder.appendFixedPrecisionNumber(type.y()); >+ builder.appendFixedPrecisionNumber(value.y()); > return builder.toString(); > } > }; >@@ -150,46 +123,73 @@ struct SVGPropertyTraits<FloatPoint> { > template<> > struct SVGPropertyTraits<FloatRect> { > static FloatRect initialValue() { return FloatRect(); } >- static FloatRect fromString(const String& string) >- { >- FloatRect rect; >- if (!parseRect(string, rect)) >- return { }; >- return rect; >- } >- static Optional<FloatRect> parse(const QualifiedName&, const String& string) >+ static Expected<FloatRect, SVGParsingError> parse(const String& string, SVGParsingOptions parsingOptions = NoOptions) > { >- FloatRect rect; >- if (!parseRect(string, rect)) >- return WTF::nullopt; >- return rect; >+ FloatRect value; >+ if (!parseRect(string, value)) >+ return makeUnexpected(ParsingAttributeFailedError); >+ if (auto error = validateNumeric(value.width(), parsingOptions)) >+ return makeUnexpected(error); >+ if (auto error = validateNumeric(value.height(), parsingOptions)) >+ return makeUnexpected(error); >+ return value; > } >- static String toString(const FloatRect& type) >+ static FloatRect fromString(const String& string) { return parse(string).value_or(initialValue()); } >+ static String toString(const FloatRect& value) > { > StringBuilder builder; >- builder.appendFixedPrecisionNumber(type.x()); >+ builder.appendFixedPrecisionNumber(value.x()); > builder.append(' '); >- builder.appendFixedPrecisionNumber(type.y()); >+ builder.appendFixedPrecisionNumber(value.y()); > builder.append(' '); >- builder.appendFixedPrecisionNumber(type.width()); >+ builder.appendFixedPrecisionNumber(value.width()); > builder.append(' '); >- builder.appendFixedPrecisionNumber(type.height()); >+ builder.appendFixedPrecisionNumber(value.height()); > return builder.toString(); > } > }; > > template<> >-struct SVGPropertyTraits<String> { >- static String initialValue() { return String(); } >- static String fromString(const String& string) { return string; } >- static Optional<String> parse(const QualifiedName&, const String& string) { return string; } >- static String toString(const String& string) { return string; } >+struct SVGPropertyTraits<std::pair<int, int>> { >+ static std::pair<int, int> initialValue() { return { }; } >+ static Expected<std::pair<int, int>, SVGParsingError> parse(const String& string, SVGParsingOptions parsingOptions = NoOptions) >+ { >+ float valueNumber1 = 0, valueNumber2 = 0; >+ if (!parseNumberOptionalNumber(string, valueNumber1, valueNumber2)) >+ return makeUnexpected(ParsingAttributeFailedError); >+ >+ int valueInteger1 = static_cast<int>(roundf(valueNumber1)); >+ int valueInteger2 = static_cast<int>(roundf(valueNumber2)); >+ >+ if (auto error = validateNumeric(valueInteger1, parsingOptions)) >+ return makeUnexpected(error); >+ if (auto error = validateNumeric(valueInteger2, parsingOptions)) >+ return makeUnexpected(error); >+ >+ return std::make_pair(valueInteger1, valueInteger2); >+ } >+ static std::pair<int, int> fromString(const String& string) { return parse(string).value_or(initialValue()); } >+ static String toString(const std::pair<int, int>& value) { return SVGPropertyTraits<int>::toString(value.first) + ", " + SVGPropertyTraits<int>::toString(value.second); } > }; > >-template<typename EnumType> >-struct SVGIDLEnumLimits { >- // Specialize this function for a particular enumeration to limit the values that are exposed through the DOM. >- static unsigned highestExposedEnumValue() { return SVGPropertyTraits<EnumType>::highestEnumValue(); } >+template<> >+struct SVGPropertyTraits<std::pair<float, float>> { >+ static std::pair<float, float> initialValue() { return { }; } >+ static Expected<std::pair<float, float>, SVGParsingError> parse(const String& string, SVGParsingOptions parsingOptions = NoOptions) >+ { >+ float valueNumber1 = 0, valueNumber2 = 0; >+ if (!parseNumberOptionalNumber(string, valueNumber1, valueNumber2)) >+ return makeUnexpected(ParsingAttributeFailedError); >+ >+ if (auto error = validateNumeric(valueNumber1, parsingOptions)) >+ return makeUnexpected(error); >+ if (auto error = validateNumeric(valueNumber2, parsingOptions)) >+ return makeUnexpected(error); >+ >+ return std::make_pair(valueNumber1, valueNumber2); >+ } >+ static std::pair<float, float> fromString(const String& string) { return parse(string).value_or(initialValue()); } >+ static String toString(const std::pair<float, float>& value) { return SVGPropertyTraits<float>::toString(value.first) + ", " + SVGPropertyTraits<float>::toString(value.second); } > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGValueProperty.h b/Source/WebCore/svg/properties/SVGValueProperty.h >index 9f31e2d0f539cc2023b63f870686f0ed81dc29ce..559fbf51ead2ffa4ef0bab3126def3a7b006dbb3 100644 >--- a/Source/WebCore/svg/properties/SVGValueProperty.h >+++ b/Source/WebCore/svg/properties/SVGValueProperty.h >@@ -64,8 +64,8 @@ protected: > } > > // Base and default constructor. Do not use "using SVGProperty::SVGProperty" because of Windows and GTK ports. >- SVGValueProperty(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite) >- : SVGProperty(owner, access) >+ SVGValueProperty(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite, SVGPropertyState state = SVGPropertyState::Clean) >+ : SVGProperty(owner, access, state) > { > } > >diff --git a/Source/WebCore/svg/properties/SVGValuePropertyList.h b/Source/WebCore/svg/properties/SVGValuePropertyList.h >index 3010c33a74089bc44fbb410a56f785a9f717ccee..4eb93838fa0a03361357de1c0f0da09f3afa3154 100644 >--- a/Source/WebCore/svg/properties/SVGValuePropertyList.h >+++ b/Source/WebCore/svg/properties/SVGValuePropertyList.h >@@ -66,6 +66,48 @@ public: > remove(size() - 1); > } > >+ template<typename... Arguments> >+ SVGParsingError parse(const String& string, Arguments&&... arguments) >+ { >+ clearItems(); >+ >+ auto upconvertedCharacters = StringView(string).upconvertedCharacters(); >+ const UChar* ptr = upconvertedCharacters; >+ const UChar* end = ptr + string.length(); >+ >+ bool delimParsed = false; >+ while (skipOptionalSVGSpaces(ptr, end)) { >+ delimParsed = false; >+ >+ ASSERT(ptr < end); >+ auto expectedItem = PropertyType::create(ptr, end, std::forward<Arguments>(arguments)...); >+ if (!expectedItem) >+ return expectedItem.error(); >+ >+ append(WTFMove(expectedItem.value())); >+ >+ if (ptr < end && *ptr == ',') { >+ ++ptr; >+ delimParsed = true; >+ } >+ } >+ >+ return delimParsed ? UnexpectedEndOfAttributeError : NoError; >+ } >+ >+ String valueAsString() const override >+ { >+ StringBuilder builder; >+ >+ for (const auto& item : items()) { >+ if (builder.length()) >+ builder.append(' '); >+ builder.append(item->valueAsString()); >+ } >+ >+ return builder.toString(); >+ } >+ > // Visual Studio doesn't seem to see these private constructors from subclasses. > // FIXME: See what it takes to remove this hack. > #if !COMPILER(MSVC) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 74e8b9e7e994f9d394b7b52853d074c087313e8a..a25f3d04a7b7340a9a431e82da5cd0c3cd5f99ed 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,67 @@ >+2019-06-08 Said Abou-Hallawa <said@apple.com> >+ >+ SVGPropertyTraits and SVG enum types clean up >+ https://bugs.webkit.org/show_bug.cgi?id=198073 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * svg/animations/svgnumber-animation-3-expected.txt: >+ * svg/animations/svgnumber-animation-3.html: >+ The expected values of this test were wrong. The test is supposed to verify >+ the values at 0%, 50%, just before 100% and 100%. The change in the opacity >+ of the element should be: 0, 0.5, 1, 0. The test was expecting all values >+ to be zeros. >+ >+2019-05-20 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ Unify the parsing of SVGList super classes >+ https://bugs.webkit.org/show_bug.cgi?id=197831 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * html5lib/generated/run-tests11-data-expected.txt: >+ * html5lib/generated/run-tests11-write-expected.txt: >+ Report error messages if a SVGPreserveAspectRatio or SVGZoomAndPan parsing >+ error happens. >+ >+ * platform/gtk/svg/custom/preserve-aspect-ratio-syntax-expected.txt: >+ * platform/gtk/svg/custom/viewbox-syntax-expected.txt: >+ * platform/gtk/svg/hixie/error/010-expected.txt: >+ * platform/gtk/svg/hixie/error/011-expected.txt: >+ * platform/ios/svg/custom/preserve-aspect-ratio-syntax-expected.txt: >+ * platform/ios/svg/custom/viewbox-syntax-expected.txt: >+ * platform/ios/svg/hixie/error/010-expected.txt: >+ * platform/ios/svg/hixie/error/011-expected.txt: >+ * platform/mac/svg/custom/preserve-aspect-ratio-syntax-expected.txt: >+ * platform/mac/svg/custom/viewbox-syntax-expected.txt: >+ * platform/mac/svg/hixie/error/010-expected.txt: >+ * platform/mac/svg/hixie/error/011-expected.txt: >+ * platform/win/svg/custom/preserve-aspect-ratio-syntax-expected.txt: >+ * platform/win/svg/custom/viewbox-syntax-expected.txt: >+ * platform/win/svg/hixie/error/010-expected.txt: >+ * platform/win/svg/hixie/error/011-expected.txt: >+ * platform/wincairo/svg/custom/preserve-aspect-ratio-syntax-expected.txt: >+ * platform/wincairo/svg/custom/viewbox-syntax-expected.txt: >+ * platform/wpe/svg/custom/preserve-aspect-ratio-syntax-expected.txt: >+ * platform/wpe/svg/custom/viewbox-syntax-expected.txt: >+ * platform/wpe/svg/hixie/error/010-expected.txt: >+ * platform/wpe/svg/hixie/error/011-expected.txt: >+ Replace the parsing warning messages by error messages. Report error >+ messages if a SVGPreserveAspectRatio parsing error happens. >+ >+ * svg/dom/length-list-parser-expected.txt: >+ SVGLengthList was treating the leading spaces in the attribute value as >+ an error. >+ >+ * svg/dom/viewspec-parser-1-expected.txt: >+ * svg/dom/viewspec-parser-1.html: >+ Extra text at the end of svgView attribute value was not treated as an >+ error. >+ >+ * svg/hixie/error/010-expected.txt: >+ * svg/hixie/error/011-expected.txt: >+ Replace the parsing warning messages by error messages. >+ > 2019-06-08 Cathie Chen <cathiechen@igalia.com> > > resize-observer/element-leak.html fails on Windows platform >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index f1cb90389a88384bd0e5f0341f028cc71e33ecd5..4936be5d77233e826bab2d51d1ff3bf0f45a4e08 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,25 @@ >+2019-06-08 Said Abou-Hallawa <said@apple.com> >+ >+ Unify the parsing of SVGList super classes >+ https://bugs.webkit.org/show_bug.cgi?id=198073 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/html/syntax/parsing/html5lib_tests11-expected.txt: >+ Report error messages if a SVGPreserveAspectRatio or SVGZoomAndPan parsing >+ error happens. >+ >+2019-05-20 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ Unify the parsing of SVGList super classes >+ https://bugs.webkit.org/show_bug.cgi?id=197831 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/html/syntax/parsing/html5lib_tests11-expected.txt: >+ Report error messages if a SVGPreserveAspectRatio or SVGZoomAndPan parsing >+ error happens. >+ > 2019-06-07 Joonghun Park <jh718.park@samsung.com> > > Implement tab-size with units >diff --git a/LayoutTests/html5lib/generated/run-tests11-data-expected.txt b/LayoutTests/html5lib/generated/run-tests11-data-expected.txt >index 176b5c07c78b1e10063570e5e65202586de804a8..4e4fbc020dbd45ca3028a5e95fa1dabc705f900c 100644 >--- a/LayoutTests/html5lib/generated/run-tests11-data-expected.txt >+++ b/LayoutTests/html5lib/generated/run-tests11-data-expected.txt >@@ -1,4 +1,10 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="" >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="" >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute preserveAspectRatio="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="" >+CONSOLE MESSAGE: line 1: Error: Unrecognized enumerated value for <svg> attribute zoomAndPan="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute preserveAspectRatio="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="" >+CONSOLE MESSAGE: line 1: Error: Unrecognized enumerated value for <svg> attribute zoomAndPan="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute preserveAspectRatio="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="" >+CONSOLE MESSAGE: line 1: Error: Unrecognized enumerated value for <svg> attribute zoomAndPan="" > ../resources/tests11.dat: PASS >diff --git a/LayoutTests/html5lib/generated/run-tests11-write-expected.txt b/LayoutTests/html5lib/generated/run-tests11-write-expected.txt >index 9ac682ae92d7dcd14bbc9acc98eb36b84b65eecc..a89309cb322645079eeaa9b0b561c0d320423c93 100644 >--- a/LayoutTests/html5lib/generated/run-tests11-write-expected.txt >+++ b/LayoutTests/html5lib/generated/run-tests11-write-expected.txt >@@ -1,4 +1,10 @@ >-CONSOLE MESSAGE: line 168: Warning: Problem parsing viewBox="" >-CONSOLE MESSAGE: line 168: Warning: Problem parsing viewBox="" >-CONSOLE MESSAGE: line 168: Warning: Problem parsing viewBox="" >+CONSOLE MESSAGE: line 168: Error: Invalid value for <svg> attribute preserveAspectRatio="" >+CONSOLE MESSAGE: line 168: Error: Invalid value for <svg> attribute viewBox="" >+CONSOLE MESSAGE: line 168: Error: Unrecognized enumerated value for <svg> attribute zoomAndPan="" >+CONSOLE MESSAGE: line 168: Error: Invalid value for <svg> attribute preserveAspectRatio="" >+CONSOLE MESSAGE: line 168: Error: Invalid value for <svg> attribute viewBox="" >+CONSOLE MESSAGE: line 168: Error: Unrecognized enumerated value for <svg> attribute zoomAndPan="" >+CONSOLE MESSAGE: line 168: Error: Invalid value for <svg> attribute preserveAspectRatio="" >+CONSOLE MESSAGE: line 168: Error: Invalid value for <svg> attribute viewBox="" >+CONSOLE MESSAGE: line 168: Error: Unrecognized enumerated value for <svg> attribute zoomAndPan="" > ../resources/tests11.dat: PASS >diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests11-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests11-expected.txt >index 5f30fc8d042c733e49586bc9e8ec6cf96915c8ef..ae9072828bd36aff2ea7fcc62dc51791e3a9246f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests11-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests11-expected.txt >@@ -1,6 +1,12 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="" >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="" >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute preserveAspectRatio="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="" >+CONSOLE MESSAGE: line 1: Error: Unrecognized enumerated value for <svg> attribute zoomAndPan="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute preserveAspectRatio="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="" >+CONSOLE MESSAGE: line 1: Error: Unrecognized enumerated value for <svg> attribute zoomAndPan="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute preserveAspectRatio="" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="" >+CONSOLE MESSAGE: line 1: Error: Unrecognized enumerated value for <svg> attribute zoomAndPan="" > html5lib Parser Test > > >diff --git a/LayoutTests/platform/gtk/svg/custom/preserve-aspect-ratio-syntax-expected.txt b/LayoutTests/platform/gtk/svg/custom/preserve-aspect-ratio-syntax-expected.txt >index d964c5e7d6556a68e58e4c1eb4eb47b85790b2b3..41508ae1949af08713c9a3c1955e6e2c1b3383e4 100644 >--- a/LayoutTests/platform/gtk/svg/custom/preserve-aspect-ratio-syntax-expected.txt >+++ b/LayoutTests/platform/gtk/svg/custom/preserve-aspect-ratio-syntax-expected.txt >@@ -1,3 +1,8 @@ >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute preserveAspectRatio="defer meet" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute preserveAspectRatio="defer xMidYMid meet a" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute preserveAspectRatio="defer 1 xMidYMid meet" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute preserveAspectRatio="defer , xMidYMid meet" >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute preserveAspectRatio="" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/gtk/svg/custom/viewbox-syntax-expected.txt b/LayoutTests/platform/gtk/svg/custom/viewbox-syntax-expected.txt >index e0ddef53677bd1d3b0bfa25aaaa44b4b0d9fb95e..4bfbeb2c7b279a2bdd23c833015d1ada83b9eff0 100644 >--- a/LayoutTests/platform/gtk/svg/custom/viewbox-syntax-expected.txt >+++ b/LayoutTests/platform/gtk/svg/custom/viewbox-syntax-expected.txt >@@ -1,13 +1,13 @@ >-CONSOLE MESSAGE: line 20: Warning: Problem parsing viewBox="0" >-CONSOLE MESSAGE: line 23: Warning: Problem parsing viewBox="0 0" >-CONSOLE MESSAGE: line 26: Warning: Problem parsing viewBox="0 0 30" >-CONSOLE MESSAGE: line 29: Warning: Problem parsing viewBox="0 0 30 40 50" >-CONSOLE MESSAGE: line 32: Warning: Problem parsing viewBox="0 0 30 40," >-CONSOLE MESSAGE: line 35: Warning: Problem parsing viewBox=",0 0 30 40" >-CONSOLE MESSAGE: line 38: Error: A negative value for ViewBox width is not allowed >-CONSOLE MESSAGE: line 41: Error: A negative value for ViewBox height is not allowed >-CONSOLE MESSAGE: line 44: Warning: Problem parsing viewBox="0 0 30, , 40" >-CONSOLE MESSAGE: line 47: Warning: Problem parsing viewBox="0 0 30% 40" >+CONSOLE MESSAGE: line 20: Error: Invalid value for <svg> attribute viewBox="0" >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute viewBox="0 0" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute viewBox="0 0 30" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute viewBox="0 0 30 40 50" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute viewBox="0 0 30 40," >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute viewBox=",0 0 30 40" >+CONSOLE MESSAGE: line 38: Error: Invalid negative value for <svg> attribute viewBox="0 0 -30 40" >+CONSOLE MESSAGE: line 41: Error: Invalid negative value for <svg> attribute viewBox="0 0 30 -40" >+CONSOLE MESSAGE: line 44: Error: Invalid value for <svg> attribute viewBox="0 0 30, , 40" >+CONSOLE MESSAGE: line 47: Error: Invalid value for <svg> attribute viewBox="0 0 30% 40" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/gtk/svg/hixie/error/010-expected.txt b/LayoutTests/platform/gtk/svg/hixie/error/010-expected.txt >index b7ad4f967d1c013c7800f7a0b46bd1fa70d494d8..dd2070539e16d9e83f1325c90c880af8ff77595c 100644 >--- a/LayoutTests/platform/gtk/svg/hixie/error/010-expected.txt >+++ b/LayoutTests/platform/gtk/svg/hixie/error/010-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0 1 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0 1 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/gtk/svg/hixie/error/011-expected.txt b/LayoutTests/platform/gtk/svg/hixie/error/011-expected.txt >index a5d8be7846aa84d58b473b851895a95db90c4de7..9d09fc6816e9415ece6249d6fd26b367dbe6097c 100644 >--- a/LayoutTests/platform/gtk/svg/hixie/error/011-expected.txt >+++ b/LayoutTests/platform/gtk/svg/hixie/error/011-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0,, 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0,, 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/ios/svg/custom/preserve-aspect-ratio-syntax-expected.txt b/LayoutTests/platform/ios/svg/custom/preserve-aspect-ratio-syntax-expected.txt >index 7378a37bab831cbd48c1a78745a7a22fd5d0a94b..e237ab3a9d1e118c70aa536cca487460dd7f2690 100644 >--- a/LayoutTests/platform/ios/svg/custom/preserve-aspect-ratio-syntax-expected.txt >+++ b/LayoutTests/platform/ios/svg/custom/preserve-aspect-ratio-syntax-expected.txt >@@ -1,3 +1,8 @@ >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute preserveAspectRatio="defer meet" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute preserveAspectRatio="defer xMidYMid meet a" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute preserveAspectRatio="defer 1 xMidYMid meet" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute preserveAspectRatio="defer , xMidYMid meet" >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute preserveAspectRatio="" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/ios/svg/custom/viewbox-syntax-expected.txt b/LayoutTests/platform/ios/svg/custom/viewbox-syntax-expected.txt >index c9b1a25acf21ca90057dcc3a748b3b9efe502da9..93ae5a33b284ce3ffbb58fbdfd12566c4581a55f 100644 >--- a/LayoutTests/platform/ios/svg/custom/viewbox-syntax-expected.txt >+++ b/LayoutTests/platform/ios/svg/custom/viewbox-syntax-expected.txt >@@ -1,13 +1,13 @@ >-CONSOLE MESSAGE: line 20: Warning: Problem parsing viewBox="0" >-CONSOLE MESSAGE: line 23: Warning: Problem parsing viewBox="0 0" >-CONSOLE MESSAGE: line 26: Warning: Problem parsing viewBox="0 0 30" >-CONSOLE MESSAGE: line 29: Warning: Problem parsing viewBox="0 0 30 40 50" >-CONSOLE MESSAGE: line 32: Warning: Problem parsing viewBox="0 0 30 40," >-CONSOLE MESSAGE: line 35: Warning: Problem parsing viewBox=",0 0 30 40" >-CONSOLE MESSAGE: line 38: Error: A negative value for ViewBox width is not allowed >-CONSOLE MESSAGE: line 41: Error: A negative value for ViewBox height is not allowed >-CONSOLE MESSAGE: line 44: Warning: Problem parsing viewBox="0 0 30, , 40" >-CONSOLE MESSAGE: line 47: Warning: Problem parsing viewBox="0 0 30% 40" >+CONSOLE MESSAGE: line 20: Error: Invalid value for <svg> attribute viewBox="0" >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute viewBox="0 0" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute viewBox="0 0 30" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute viewBox="0 0 30 40 50" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute viewBox="0 0 30 40," >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute viewBox=",0 0 30 40" >+CONSOLE MESSAGE: line 38: Error: Invalid negative value for <svg> attribute viewBox="0 0 -30 40" >+CONSOLE MESSAGE: line 41: Error: Invalid negative value for <svg> attribute viewBox="0 0 30 -40" >+CONSOLE MESSAGE: line 44: Error: Invalid value for <svg> attribute viewBox="0 0 30, , 40" >+CONSOLE MESSAGE: line 47: Error: Invalid value for <svg> attribute viewBox="0 0 30% 40" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/ios/svg/hixie/error/010-expected.txt b/LayoutTests/platform/ios/svg/hixie/error/010-expected.txt >index 92bcc39fa7348cb3500b91538cd792afbd4e3a49..458ac40cebeafe3f8582a91d56c32a6149247ce6 100644 >--- a/LayoutTests/platform/ios/svg/hixie/error/010-expected.txt >+++ b/LayoutTests/platform/ios/svg/hixie/error/010-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0 1 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0 1 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/ios/svg/hixie/error/011-expected.txt b/LayoutTests/platform/ios/svg/hixie/error/011-expected.txt >index fbf48c0a35490f324819be0c7873efa607d8d4a2..76df56ffafcd510acb27bdd790bec2371c1d504d 100644 >--- a/LayoutTests/platform/ios/svg/hixie/error/011-expected.txt >+++ b/LayoutTests/platform/ios/svg/hixie/error/011-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0,, 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0,, 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/mac/svg/custom/preserve-aspect-ratio-syntax-expected.txt b/LayoutTests/platform/mac/svg/custom/preserve-aspect-ratio-syntax-expected.txt >index 4a1f34a7cc112b6c274bcb004edbefc117aea998..ac91f9618f1abb0613343ac6200c41e03d4ff51d 100644 >--- a/LayoutTests/platform/mac/svg/custom/preserve-aspect-ratio-syntax-expected.txt >+++ b/LayoutTests/platform/mac/svg/custom/preserve-aspect-ratio-syntax-expected.txt >@@ -1,3 +1,8 @@ >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute preserveAspectRatio="defer meet" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute preserveAspectRatio="defer xMidYMid meet a" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute preserveAspectRatio="defer 1 xMidYMid meet" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute preserveAspectRatio="defer , xMidYMid meet" >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute preserveAspectRatio="" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/mac/svg/custom/viewbox-syntax-expected.txt b/LayoutTests/platform/mac/svg/custom/viewbox-syntax-expected.txt >index 899afcef73be684197908acb5d8abcce0380a8c0..2bcbf8e653428cf1fc3e9912bf25a3cad0469ad2 100644 >--- a/LayoutTests/platform/mac/svg/custom/viewbox-syntax-expected.txt >+++ b/LayoutTests/platform/mac/svg/custom/viewbox-syntax-expected.txt >@@ -1,13 +1,13 @@ >-CONSOLE MESSAGE: line 20: Warning: Problem parsing viewBox="0" >-CONSOLE MESSAGE: line 23: Warning: Problem parsing viewBox="0 0" >-CONSOLE MESSAGE: line 26: Warning: Problem parsing viewBox="0 0 30" >-CONSOLE MESSAGE: line 29: Warning: Problem parsing viewBox="0 0 30 40 50" >-CONSOLE MESSAGE: line 32: Warning: Problem parsing viewBox="0 0 30 40," >-CONSOLE MESSAGE: line 35: Warning: Problem parsing viewBox=",0 0 30 40" >-CONSOLE MESSAGE: line 38: Error: A negative value for ViewBox width is not allowed >-CONSOLE MESSAGE: line 41: Error: A negative value for ViewBox height is not allowed >-CONSOLE MESSAGE: line 44: Warning: Problem parsing viewBox="0 0 30, , 40" >-CONSOLE MESSAGE: line 47: Warning: Problem parsing viewBox="0 0 30% 40" >+CONSOLE MESSAGE: line 20: Error: Invalid value for <svg> attribute viewBox="0" >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute viewBox="0 0" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute viewBox="0 0 30" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute viewBox="0 0 30 40 50" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute viewBox="0 0 30 40," >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute viewBox=",0 0 30 40" >+CONSOLE MESSAGE: line 38: Error: Invalid negative value for <svg> attribute viewBox="0 0 -30 40" >+CONSOLE MESSAGE: line 41: Error: Invalid negative value for <svg> attribute viewBox="0 0 30 -40" >+CONSOLE MESSAGE: line 44: Error: Invalid value for <svg> attribute viewBox="0 0 30, , 40" >+CONSOLE MESSAGE: line 47: Error: Invalid value for <svg> attribute viewBox="0 0 30% 40" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/mac/svg/hixie/error/010-expected.txt b/LayoutTests/platform/mac/svg/hixie/error/010-expected.txt >index 92bcc39fa7348cb3500b91538cd792afbd4e3a49..458ac40cebeafe3f8582a91d56c32a6149247ce6 100644 >--- a/LayoutTests/platform/mac/svg/hixie/error/010-expected.txt >+++ b/LayoutTests/platform/mac/svg/hixie/error/010-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0 1 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0 1 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/mac/svg/hixie/error/011-expected.txt b/LayoutTests/platform/mac/svg/hixie/error/011-expected.txt >index fbf48c0a35490f324819be0c7873efa607d8d4a2..76df56ffafcd510acb27bdd790bec2371c1d504d 100644 >--- a/LayoutTests/platform/mac/svg/hixie/error/011-expected.txt >+++ b/LayoutTests/platform/mac/svg/hixie/error/011-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0,, 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0,, 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/win/svg/custom/preserve-aspect-ratio-syntax-expected.txt b/LayoutTests/platform/win/svg/custom/preserve-aspect-ratio-syntax-expected.txt >index d6d10572689867d3e1dc298e573c6367b2bc0494..191f3e635f189901897e7bd260bf20b4fdabe433 100644 >--- a/LayoutTests/platform/win/svg/custom/preserve-aspect-ratio-syntax-expected.txt >+++ b/LayoutTests/platform/win/svg/custom/preserve-aspect-ratio-syntax-expected.txt >@@ -1,3 +1,8 @@ >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute preserveAspectRatio="defer meet" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute preserveAspectRatio="defer xMidYMid meet a" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute preserveAspectRatio="defer 1 xMidYMid meet" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute preserveAspectRatio="defer , xMidYMid meet" >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute preserveAspectRatio="" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/win/svg/custom/viewbox-syntax-expected.txt b/LayoutTests/platform/win/svg/custom/viewbox-syntax-expected.txt >index 626cd6a946a259a69b94bd9030e32e1a2647da47..f994178f8dce78f1a74af39e04d7f33a6f82ec32 100644 >--- a/LayoutTests/platform/win/svg/custom/viewbox-syntax-expected.txt >+++ b/LayoutTests/platform/win/svg/custom/viewbox-syntax-expected.txt >@@ -1,13 +1,13 @@ >-CONSOLE MESSAGE: line 20: Warning: Problem parsing viewBox="0" >-CONSOLE MESSAGE: line 23: Warning: Problem parsing viewBox="0 0" >-CONSOLE MESSAGE: line 26: Warning: Problem parsing viewBox="0 0 30" >-CONSOLE MESSAGE: line 29: Warning: Problem parsing viewBox="0 0 30 40 50" >-CONSOLE MESSAGE: line 32: Warning: Problem parsing viewBox="0 0 30 40," >-CONSOLE MESSAGE: line 35: Warning: Problem parsing viewBox=",0 0 30 40" >-CONSOLE MESSAGE: line 38: Error: A negative value for ViewBox width is not allowed >-CONSOLE MESSAGE: line 41: Error: A negative value for ViewBox height is not allowed >-CONSOLE MESSAGE: line 44: Warning: Problem parsing viewBox="0 0 30, , 40" >-CONSOLE MESSAGE: line 47: Warning: Problem parsing viewBox="0 0 30% 40" >+CONSOLE MESSAGE: line 20: Error: Invalid value for <svg> attribute viewBox="0" >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute viewBox="0 0" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute viewBox="0 0 30" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute viewBox="0 0 30 40 50" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute viewBox="0 0 30 40," >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute viewBox=",0 0 30 40" >+CONSOLE MESSAGE: line 38: Error: Invalid negative value for <svg> attribute viewBox="0 0 -30 40" >+CONSOLE MESSAGE: line 41: Error: Invalid negative value for <svg> attribute viewBox="0 0 30 -40" >+CONSOLE MESSAGE: line 44: Error: Invalid value for <svg> attribute viewBox="0 0 30, , 40" >+CONSOLE MESSAGE: line 47: Error: Invalid value for <svg> attribute viewBox="0 0 30% 40" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/win/svg/hixie/error/010-expected.txt b/LayoutTests/platform/win/svg/hixie/error/010-expected.txt >index b7ad4f967d1c013c7800f7a0b46bd1fa70d494d8..dd2070539e16d9e83f1325c90c880af8ff77595c 100644 >--- a/LayoutTests/platform/win/svg/hixie/error/010-expected.txt >+++ b/LayoutTests/platform/win/svg/hixie/error/010-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0 1 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0 1 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/win/svg/hixie/error/011-expected.txt b/LayoutTests/platform/win/svg/hixie/error/011-expected.txt >index a5d8be7846aa84d58b473b851895a95db90c4de7..9d09fc6816e9415ece6249d6fd26b367dbe6097c 100644 >--- a/LayoutTests/platform/win/svg/hixie/error/011-expected.txt >+++ b/LayoutTests/platform/win/svg/hixie/error/011-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0,, 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0,, 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/wincairo/svg/custom/preserve-aspect-ratio-syntax-expected.txt b/LayoutTests/platform/wincairo/svg/custom/preserve-aspect-ratio-syntax-expected.txt >index 5f67704c7a14c7f9f36f8e5deff99cf5fa9ed51c..3cf185a18c9a10d59e9f0985f1e204327bde39d2 100644 >--- a/LayoutTests/platform/wincairo/svg/custom/preserve-aspect-ratio-syntax-expected.txt >+++ b/LayoutTests/platform/wincairo/svg/custom/preserve-aspect-ratio-syntax-expected.txt >@@ -1,3 +1,8 @@ >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute preserveAspectRatio="defer meet" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute preserveAspectRatio="defer xMidYMid meet a" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute preserveAspectRatio="defer 1 xMidYMid meet" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute preserveAspectRatio="defer , xMidYMid meet" >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute preserveAspectRatio="" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/wincairo/svg/custom/viewbox-syntax-expected.txt b/LayoutTests/platform/wincairo/svg/custom/viewbox-syntax-expected.txt >index d81325f8aa74ef0e33124b9c994599209bd9d04a..5168c075c303090ad3f5820539d478b618cb4fde 100644 >--- a/LayoutTests/platform/wincairo/svg/custom/viewbox-syntax-expected.txt >+++ b/LayoutTests/platform/wincairo/svg/custom/viewbox-syntax-expected.txt >@@ -1,13 +1,13 @@ >-CONSOLE MESSAGE: line 20: Warning: Problem parsing viewBox="0" >-CONSOLE MESSAGE: line 23: Warning: Problem parsing viewBox="0 0" >-CONSOLE MESSAGE: line 26: Warning: Problem parsing viewBox="0 0 30" >-CONSOLE MESSAGE: line 29: Warning: Problem parsing viewBox="0 0 30 40 50" >-CONSOLE MESSAGE: line 32: Warning: Problem parsing viewBox="0 0 30 40," >-CONSOLE MESSAGE: line 35: Warning: Problem parsing viewBox=",0 0 30 40" >-CONSOLE MESSAGE: line 38: Error: A negative value for ViewBox width is not allowed >-CONSOLE MESSAGE: line 41: Error: A negative value for ViewBox height is not allowed >-CONSOLE MESSAGE: line 44: Warning: Problem parsing viewBox="0 0 30, , 40" >-CONSOLE MESSAGE: line 47: Warning: Problem parsing viewBox="0 0 30% 40" >+CONSOLE MESSAGE: line 20: Error: Invalid value for <svg> attribute viewBox="0" >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute viewBox="0 0" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute viewBox="0 0 30" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute viewBox="0 0 30 40 50" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute viewBox="0 0 30 40," >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute viewBox=",0 0 30 40" >+CONSOLE MESSAGE: line 38: Error: Invalid negative value for <svg> attribute viewBox="0 0 -30 40" >+CONSOLE MESSAGE: line 41: Error: Invalid negative value for <svg> attribute viewBox="0 0 30 -40" >+CONSOLE MESSAGE: line 44: Error: Invalid value for <svg> attribute viewBox="0 0 30, , 40" >+CONSOLE MESSAGE: line 47: Error: Invalid value for <svg> attribute viewBox="0 0 30% 40" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/wpe/svg/custom/preserve-aspect-ratio-syntax-expected.txt b/LayoutTests/platform/wpe/svg/custom/preserve-aspect-ratio-syntax-expected.txt >index 99b703d32f5d5128781c1fbf0de8919e9cb8e848..b1bb55f7498d5e9696c7be906c4f64f5dff3e733 100644 >--- a/LayoutTests/platform/wpe/svg/custom/preserve-aspect-ratio-syntax-expected.txt >+++ b/LayoutTests/platform/wpe/svg/custom/preserve-aspect-ratio-syntax-expected.txt >@@ -1,3 +1,8 @@ >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute preserveAspectRatio="defer meet" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute preserveAspectRatio="defer xMidYMid meet a" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute preserveAspectRatio="defer 1 xMidYMid meet" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute preserveAspectRatio="defer , xMidYMid meet" >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute preserveAspectRatio="" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/wpe/svg/custom/viewbox-syntax-expected.txt b/LayoutTests/platform/wpe/svg/custom/viewbox-syntax-expected.txt >index 2f92ff2e37fa3301390a94a826d0be9eb4e870c9..f8d32e39e0e17b72699fe498896d03bda13b8336 100644 >--- a/LayoutTests/platform/wpe/svg/custom/viewbox-syntax-expected.txt >+++ b/LayoutTests/platform/wpe/svg/custom/viewbox-syntax-expected.txt >@@ -1,13 +1,13 @@ >-CONSOLE MESSAGE: line 20: Warning: Problem parsing viewBox="0" >-CONSOLE MESSAGE: line 23: Warning: Problem parsing viewBox="0 0" >-CONSOLE MESSAGE: line 26: Warning: Problem parsing viewBox="0 0 30" >-CONSOLE MESSAGE: line 29: Warning: Problem parsing viewBox="0 0 30 40 50" >-CONSOLE MESSAGE: line 32: Warning: Problem parsing viewBox="0 0 30 40," >-CONSOLE MESSAGE: line 35: Warning: Problem parsing viewBox=",0 0 30 40" >-CONSOLE MESSAGE: line 38: Error: A negative value for ViewBox width is not allowed >-CONSOLE MESSAGE: line 41: Error: A negative value for ViewBox height is not allowed >-CONSOLE MESSAGE: line 44: Warning: Problem parsing viewBox="0 0 30, , 40" >-CONSOLE MESSAGE: line 47: Warning: Problem parsing viewBox="0 0 30% 40" >+CONSOLE MESSAGE: line 20: Error: Invalid value for <svg> attribute viewBox="0" >+CONSOLE MESSAGE: line 23: Error: Invalid value for <svg> attribute viewBox="0 0" >+CONSOLE MESSAGE: line 26: Error: Invalid value for <svg> attribute viewBox="0 0 30" >+CONSOLE MESSAGE: line 29: Error: Invalid value for <svg> attribute viewBox="0 0 30 40 50" >+CONSOLE MESSAGE: line 32: Error: Invalid value for <svg> attribute viewBox="0 0 30 40," >+CONSOLE MESSAGE: line 35: Error: Invalid value for <svg> attribute viewBox=",0 0 30 40" >+CONSOLE MESSAGE: line 38: Error: Invalid negative value for <svg> attribute viewBox="0 0 -30 40" >+CONSOLE MESSAGE: line 41: Error: Invalid negative value for <svg> attribute viewBox="0 0 30 -40" >+CONSOLE MESSAGE: line 44: Error: Invalid value for <svg> attribute viewBox="0 0 30, , 40" >+CONSOLE MESSAGE: line 47: Error: Invalid value for <svg> attribute viewBox="0 0 30% 40" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/wpe/svg/hixie/error/010-expected.txt b/LayoutTests/platform/wpe/svg/hixie/error/010-expected.txt >index b7ad4f967d1c013c7800f7a0b46bd1fa70d494d8..dd2070539e16d9e83f1325c90c880af8ff77595c 100644 >--- a/LayoutTests/platform/wpe/svg/hixie/error/010-expected.txt >+++ b/LayoutTests/platform/wpe/svg/hixie/error/010-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0 1 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0 1 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/platform/wpe/svg/hixie/error/011-expected.txt b/LayoutTests/platform/wpe/svg/hixie/error/011-expected.txt >index a5d8be7846aa84d58b473b851895a95db90c4de7..9d09fc6816e9415ece6249d6fd26b367dbe6097c 100644 >--- a/LayoutTests/platform/wpe/svg/hixie/error/011-expected.txt >+++ b/LayoutTests/platform/wpe/svg/hixie/error/011-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0,, 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0,, 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/svg/animations/svgnumber-animation-3-expected.txt b/LayoutTests/svg/animations/svgnumber-animation-3-expected.txt >index dd3525d1a5bbe0d94adb2ab6f51604341dccb0a2..e9f031b278e9d089005c8dc20b42a3f59a4cde62 100644 >--- a/LayoutTests/svg/animations/svgnumber-animation-3-expected.txt >+++ b/LayoutTests/svg/animations/svgnumber-animation-3-expected.txt >@@ -6,8 +6,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > > > PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 >-PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 >-PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 >+PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0.5 >+PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 1 > PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 > PASS successfullyParsed is true > >diff --git a/LayoutTests/svg/animations/svgnumber-animation-3.html b/LayoutTests/svg/animations/svgnumber-animation-3.html >index b60da83a74de900b40014898d74272283c03f4c7..8bc442699f45a0f9a76b6640eaee9c72299841b0 100644 >--- a/LayoutTests/svg/animations/svgnumber-animation-3.html >+++ b/LayoutTests/svg/animations/svgnumber-animation-3.html >@@ -36,15 +36,15 @@ rootSVGElement.appendChild(rect); > // Setup animation test > function sample1() { > // Check initial/end conditions >- shouldBe("getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); >+ shouldBeCloseEnough("getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); > } > > function sample2() { >- shouldBe("getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); >+ shouldBeCloseEnough("getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0.5"); > } > > function sample3() { >- shouldBe("getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); >+ shouldBeCloseEnough("getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "1"); > } > > function executeTest() { >diff --git a/LayoutTests/svg/dom/length-list-parser-expected.txt b/LayoutTests/svg/dom/length-list-parser-expected.txt >index eef063076bd4de61794511937a61f0165507b7ba..c3082db1c6f32f768f19b901c75019431c8aa96b 100644 >--- a/LayoutTests/svg/dom/length-list-parser-expected.txt >+++ b/LayoutTests/svg/dom/length-list-parser-expected.txt >@@ -5,8 +5,10 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > > Parsed as 1 length(s) [ 8.847 ]: 8.847 > Parsed as 1 length(s) [ 8.62569e+6 ]: 8625686 3.0-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, 90,e4997..,782-4326e. -0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013e,+e9 e 4829.,063721-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e6 072 >+Parsed as 8 length(s) [ 28, -8, 0, 47, 4, 0, 35, 684 ]: 28 -8 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,47 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > Parsed as 1 length(s) [ 1 ]: 1,.,+.833+.004 2-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+.9- 8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.7980-555-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-198 50 > Parsed as 1 length(s) [ 564281 ]: 564281 0ee51+ e 378584833 ,.141 e8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-53. 88530-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 8.-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018.847e28886-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014e85 .-1- >@@ -14,6 +16,7 @@ Parsed as 3 length(s) [ 0, 9, 367 ]: -0.0000000000000000000000000000000000000000 > Parsed as 4 length(s) [ 4, 0, 35, 684 ]: 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460-79.5-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000169603-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010641,,572-960 1-9 289 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > Parsed as 1 length(s) [ 1 ]: 1,.,+.833+.004 2-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+.9- 8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.7980-555-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-198 50 > Parsed as 1 length(s) [ 564281 ]: 564281 0ee51+ e 378584833 ,.141 e8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-53. 88530-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 8.-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018.847e28886-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014e85 .-1- >@@ -21,6 +24,7 @@ Parsed as 3 length(s) [ 0, 9, 367 ]: -0.0000000000000000000000000000000000000000 > Parsed as 4 length(s) [ 4, 0, 35, 684 ]: 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460-79.5-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000169603-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010641,,572-960 1-9 289 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > Parsed as 1 length(s) [ 1 ]: 1,.,+.833+.004 2-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+.9- 8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.7980-555-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-198 50 > Parsed as 1 length(s) [ 564281 ]: 564281 0ee51+ e 378584833 ,.141 e8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-53. 88530-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 8.-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018.847e28886-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014e85 .-1- >@@ -28,6 +32,7 @@ Parsed as 3 length(s) [ 0, 9, 367 ]: -0.0000000000000000000000000000000000000000 > Parsed as 4 length(s) [ 4, 0, 35, 684 ]: 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460-79.5-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000169603-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010641,,572-960 1-9 289 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > Parsed as 1 length(s) [ 1 ]: 1,.,+.833+.004 2-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+.9- 8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.7980-555-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-198 50 > Parsed as 1 length(s) [ 564281 ]: 564281 0ee51+ e 378584833 ,.141 e8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-53. 88530-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 8.-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018.847e28886-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014e85 .-1- >@@ -35,6 +40,7 @@ Parsed as 3 length(s) [ 0, 9, 367 ]: -0.0000000000000000000000000000000000000000 > Parsed as 4 length(s) [ 4, 0, 35, 684 ]: 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460-79.5-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000169603-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010641,,572-960 1-9 289 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > Parsed as 1 length(s) [ 1 ]: 1,.,+.833+.004 2-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+.9- 8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.7980-555-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-198 50 > Parsed as 1 length(s) [ 564281 ]: 564281 0ee51+ e 378584833 ,.141 e8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-53. 88530-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 8.-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018.847e28886-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014e85 .-1- >@@ -42,6 +48,7 @@ Parsed as 3 length(s) [ 0, 9, 367 ]: -0.0000000000000000000000000000000000000000 > Parsed as 4 length(s) [ 4, 0, 35, 684 ]: 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460-79.5-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000169603-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010641,,572-960 1-9 289 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > Parsed as 1 length(s) [ 1 ]: 1,.,+.833+.004 2-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+.9- 8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.7980-555-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-198 50 > Parsed as 1 length(s) [ 564281 ]: 564281 0ee51+ e 378584833 ,.141 e8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-53. 88530-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 8.-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018.847e28886-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014e85 .-1- >@@ -49,6 +56,7 @@ Parsed as 3 length(s) [ 0, 9, 367 ]: -0.0000000000000000000000000000000000000000 > Parsed as 4 length(s) [ 4, 0, 35, 684 ]: 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460-79.5-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000169603-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010641,,572-960 1-9 289 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > Parsed as 1 length(s) [ 1 ]: 1,.,+.833+.004 2-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+.9- 8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.7980-555-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-198 50 > Parsed as 1 length(s) [ 564281 ]: 564281 0ee51+ e 378584833 ,.141 e8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-53. 88530-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 8.-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018.847e28886-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014e85 .-1- >@@ -56,6 +64,7 @@ Parsed as 3 length(s) [ 0, 9, 367 ]: -0.0000000000000000000000000000000000000000 > Parsed as 4 length(s) [ 4, 0, 35, 684 ]: 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460-79.5-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000169603-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010641,,572-960 1-9 289 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > Parsed as 1 length(s) [ 1 ]: 1,.,+.833+.004 2-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+.9- 8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.7980-555-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-198 50 > Parsed as 1 length(s) [ 564281 ]: 564281 0ee51+ e 378584833 ,.141 e8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-53. 88530-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 8.-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018.847e28886-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014e85 .-1- >@@ -63,6 +72,7 @@ Parsed as 3 length(s) [ 0, 9, 367 ]: -0.0000000000000000000000000000000000000000 > Parsed as 4 length(s) [ 4, 0, 35, 684 ]: 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460-79.5-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000169603-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010641,,572-960 1-9 289 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > Parsed as 1 length(s) [ 1 ]: 1,.,+.833+.004 2-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+.9- 8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.7980-555-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-198 50 > Parsed as 1 length(s) [ 564281 ]: 564281 0ee51+ e 378584833 ,.141 e8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-53. 88530-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 8.-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018.847e28886-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014e85 .-1- >@@ -70,6 +80,7 @@ Parsed as 3 length(s) [ 0, 9, 367 ]: -0.0000000000000000000000000000000000000000 > Parsed as 4 length(s) [ 4, 0, 35, 684 ]: 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460-79.5-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000169603-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010641,,572-960 1-9 289 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > Parsed as 1 length(s) [ 1 ]: 1,.,+.833+.004 2-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+.9- 8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.7980-555-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-198 50 > Parsed as 1 length(s) [ 564281 ]: 564281 0ee51+ e 378584833 ,.141 e8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-53. 88530-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 8.-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018.847e28886-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014e85 .-1- >@@ -77,6 +88,7 @@ Parsed as 3 length(s) [ 0, 9, 367 ]: -0.0000000000000000000000000000000000000000 > Parsed as 4 length(s) [ 4, 0, 35, 684 ]: 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460-79.5-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000169603-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010641,,572-960 1-9 289 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > Parsed as 1 length(s) [ 1 ]: 1,.,+.833+.004 2-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+.9- 8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.7980-555-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-198 50 > Parsed as 1 length(s) [ 564281 ]: 564281 0ee51+ e 378584833 ,.141 e8-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-53. 88530-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 8.-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018.847e28886-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014e85 .-1- >@@ -84,6 +96,7 @@ Parsed as 3 length(s) [ 0, 9, 367 ]: -0.0000000000000000000000000000000000000000 > Parsed as 4 length(s) [ 4, 0, 35, 684 ]: 04,-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001993,35 +684 + 159e +.3-e0+,812-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001728-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014+,--1-26e666460-79.5-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000169603-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010641,,572-960 1-9 289 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 >+Parsed as 1 length(s) [ 2183 ]: 2183 9-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000191,59-- 70478.,566964784 e1-53 847e0.6e34805-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 975 922e,4 +e0e-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 . > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 + > PASS successfullyParsed is true > >diff --git a/LayoutTests/svg/dom/viewspec-parser-1-expected.txt b/LayoutTests/svg/dom/viewspec-parser-1-expected.txt >index d442f1bf9111d3bd728a57af158aebb6a524151c..93d3c64de7afda3b4bd21a3e23b5e3eda932dc7e 100644 >--- a/LayoutTests/svg/dom/viewspec-parser-1-expected.txt >+++ b/LayoutTests/svg/dom/viewspec-parser-1-expected.txt >@@ -6,8 +6,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > Loaded: resources/viewspec-target.svg# > Parsed: [initial view] from: [initial view] > >-Loaded: resources/viewspec-target.svg#svgView(viewBox(0,0,200,200))) >-Parsed: svgView(viewBox(0 0 200 200)) from: svgView(viewBox(0,0,200,200))) >+Loaded: resources/viewspec-target.svg#svgView(viewBox(0,0,200,200)) >+Parsed: svgView(viewBox(0 0 200 200)) from: svgView(viewBox(0,0,200,200)) > > Loaded: resources/viewspec-target.svg#svgView(preserveAspectRatio(xMaxYMin slice)) > Parsed: svgView(preserveAspectRatio(xMaxYMin slice)) from: svgView(preserveAspectRatio(xMaxYMin slice)) >diff --git a/LayoutTests/svg/dom/viewspec-parser-1.html b/LayoutTests/svg/dom/viewspec-parser-1.html >index 5b17d75921288e1c0a0e671d55f24fab674370af..62173e62f3cd433c2afa19b4cce35a85ab2620a1 100644 >--- a/LayoutTests/svg/dom/viewspec-parser-1.html >+++ b/LayoutTests/svg/dom/viewspec-parser-1.html >@@ -18,7 +18,7 @@ > }; > > var tests = [ >- "svgView(viewBox(0,0,200,200)))", >+ "svgView(viewBox(0,0,200,200))", > "svgView(preserveAspectRatio(xMaxYMin slice))", > "svgView(preserveAspectRatio(xMaxYMin))", > "svgView(viewBox(1,2,3,4);preserveAspectRatio(xMaxYMin))", >diff --git a/LayoutTests/svg/hixie/error/010-expected.txt b/LayoutTests/svg/hixie/error/010-expected.txt >index f7d359b91db953d522a669cdb993f947294845a7..49018244e664210d177b448e342626ecd49e7ca7 100644 >--- a/LayoutTests/svg/hixie/error/010-expected.txt >+++ b/LayoutTests/svg/hixie/error/010-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0 1 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0 1 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600 >diff --git a/LayoutTests/svg/hixie/error/011-expected.txt b/LayoutTests/svg/hixie/error/011-expected.txt >index 7c241b6462071415c1d03828c055a4e39287c281..cacec5f8cbd532dba6684617bfc8a6be4a4518ec 100644 >--- a/LayoutTests/svg/hixie/error/011-expected.txt >+++ b/LayoutTests/svg/hixie/error/011-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 1: Warning: Problem parsing viewBox="0 0,, 1 1" >+CONSOLE MESSAGE: line 1: Error: Invalid value for <svg> attribute viewBox="0 0,, 1 1" > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 > layer at (0,0) size 800x600
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 198695
: 371692 |
373847