Skip to content

Commit

Permalink
Expose auto-start-reverse enum value
Browse files Browse the repository at this point in the history
Per w3c/svgwg#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
  • Loading branch information
longsonr authored and moz-wptsync-bot committed Jan 8, 2021
1 parent e265ce2 commit 17829ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -94,4 +94,4 @@
runAnimationTest(t, expectedValues);
});

</script>
</script>
13 changes: 11 additions & 2 deletions svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -110,4 +119,4 @@
assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO);
assert_equals(markerElement.getAttribute('orient'), "auto");
});
</script>
</script>

0 comments on commit 17829ff

Please sign in to comment.