| <!DOCTYPE html> |
| <title>Property value does not override the attribute value after invalid attribute is set</title> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script> |
| test(function() { |
| var marker = document.createElementNS("http://www.w3.org/2000/svg", "marker"); |
| assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE, "initial"); |
| |
| // Set to 'auto' via property. |
| marker.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO; |
| |
| // Set attribute to invalid value. |
| marker.setAttribute("orient", "aito"); |
| assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE, "initial"); |
| assert_equals(marker.orientAngle.baseVal.value, 0); |
| |
| // Read the attribute. |
| assert_equals(marker.getAttribute("orient"), "aito", "attribute value unchanged"); |
| }, document.title+', setting orientType.'); |
| |
| test(function() { |
| var marker = document.createElementNS("http://www.w3.org/2000/svg", "marker"); |
| assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE, "initial"); |
| marker.orientAngle.baseVal.value = 90; |
| |
| // Set attribute to invalid value. |
| marker.setAttribute("orient", "aito"); |
| assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE, "initial"); |
| assert_equals(marker.orientAngle.baseVal.value, 0); |
| |
| // Read the attribute. |
| assert_equals(marker.getAttribute("orient"), "aito", "attribute value unchanged"); |
| }, document.title+', setting orientAngle.'); |
| </script> |