WebKit Bugzilla
Attachment 370324 Details for
Bug 198073
: SVGPropertyTraits and SVG enum types clean up
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198073-20190521093345.patch (text/plain), 213.88 KB, created by
Said Abou-Hallawa
on 2019-05-21 09:33:46 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2019-05-21 09:33:46 PDT
Size:
213.88 KB
patch
obsolete
>Subversion Revision: 245536 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2abed3accab80d83b1464bd7209e56e639f95e33..241b546d4e75b81ba5bbc82578dfbeb043202936 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,277 @@ >+2019-05-21 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-05-20 Gabe Giosia <giosia@google.com> > > Range getBoundingClientRect returning zero rect on simple text node with <br> before it >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index f69cff232128cbbe8ea5cc1dee84070cb6f8701e..62b8a1f226de01ab35c6f8411c2370fdd29ffb36 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1738,7 +1738,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 */; }; >@@ -8534,7 +8533,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>"; }; >@@ -9367,6 +9365,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>"; }; >@@ -16026,6 +16027,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 */, >@@ -24177,7 +24181,6 @@ > B222795F0D00BF210071B782 /* SVGZoomAndPan.cpp */, > B22279600D00BF210071B782 /* SVGZoomAndPan.h */, > B22279610D00BF210071B782 /* SVGZoomAndPan.idl */, >- 55FA7FFA2110ECD7005AEFE7 /* SVGZoomAndPanType.h */, > B2E4EC940D00C22B00432643 /* SVGZoomEvent.cpp */, > B2E4EC950D00C22B00432643 /* SVGZoomEvent.h */, > B2E4EC960D00C22B00432643 /* SVGZoomEvent.idl */, >@@ -31704,7 +31707,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/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/SVGComponentTransferFunctionElement.h b/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >index a3388f82e28219446f2f231e6b0e753abfdf5131..c5995cd7843c31ce1609ce98040602bea712f390 100644 >--- a/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >+++ b/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >@@ -26,47 +26,6 @@ > > 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); > public: >diff --git a/Source/WebCore/svg/SVGElement.cpp b/Source/WebCore/svg/SVGElement.cpp >index cc5b6fd25e85b7f9ca9eca2e1aead4ef458f6189..9d4cb87239853461896587d1d4dd2e40e45ca728 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) >diff --git a/Source/WebCore/svg/SVGFEBlendElement.h b/Source/WebCore/svg/SVGFEBlendElement.h >index a9c98e427664b2e13c167078f1f0dc7cd50230ba..750a517598947cdda89dbd1bdb758a7138af4c7d 100644 >--- a/Source/WebCore/svg/SVGFEBlendElement.h >+++ b/Source/WebCore/svg/SVGFEBlendElement.h >@@ -27,26 +27,6 @@ > > 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); > public: >diff --git a/Source/WebCore/svg/SVGFEColorMatrixElement.h b/Source/WebCore/svg/SVGFEColorMatrixElement.h >index 3ef24c94224868da77d0e80bcdf0c7465393f23e..0d227463f0ae0194fec99f94c1919dbe22ebcbcf 100644 >--- a/Source/WebCore/svg/SVGFEColorMatrixElement.h >+++ b/Source/WebCore/svg/SVGFEColorMatrixElement.h >@@ -26,43 +26,6 @@ > > 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); > public: >diff --git a/Source/WebCore/svg/SVGFECompositeElement.h b/Source/WebCore/svg/SVGFECompositeElement.h >index a33c982b3495e3abfd4f18756aa110299fc9c2c5..17462fdc5beb73c33d7de4e77f806c1d0ac8c7b3 100644 >--- a/Source/WebCore/svg/SVGFECompositeElement.h >+++ b/Source/WebCore/svg/SVGFECompositeElement.h >@@ -26,58 +26,6 @@ > > 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); > public: >diff --git a/Source/WebCore/svg/SVGFEConvolveMatrixElement.h b/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >index cea1123faa918d5f1f15d2d433ec011f70211002..e40111a053c0d9727c611da3c22d95b35a73b454 100644 >--- a/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >+++ b/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >@@ -25,40 +25,6 @@ > > 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); > public: >diff --git a/Source/WebCore/svg/SVGFEDisplacementMapElement.h b/Source/WebCore/svg/SVGFEDisplacementMapElement.h >index 422f0cf7ea9505427b07bf0aefffb3b8444197fa..c1a70cf5f230d51d77c07c8c19e4fbab4354196e 100644 >--- a/Source/WebCore/svg/SVGFEDisplacementMapElement.h >+++ b/Source/WebCore/svg/SVGFEDisplacementMapElement.h >@@ -25,43 +25,6 @@ > > 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); > public: >diff --git a/Source/WebCore/svg/SVGFEMorphologyElement.h b/Source/WebCore/svg/SVGFEMorphologyElement.h >index 99933555361a20541577b11245b48239b6d33b2d..050de080ca3943a69dd4d5a0f126433f50980028 100644 >--- a/Source/WebCore/svg/SVGFEMorphologyElement.h >+++ b/Source/WebCore/svg/SVGFEMorphologyElement.h >@@ -25,35 +25,6 @@ > > 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); > public: >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..ec3701762df8e6d061e5c1582facc3325e5a4326 100644 >--- a/Source/WebCore/svg/SVGFETurbulenceElement.h >+++ b/Source/WebCore/svg/SVGFETurbulenceElement.h >@@ -26,73 +26,16 @@ > > 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); > 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(); } >@@ -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/SVGFitToViewBox.cpp b/Source/WebCore/svg/SVGFitToViewBox.cpp >index d15e3546c1213e00dfa57c81b4a00b2efe30a973..bbb2978a40bf804188a88bfdebfcc34dc55adacd 100644 >--- a/Source/WebCore/svg/SVGFitToViewBox.cpp >+++ b/Source/WebCore/svg/SVGFitToViewBox.cpp >@@ -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..fcb69011b067839aea9e9fbee45ac30faf924e22 100644 >--- a/Source/WebCore/svg/SVGFitToViewBox.h >+++ b/Source/WebCore/svg/SVGFitToViewBox.h >@@ -64,9 +64,9 @@ protected: > 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: > Ref<SVGAnimatedRect> m_viewBox; >diff --git a/Source/WebCore/svg/SVGGradientElement.h b/Source/WebCore/svg/SVGGradientElement.h >index 21b210c5951dcb1cec5c642ea89ec3622481f7af..2613e886375ad869c5ffbc21dec0d4501e41186e 100644 >--- a/Source/WebCore/svg/SVGGradientElement.h >+++ b/Source/WebCore/svg/SVGGradientElement.h >@@ -30,46 +30,6 @@ > > 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: >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/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/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/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/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/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/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/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/SVGTextContentElement.h b/Source/WebCore/svg/SVGTextContentElement.h >index 0e6da5c67785cf41657434aa2b95c6fc17e0f0dc..411977970b33775c5abfe2a632cbcd028c33773a 100644 >--- a/Source/WebCore/svg/SVGTextContentElement.h >+++ b/Source/WebCore/svg/SVGTextContentElement.h >@@ -28,40 +28,6 @@ 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: >diff --git a/Source/WebCore/svg/SVGTextPathElement.h b/Source/WebCore/svg/SVGTextPathElement.h >index 435387bfaf57be437f9da25eba5697c77fba7c9d..8f295d70e54cb10fd0d4f04cd67904db99651ed0 100644 >--- a/Source/WebCore/svg/SVGTextPathElement.h >+++ b/Source/WebCore/svg/SVGTextPathElement.h >@@ -26,76 +26,6 @@ > > 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); > public: >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/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/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/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..557799576d7fbe7624aee5a712a07263a5eb2e03 100644 >--- a/Source/WebCore/svg/SVGViewSpec.h >+++ b/Source/WebCore/svg/SVGViewSpec.h >@@ -36,7 +36,7 @@ public: > return adoptRef(*new SVGViewSpec(contextElement)); > } > >- bool parseViewSpec(const String&); >+ SVGParsingError parseViewSpec(const String&); > void reset(); > void resetContextElement() { m_contextElement = nullptr; } > >@@ -51,6 +51,8 @@ public: > private: > explicit SVGViewSpec(SVGElement&); > >+ SVGParsingError parseAttribute(const QualifiedName&, const AtomicString&); >+ > using PropertyRegistry = SVGPropertyOwnerRegistry<SVGViewSpec, SVGFitToViewBox>; > > WeakPtr<SVGElement> m_contextElement; >diff --git a/Source/WebCore/svg/SVGZoomAndPan.cpp b/Source/WebCore/svg/SVGZoomAndPan.cpp >index 14d8fcb77ea5801d65109f453da250362311276d..3924f83d87474cb19d8c268293b1707bce77c7e7 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 { }; > >- 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/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..4b5f91ad981da9ba7f7a4cb416791d3df25816b3 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGEnumTraits.h >@@ -0,0 +1,99 @@ >+/* >+ * 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 T, typename EnumType> struct SVGEnumValueChecker; >+ >+template<typename EnumType> struct SVGEnumValueParser; >+ >+template<typename EnumType> struct SVGEnumValueComposer; >+ >+template<typename T, typename EnumType> >+struct SVGEnumValueChecker { >+ static constexpr bool isValidEnum(T t) >+ { >+ 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; >+ } >+}; >+ >+template<typename EnumType> >+struct SVGEnumValueParser { >+ 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); >+ } >+}; >+ >+template<typename EnumType> >+struct SVGEnumValueComposer { >+ 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(); >+ } >+}; >+ >+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"); >+ return SVGEnumValueChecker<T, EnumType>::isValidEnum(t); >+ } >+ static constexpr Expected<EnumType, SVGParsingError> parse(const String& string) >+ { >+ return SVGEnumValueParser<EnumType>::parse(string); >+ } >+ static constexpr EnumType fromString(const String& string) { return parse(string).value_or(0); } >+ static String toString(EnumType value) { return SVGEnumValueComposer<EnumType>::toString(value); } >+}; >+ >+}; >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/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/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 e634ee134801adbfa697f407ca05250a02c77ae8..322c9ccaa7775bae28625d188486a91e2cf2fcb5 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,67 @@ >+2019-05-21 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-05-20 Gabe Giosia <giosia@google.com> > > Range getBoundingClientRect returning zero rect on simple text node with <br> before it >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index b9152e70ec7431af4639ac248704d180f93bffd1..e0384003aa2e31c5f90e18215401f7d0b7975b54 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,25 @@ >+2019-05-21 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-05-17 Rob Buis <rbuis@igalia.com> > > Implement imagesrcset and imagesizes attributes on link rel=preload >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 198073
:
370324
|
370367
|
370368
|
370395