From 17829ff81b64472b0dd6d280a5597078a95ec6a9 Mon Sep 17 00:00:00 2001 From: longsonr Date: Fri, 8 Jan 2021 07:34:19 +0000 Subject: [PATCH] Expose auto-start-reverse enum value Per https://github.com/w3c/svgwg/issues/424 we should expose the new value in webidl Differential Revision: https://phabricator.services.mozilla.com/D101089 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1685543 gecko-commit: d7cb06b275cdb59f99aa6ff14e5f6de6ff200723 gecko-reviewers: emilio --- ...rker-orient-from-auto-to-auto-start-reverse.html | 4 ++-- .../SVGAnimatedEnumeration-SVGMarkerElement.html | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html b/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html index fedfe4a8c2818a..b7a4e68562da57 100644 --- a/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html +++ b/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html @@ -76,7 +76,7 @@ assert_approx_equals(marker.orientAngle.animVal.value, 0, epsilon); assert_equals(marker.orientAngle.baseVal.value, 0); - assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN); + assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO_START_REVERSE); assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE); } @@ -94,4 +94,4 @@ runAnimationTest(t, expectedValues); }); - \ No newline at end of file + diff --git a/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html b/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html index 7ac884ae3e5052..dfc9dd248007c9 100644 --- a/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html +++ b/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html @@ -90,8 +90,17 @@ markerElement.setAttribute('orient', '10deg'); + // Switch to 'auto-start-reverse' value - by modifying orientType. + markerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO_START_REVERSE; + assert_equals(markerElement.orientAngle.baseVal.value, 0); + assert_equals(markerElement.orientAngle.baseVal.unitType, SVGAngle.SVG_ANGLETYPE_UNSPECIFIED); + assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO_START_REVERSE); + assert_equals(markerElement.getAttribute('orient'), "auto-start-reverse"); + + markerElement.setAttribute('orient', '10deg'); + // Try setting invalid values. - assert_throws_js(TypeError, function() { markerElement.orientType.baseVal = 3; }); + assert_throws_js(TypeError, function() { markerElement.orientType.baseVal = 4; }); assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE); assert_equals(markerElement.getAttribute('orient'), "10deg"); @@ -110,4 +119,4 @@ assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO); assert_equals(markerElement.getAttribute('orient'), "auto"); }); - \ No newline at end of file +