|
| 1 | +<!DOCTYPE html> |
| 2 | +<title>SVGMarkerElement.orientType synchronization</title> |
| 3 | +<link rel="help" href="https://svgwg.org/svg2-draft/painting.html#InterfaceSVGMarkerElement"> |
| 4 | +<link rel="help" href="https://svgwg.org/svg2-draft/types.html#InterfaceSVGAngle"> |
| 5 | +<script src="/resources/testharness.js"></script> |
| 6 | +<script src="/resources/testharnessreport.js"></script> |
| 7 | +<script> |
| 8 | +test(function() { |
| 9 | + const marker = document.createElementNS('http://www.w3.org/2000/svg', 'marker'); |
| 10 | + assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE, 'initial'); |
| 11 | + |
| 12 | + marker.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO; |
| 13 | + assert_equals(marker.getAttribute('orient'), 'auto'); |
| 14 | + assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO, `to 'auto'`); |
| 15 | +}, `${document.title}, setting orientType to 'auto'`); |
| 16 | + |
| 17 | +test(function() { |
| 18 | + const marker = document.createElementNS('http://www.w3.org/2000/svg', 'marker'); |
| 19 | + assert_false(marker.hasAttribute('orient')); |
| 20 | + |
| 21 | + marker.setOrientToAuto(); |
| 22 | + assert_equals(marker.getAttribute('orient'), 'auto'); |
| 23 | + |
| 24 | + marker.orientAngle.baseVal.valueInSpecifiedUnits = 1; |
| 25 | + assert_true(marker.hasAttribute('orient')); |
| 26 | + assert_equals(marker.getAttribute('orient'), '1'); |
| 27 | + assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE); |
| 28 | +}, `${document.title}, setting orientAngle using valueInSpecifiedUnits`); |
| 29 | +</script> |
0 commit comments