haikuwebkit/LayoutTests/svg/animations/animate-marker-orient-from-...

38 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

[SVG2] Implement marker orient='auto-start-reverse' https://bugs.webkit.org/show_bug.cgi?id=138456 Patch by Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> on 2016-03-08 Reviewed by Darin Adler. Source/WebCore: https://www.w3.org/TR/SVG2/painting.html#OrientAttribute marker-start markers must be oriented at 180 degrees to the direction of the path when the orient attribute of the marker is set to 'auto-start-reverse'. To acheive this the SVGMarkerData class which calculates the angles for each marker on a path must know whether the orient type is set to reverse the start marker. Tests: svg/animations/animate-marker-orient-from-angle-to-autostartreverse.html svg/animations/animate-marker-orienttype-4.html svg/custom/marker-auto-start-reverse.html * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::processMarkerPositions): Create marker data, using animated value of orient to determine if first marker should be reversed. * rendering/svg/SVGMarkerData.h: (WebCore::SVGMarkerData::SVGMarkerData): Constructor now requires boolean indicating if start marker is reversed. (WebCore::SVGMarkerData::currentAngle): Take into account whether start marker should be reversed. * rendering/svg/SVGResources.cpp: (WebCore::SVGResources::markerReverseStart): New function to query whether start marker should be reversed. * rendering/svg/SVGResources.h: Add declaration for new function. * svg/SVGAnimatedAngle.cpp: (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue): Support animation including the value auto-start-reverse. * svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::setOrient): Combine duplicated functionality into one private method (WebCore::SVGMarkerElement::setOrientToAuto): Set orient type and angle correctly for orient=auto. Uses setOrient. (WebCore::SVGMarkerElement::setOrientToAngle): Set orient type and angle correctly for orient=<angle>. Uses setOrient. (WebCore::SVGMarkerElement::synchronizeOrientType): Support auto-start-reverse as a possible case. * svg/SVGMarkerElement.h: (WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue): Limit the orient DOM property so that the new enum value required for auto-start-reverse is not exposed. (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue): Support auto-start-reverse. (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString): Support auto-start-reverse. LayoutTests: * svg/animations/animate-marker-orient-from-angle-to-autostartreverse-expected.txt: Added. * svg/animations/animate-marker-orient-from-angle-to-autostartreverse.html: Added. * svg/animations/animate-marker-orienttype-4-expected.html: Added. * svg/animations/animate-marker-orienttype-4.html: Added. Verify output after animation has run - ensure animation reflected in visual result. * svg/animations/script-tests/animate-marker-orient-from-angle-to-autostartreverse.js: Added. Test DOM values at various snap-shot times throughout the animation. (sample1): (sample2): (sample3): (executeTest): * svg/custom/marker-auto-start-reverse-expected.html: Added. * svg/custom/marker-auto-start-reverse.html: Added. Verify static result - start marker is oriented at 180 degrees to direction of path. * svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt: * svg/dom/script-tests/SVGAnimatedEnumeration-SVGMarkerElement.js: Check attributes are treated as case sensitive. Check UNKNOWN is returned for enum value when auto-start-reverse set. Canonical link: https://commits.webkit.org/173246@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 08:20:22 +00:00
SVG 2 dynamic animation tests
Animate SVGMarkerElement orientAttr from an angle to auto-start-reverse.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS SVGMarkerElement.SVG_MARKER_ORIENT_AUTOSTARTREVERSE is undefined
Drop legacy SVGException type https://bugs.webkit.org/show_bug.cgi?id=174695 Reviewed by Darin Adler. Source/WebCore: Drop legacy SVGException type and use DOMException instead, as per the latest SVG specification. Both Chrome and Firefox no longer expose the SVGException type. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * bindings/js/JSExceptionBase.cpp: (WebCore::toExceptionBase): * dom/DOMExceptions.in: * svg/SVGAllInOne.cpp: * svg/SVGCircleElement.cpp: * svg/SVGException.cpp: Removed. * svg/SVGException.h: Removed. * svg/SVGException.idl: Removed. * svg/SVGGraphicsElement.idl: * svg/SVGLocatable.cpp: (WebCore::SVGLocatable::getTransformToElement): * svg/SVGMatrixValue.h: * svg/SVGPathSegList.cpp: (WebCore::SVGPathSegList::getItem): (WebCore::SVGPathSegList::replaceItem): (WebCore::SVGPathSegList::removeItem): * svg/SVGPathSegList.h: * svg/SVGPathSegList.idl: * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: * svg/properties/SVGListProperty.h: LayoutTests: Update existing tests to reflect behavior change. * fast/dom/Window/resources/window-properties.js: * js/dom/global-constructors-attributes-expected.txt: * platform/gtk/js/dom/global-constructors-attributes-expected.txt: * platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt: * platform/mac-highsierra-wk1/js/dom/global-constructors-attributes-expected.txt: * platform/mac-highsierra/js/dom/global-constructors-attributes-expected.txt: * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt: * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt: * platform/mac/js/dom/global-constructors-attributes-expected.txt: * platform/win/js/dom/global-constructors-attributes-expected.txt: * platform/wpe/js/dom/global-constructors-attributes-expected.txt: * svg/animations/animate-marker-orient-from-angle-to-autostartreverse-expected.txt: * svg/custom/SVGException-expected.txt: Removed. * svg/custom/SVGException.html: Removed. * svg/custom/global-constructors-expected.txt: * svg/custom/global-constructors.html: * svg/custom/js-svg-constructors-expected.txt: * svg/custom/js-svg-constructors.svg: * svg/dom/SVGAnimatedEnumeration-SVGClipPathElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGComponentTransferFunctionElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGFEColorMatrixElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGFEDisplacementMapElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGFEMorphologyElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGFETurbulenceElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGFilterElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGGradientElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGMaskElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGPatternElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGTextContentElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-SVGTextPathElement-expected.txt: * svg/dom/SVGAnimatedEnumeration-expected.txt: * svg/dom/SVGException-obsolete-expected.txt: Added. * svg/dom/SVGException-obsolete.html: Added. * svg/dom/SVGMatrix-interface-expected.txt: * svg/dom/svglist-exception-on-out-bounds-error-expected.txt: * svg/filters/feBlend-invalid-mode-expected.txt: * svg/filters/feComponentTransfer-style-crash-expected.txt: * svg/filters/feDisplacementMap-crash-test-expected.txt: Canonical link: https://commits.webkit.org/191521@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-21 02:36:52 +00:00
PASS marker.orientType.baseVal = 3 threw exception TypeError: Type error.
[SVG2] Implement marker orient='auto-start-reverse' https://bugs.webkit.org/show_bug.cgi?id=138456 Patch by Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> on 2016-03-08 Reviewed by Darin Adler. Source/WebCore: https://www.w3.org/TR/SVG2/painting.html#OrientAttribute marker-start markers must be oriented at 180 degrees to the direction of the path when the orient attribute of the marker is set to 'auto-start-reverse'. To acheive this the SVGMarkerData class which calculates the angles for each marker on a path must know whether the orient type is set to reverse the start marker. Tests: svg/animations/animate-marker-orient-from-angle-to-autostartreverse.html svg/animations/animate-marker-orienttype-4.html svg/custom/marker-auto-start-reverse.html * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::processMarkerPositions): Create marker data, using animated value of orient to determine if first marker should be reversed. * rendering/svg/SVGMarkerData.h: (WebCore::SVGMarkerData::SVGMarkerData): Constructor now requires boolean indicating if start marker is reversed. (WebCore::SVGMarkerData::currentAngle): Take into account whether start marker should be reversed. * rendering/svg/SVGResources.cpp: (WebCore::SVGResources::markerReverseStart): New function to query whether start marker should be reversed. * rendering/svg/SVGResources.h: Add declaration for new function. * svg/SVGAnimatedAngle.cpp: (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue): Support animation including the value auto-start-reverse. * svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::setOrient): Combine duplicated functionality into one private method (WebCore::SVGMarkerElement::setOrientToAuto): Set orient type and angle correctly for orient=auto. Uses setOrient. (WebCore::SVGMarkerElement::setOrientToAngle): Set orient type and angle correctly for orient=<angle>. Uses setOrient. (WebCore::SVGMarkerElement::synchronizeOrientType): Support auto-start-reverse as a possible case. * svg/SVGMarkerElement.h: (WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue): Limit the orient DOM property so that the new enum value required for auto-start-reverse is not exposed. (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue): Support auto-start-reverse. (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString): Support auto-start-reverse. LayoutTests: * svg/animations/animate-marker-orient-from-angle-to-autostartreverse-expected.txt: Added. * svg/animations/animate-marker-orient-from-angle-to-autostartreverse.html: Added. * svg/animations/animate-marker-orienttype-4-expected.html: Added. * svg/animations/animate-marker-orienttype-4.html: Added. Verify output after animation has run - ensure animation reflected in visual result. * svg/animations/script-tests/animate-marker-orient-from-angle-to-autostartreverse.js: Added. Test DOM values at various snap-shot times throughout the animation. (sample1): (sample2): (sample3): (executeTest): * svg/custom/marker-auto-start-reverse-expected.html: Added. * svg/custom/marker-auto-start-reverse.html: Added. Verify static result - start marker is oriented at 180 degrees to direction of path. * svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt: * svg/dom/script-tests/SVGAnimatedEnumeration-SVGMarkerElement.js: Check attributes are treated as case sensitive. Check UNKNOWN is returned for enum value when auto-start-reverse set. Canonical link: https://commits.webkit.org/173246@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 08:20:22 +00:00
PASS marker.orientAngle.animVal.value is 0
PASS marker.orientAngle.baseVal.value is 0
PASS marker.orientType.animVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
PASS marker.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
PASS marker.orientAngle.animVal.value is 90
PASS marker.orientAngle.baseVal.value is 0
PASS marker.orientType.animVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
PASS marker.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
PASS marker.orientAngle.animVal.value is 90
PASS marker.orientAngle.baseVal.value is 0
PASS marker.orientType.animVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
PASS marker.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
PASS marker.orientAngle.animVal.value is 0
PASS marker.orientAngle.baseVal.value is 0
PASS marker.orientType.animVal is SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN
PASS marker.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
PASS marker.orientAngle.animVal.value is 0
PASS marker.orientAngle.baseVal.value is 0
PASS marker.orientType.animVal is SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN
PASS marker.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
PASS marker.orientAngle.animVal.value is 0
PASS marker.orientAngle.baseVal.value is 0
PASS marker.orientType.animVal is SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN
PASS marker.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
PASS successfullyParsed is true
TEST COMPLETE