<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[197738] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/197738">197738</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-03-08 00:20:22 -0800 (Tue, 08 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[SVG2] Implement marker orient='auto-start-reverse'
https://bugs.webkit.org/show_bug.cgi?id=138456

Patch by Nikos Andronikos &lt;nikos.andronikos-webkit@cisra.canon.com.au&gt; 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=&lt;angle&gt;. Uses setOrient.
(WebCore::SVGMarkerElement::synchronizeOrientType):
  Support auto-start-reverse as a possible case.
* svg/SVGMarkerElement.h:
(WebCore::SVGIDLEnumLimits&lt;SVGMarkerOrientType&gt;::highestExposedEnumValue):
  Limit the orient DOM property so that the new enum value
  required for auto-start-reverse is not exposed.
(WebCore::SVGPropertyTraits&lt;SVGMarkerOrientType&gt;::highestEnumValue):
  Support auto-start-reverse.
(WebCore::SVGPropertyTraits&lt;SVGMarkerOrientType&gt;::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.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestssvgdomSVGAnimatedEnumerationSVGMarkerElementexpectedtxt">trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgdomscripttestsSVGAnimatedEnumerationSVGMarkerElementjs">trunk/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGMarkerElement.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGShapecpp">trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGMarkerDatah">trunk/Source/WebCore/rendering/svg/SVGMarkerData.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGResourcescpp">trunk/Source/WebCore/rendering/svg/SVGResources.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGResourcesh">trunk/Source/WebCore/rendering/svg/SVGResources.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimatedAnglecpp">trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGMarkerElementcpp">trunk/Source/WebCore/svg/SVGMarkerElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGMarkerElementh">trunk/Source/WebCore/svg/SVGMarkerElement.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvganimationsanimatemarkerorientfromangletoautostartreverseexpectedtxt">trunk/LayoutTests/svg/animations/animate-marker-orient-from-angle-to-autostartreverse-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvganimationsanimatemarkerorientfromangletoautostartreversehtml">trunk/LayoutTests/svg/animations/animate-marker-orient-from-angle-to-autostartreverse.html</a></li>
<li><a href="#trunkLayoutTestssvganimationsanimatemarkerorienttype4expectedhtml">trunk/LayoutTests/svg/animations/animate-marker-orienttype-4-expected.html</a></li>
<li><a href="#trunkLayoutTestssvganimationsanimatemarkerorienttype4html">trunk/LayoutTests/svg/animations/animate-marker-orienttype-4.html</a></li>
<li><a href="#trunkLayoutTestssvganimationsscripttestsanimatemarkerorientfromangletoautostartreversejs">trunk/LayoutTests/svg/animations/script-tests/animate-marker-orient-from-angle-to-autostartreverse.js</a></li>
<li><a href="#trunkLayoutTestssvgcustommarkerautostartreverseexpectedhtml">trunk/LayoutTests/svg/custom/marker-auto-start-reverse-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgcustommarkerautostartreversehtml">trunk/LayoutTests/svg/custom/marker-auto-start-reverse.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (197737 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-08 08:16:29 UTC (rev 197737)
+++ trunk/LayoutTests/ChangeLog        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2016-03-08  Nikos Andronikos  &lt;nikos.andronikos-webkit@cisra.canon.com.au&gt;
+
+        [SVG2] Implement marker orient='auto-start-reverse'
+        https://bugs.webkit.org/show_bug.cgi?id=138456
+
+        Reviewed by Darin Adler.
+
+        * 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.
+
</ins><span class="cx"> 2016-03-07  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Stop clamping HTMLElement.tabIndex to the range of a short
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimatemarkerorientfromangletoautostartreverseexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animate-marker-orient-from-angle-to-autostartreverse-expected.txt (0 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animate-marker-orient-from-angle-to-autostartreverse-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animate-marker-orient-from-angle-to-autostartreverse-expected.txt        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+SVG 2 dynamic animation tests
+
+Animate SVGMarkerElement orientAttr from an angle to auto-start-reverse.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS SVGMarkerElement.SVG_MARKER_ORIENT_AUTOSTARTREVERSE is undefined
+PASS marker.orientType.baseVal = 3 threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1.
+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
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimatemarkerorientfromangletoautostartreversehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animate-marker-orient-from-angle-to-autostartreverse.html (0 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animate-marker-orient-from-angle-to-autostartreverse.html                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animate-marker-orient-from-angle-to-autostartreverse.html        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../dynamic-updates/resources/SVGTestCase.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/SVGAnimationTestCase.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runSMILTest()&quot;&gt;
+&lt;h1&gt;SVG 2 dynamic animation tests&lt;/h1&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;script src=&quot;script-tests/animate-marker-orient-from-angle-to-autostartreverse.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimatemarkerorienttype4expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animate-marker-orienttype-4-expected.html (0 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animate-marker-orienttype-4-expected.html                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animate-marker-orienttype-4-expected.html        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 1000 1000&quot; width=&quot;500&quot; height=&quot;500&quot;&gt;
+    &lt;defs&gt;
+        &lt;marker id=&quot;arrow1&quot; orient=&quot;auto&quot; markerWidth=&quot;10&quot; markerHeight=&quot;10&quot; style=&quot;overflow:visible&quot;&gt;
+            &lt;path d=&quot;M50,0 L 0,-50 L0,50 z&quot; fill=&quot;skyblue&quot; /&gt;
+        &lt;/marker&gt;
+         &lt;marker id=&quot;arrow2&quot; orient=&quot;auto-start-reverse&quot; markerWidth=&quot;10&quot; markerHeight=&quot;10&quot; style=&quot;overflow:visible&quot;&gt;
+            &lt;path d=&quot;M50,0 L 0,-50 L0,50 z&quot; fill=&quot;skyblue&quot; /&gt;
+        &lt;/marker&gt;
+         &lt;marker id=&quot;arrow3&quot; orient=&quot;77&quot; markerWidth=&quot;10&quot; markerHeight=&quot;10&quot; style=&quot;overflow:visible&quot;&gt;
+            &lt;path d=&quot;M50,0 L 0,-50 L0,50 z&quot; fill=&quot;skyblue&quot; /&gt;
+        &lt;/marker&gt;
+         &lt;marker id=&quot;arrow4&quot; orient=&quot;auto-start-reverse&quot; markerWidth=&quot;10&quot; markerHeight=&quot;10&quot; style=&quot;overflow:visible&quot;&gt;
+            &lt;path d=&quot;M50,0 L 0,-50 L0,50 z&quot; fill=&quot;skyblue&quot; /&gt;
+        &lt;/marker&gt;
+    &lt;/defs&gt;
+    &lt;path d=&quot;M 200,200 h 600&quot; marker-start=&quot;url(#arrow1)&quot; marker-end=&quot;url(#arrow1)&quot; stroke=&quot;black&quot;/&gt;
+    &lt;path d=&quot;M 200,400 h 600&quot; marker-start=&quot;url(#arrow2)&quot; marker-end=&quot;url(#arrow2)&quot; stroke=&quot;black&quot;/&gt;
+    &lt;path d=&quot;M 200,600 h 600&quot; marker-start=&quot;url(#arrow3)&quot; marker-end=&quot;url(#arrow3)&quot; stroke=&quot;black&quot;/&gt;
+    &lt;path d=&quot;M 200,800 h 600&quot; marker-start=&quot;url(#arrow4)&quot; marker-end=&quot;url(#arrow4)&quot; stroke=&quot;black&quot;/&gt;
+&lt;/svg&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimatemarkerorienttype4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animate-marker-orienttype-4.html (0 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animate-marker-orienttype-4.html                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animate-marker-orienttype-4.html        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;!--
+  Test that the renderer uses the animated value of orientType.
+  To test this, the final animated value must be of a different type than the initial value.
+ --&gt;
+&lt;script&gt;
+function doTest() {
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+    var svg = document.querySelector(&quot;#svg&quot;);
+    svg.setCurrentTime(5);
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+&lt;/script&gt;
+&lt;svg id=&quot;svg&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 1000 1000&quot; width=&quot;500&quot; height=&quot;500&quot; onload=&quot;doTest()&quot;&gt;
+    &lt;defs&gt;
+        &lt;marker id=&quot;arrow1&quot; orient=&quot;auto-start-reverse&quot; markerWidth=&quot;10&quot; markerHeight=&quot;10&quot; style=&quot;overflow:visible&quot;&gt;
+            &lt;path d=&quot;M50,0 L 0,-50 L0,50 z&quot; fill=&quot;skyblue&quot;/&gt;
+            &lt;animate attributeName=&quot;orient&quot; from=&quot;auto-start-reverse&quot; to=&quot;auto&quot; begin=&quot;0s&quot; dur=&quot;1s&quot; fill=&quot;freeze&quot;/&gt;
+        &lt;/marker&gt;
+         &lt;marker id=&quot;arrow2&quot; orient=&quot;90&quot; markerWidth=&quot;10&quot; markerHeight=&quot;10&quot; style=&quot;overflow:visible&quot;&gt;
+            &lt;path d=&quot;M50,0 L 0,-50 L0,50 z&quot; fill=&quot;skyblue&quot;/&gt;
+            &lt;animate attributeName=&quot;orient&quot; from=&quot;auto&quot; to=&quot;auto-start-reverse&quot; begin=&quot;0s&quot; dur=&quot;1s&quot; fill=&quot;freeze&quot;/&gt;
+        &lt;/marker&gt;
+         &lt;marker id=&quot;arrow3&quot; orient=&quot;auto&quot; markerWidth=&quot;10&quot; markerHeight=&quot;10&quot; style=&quot;overflow:visible&quot;&gt;
+            &lt;path d=&quot;M50,0 L 0,-50 L0,50 z&quot; fill=&quot;skyblue&quot;/&gt;
+            &lt;animate attributeName=&quot;orient&quot; from=&quot;auto-start-reverse&quot; to=&quot;77&quot; begin=&quot;0s&quot; dur=&quot;1s&quot; fill=&quot;freeze&quot;/&gt;
+        &lt;/marker&gt;
+         &lt;marker id=&quot;arrow4&quot; orient=&quot;123&quot; markerWidth=&quot;10&quot; markerHeight=&quot;10&quot; style=&quot;overflow:visible&quot;&gt;
+            &lt;path d=&quot;M50,0 L 0,-50 L0,50 z&quot; fill=&quot;skyblue&quot;/&gt;
+            &lt;animate attributeName=&quot;orient&quot; from=&quot;123&quot; to=&quot;auto-start-reverse&quot; begin=&quot;0s&quot; dur=&quot;1s&quot; fill=&quot;freeze&quot;/&gt;
+        &lt;/marker&gt;
+        &lt;path d=&quot;M50,0 L 0,-50 L0,50 z&quot; transform=&quot;scale(0.8) translate(5)&quot; id=&quot;pointer&quot; fill=&quot;red&quot;/&gt;
+    &lt;/defs&gt;
+    &lt;use xlink:href=&quot;#pointer&quot; transform=&quot;translate(200,200) rotate(0)&quot;/&gt;
+    &lt;use xlink:href=&quot;#pointer&quot; transform=&quot;translate(800,200) rotate(0)&quot;/&gt;
+    &lt;path d=&quot;M 200,200 h 600&quot; marker-start=&quot;url(#arrow1)&quot; marker-end=&quot;url(#arrow1)&quot; stroke=&quot;black&quot;/&gt;
+    &lt;use xlink:href=&quot;#pointer&quot; transform=&quot;translate(200,400) rotate(180)&quot;/&gt;
+    &lt;use xlink:href=&quot;#pointer&quot; transform=&quot;translate(800,400) rotate(0)&quot;/&gt;
+    &lt;path d=&quot;M 200,400 h 600&quot; marker-start=&quot;url(#arrow2)&quot; marker-end=&quot;url(#arrow2)&quot; stroke=&quot;black&quot;/&gt;
+    &lt;use xlink:href=&quot;#pointer&quot; transform=&quot;translate(200,600) rotate(77)&quot;/&gt;
+    &lt;use xlink:href=&quot;#pointer&quot; transform=&quot;translate(800,600) rotate(77)&quot;/&gt;
+    &lt;path d=&quot;M 200,600 h 600&quot; marker-start=&quot;url(#arrow3)&quot; marker-end=&quot;url(#arrow3)&quot; stroke=&quot;black&quot;/&gt;
+    &lt;use xlink:href=&quot;#pointer&quot; transform=&quot;translate(200,800) rotate(180)&quot;/&gt;
+    &lt;use xlink:href=&quot;#pointer&quot; transform=&quot;translate(800,800) rotate(0)&quot;/&gt;
+    &lt;path d=&quot;M 200,800 h 600&quot; marker-start=&quot;url(#arrow4)&quot; marker-end=&quot;url(#arrow4)&quot; stroke=&quot;black&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsscripttestsanimatemarkerorientfromangletoautostartreversejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/script-tests/animate-marker-orient-from-angle-to-autostartreverse.js (0 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/script-tests/animate-marker-orient-from-angle-to-autostartreverse.js                                (rev 0)
+++ trunk/LayoutTests/svg/animations/script-tests/animate-marker-orient-from-angle-to-autostartreverse.js        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+description(&quot;Animate SVGMarkerElement orientAttr from an angle to auto-start-reverse.&quot;);
+createSVGTestCase();
+
+// Setup test document.
+
+var marker = createSVGElement(&quot;marker&quot;);
+marker.setAttribute(&quot;id&quot;, &quot;marker&quot;);
+marker.setAttribute(&quot;viewBox&quot;, &quot;0 0 10 10&quot;);
+marker.setAttribute(&quot;markerWidth&quot;, &quot;2&quot;);
+marker.setAttribute(&quot;markerHeight&quot;, &quot;2&quot;);
+marker.setAttribute(&quot;refX&quot;, &quot;5&quot;);
+marker.setAttribute(&quot;refY&quot;, &quot;5&quot;);
+marker.setAttribute(&quot;markerUnits&quot;, &quot;strokeWidth&quot;);
+
+var markerPath = createSVGElement(&quot;path&quot;);
+markerPath.setAttribute(&quot;fill&quot;, &quot;blue&quot;);
+markerPath.setAttribute(&quot;d&quot;, &quot;M 5 0 L 10 10 L 0 10 Z&quot;);
+marker.appendChild(markerPath);
+
+var defsElement = createSVGElement(&quot;defs&quot;);
+defsElement.appendChild(marker);
+rootSVGElement.appendChild(defsElement);
+
+var path = createSVGElement(&quot;path&quot;);
+path.setAttribute(&quot;id&quot;, &quot;path&quot;);
+path.setAttribute(&quot;onclick&quot;, &quot;executeTest()&quot;);
+path.setAttribute(&quot;fill&quot;, &quot;none&quot;);
+path.setAttribute(&quot;stroke&quot;, &quot;green&quot;);
+path.setAttribute(&quot;stroke-width&quot;, &quot;10&quot;);
+path.setAttribute(&quot;marker-start&quot;, &quot;url(#marker)&quot;);
+path.setAttribute(&quot;marker-end&quot;, &quot;url(#marker)&quot;);
+path.setAttribute(&quot;d&quot;, &quot;M 130 135 L 180 135 L 180 185&quot;);
+path.setAttribute(&quot;transform&quot;, &quot;translate(-130, -120)&quot;);
+rootSVGElement.appendChild(path);
+
+var animate1 = createSVGElement(&quot;animate&quot;);
+animate1.setAttribute(&quot;id&quot;, &quot;animation&quot;);
+animate1.setAttribute(&quot;attributeName&quot;, &quot;orient&quot;);
+animate1.setAttribute(&quot;begin&quot;, &quot;path.click&quot;);
+animate1.setAttribute(&quot;dur&quot;, &quot;4s&quot;);
+animate1.setAttribute(&quot;from&quot;, &quot;90deg&quot;);
+animate1.setAttribute(&quot;to&quot;, &quot;auto-start-reverse&quot;);
+animate1.setAttribute(&quot;fill&quot;, &quot;freeze&quot;);
+marker.appendChild(animate1);
+
+// Setup animation test.
+function sample1() {
+    shouldBeCloseEnough(&quot;marker.orientAngle.animVal.value&quot;, &quot;0&quot;);
+    shouldBe(&quot;marker.orientAngle.baseVal.value&quot;, &quot;0&quot;);
+
+    shouldBe(&quot;marker.orientType.animVal&quot;, &quot;SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE&quot;);
+    shouldBe(&quot;marker.orientType.baseVal&quot;, &quot;SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE&quot;);
+}
+
+function sample2() {
+    shouldBeCloseEnough(&quot;marker.orientAngle.animVal.value&quot;, &quot;90&quot;);
+    shouldBe(&quot;marker.orientAngle.baseVal.value&quot;, &quot;0&quot;);
+
+    shouldBe(&quot;marker.orientType.animVal&quot;, &quot;SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE&quot;);
+    shouldBe(&quot;marker.orientType.baseVal&quot;, &quot;SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE&quot;);
+}
+
+function sample3() {
+    shouldBeCloseEnough(&quot;marker.orientAngle.animVal.value&quot;, &quot;0&quot;);
+    shouldBe(&quot;marker.orientAngle.baseVal.value&quot;, &quot;0&quot;);
+
+    shouldBe(&quot;marker.orientType.animVal&quot;, &quot;SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN&quot;);
+    shouldBe(&quot;marker.orientType.baseVal&quot;, &quot;SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE&quot;);
+}
+
+function executeTest() {
+    const expectedValues = [
+        // [animationId, time, sampleCallback]
+        [&quot;animation&quot;, 0.0,   sample1],
+        [&quot;animation&quot;, 0.001, sample2],
+        [&quot;animation&quot;, 1.999, sample2],
+        [&quot;animation&quot;, 2.001, sample3],
+        [&quot;animation&quot;, 3.999, sample3],
+        [&quot;animation&quot;, 4.001, sample3]
+    ];
+
+    // Ensure new enum value is not exposed through the IDL
+    shouldBe(&quot;SVGMarkerElement.SVG_MARKER_ORIENT_AUTOSTARTREVERSE&quot;, &quot;undefined&quot;);
+
+    // Ensure we cannot set autostartreverse through the orient property.
+    shouldThrow(&quot;marker.orientType.baseVal = 3&quot;);
+
+    runAnimationTest(expectedValues);
+}
+
+var successfullyParsed = true;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustommarkerautostartreverseexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/marker-auto-start-reverse-expected.html (0 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/marker-auto-start-reverse-expected.html                                (rev 0)
+++ trunk/LayoutTests/svg/custom/marker-auto-start-reverse-expected.html        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 100 100&quot; width=&quot;300&quot; height=&quot;300&quot;&gt;
+    &lt;defs&gt;
+        &lt;marker id=&quot;arrow&quot; orient=&quot;225&quot; markerWidth=&quot;10&quot; markerHeight=&quot;10&quot; style=&quot;overflow:visible&quot;&gt;
+            &lt;path d=&quot;M5,0 L 0,-5 L0,5 z&quot; fill=&quot;green&quot;/&gt;
+        &lt;/marker&gt;
+        &lt;marker id=&quot;arrow2&quot; orient=&quot;auto&quot; markerWidth=&quot;10&quot; markerHeight=&quot;10&quot; style=&quot;overflow:visible&quot;&gt;
+            &lt;path d=&quot;M5,0 L 0,-5 L0,5 z&quot; fill=&quot;green&quot;/&gt;
+        &lt;/marker&gt;
+     &lt;/defs&gt;
+    &lt;path d=&quot;M 20,20 L50,50 L 80,80&quot; marker-start=&quot;url(#arrow)&quot; marker-mid=&quot;url(#arrow2)&quot; marker-end=&quot;url(#arrow2)&quot; stroke=&quot;black&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustommarkerautostartreversehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/marker-auto-start-reverse.html (0 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/marker-auto-start-reverse.html                                (rev 0)
+++ trunk/LayoutTests/svg/custom/marker-auto-start-reverse.html        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;!-- 
+Reftest for auto-start-reverse value for orient property of marker element.
+Markers at each end of the path should point outwards. Middle marker should point along the direction of the path.
+--&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 100 100&quot; width=&quot;300&quot; height=&quot;300&quot;&gt;
+    &lt;defs&gt;
+        &lt;!-- Correct definition - uses lower case --&gt;
+        &lt;marker id=&quot;arrow&quot; orient=&quot;auto-start-reverse&quot; markerWidth=&quot;10&quot; markerHeight=&quot;10&quot; style=&quot;overflow:visible&quot;&gt;
+            &lt;path d=&quot;M5,0 L 0,-5 L0,5 z&quot; fill=&quot;green&quot;/&gt;
+        &lt;/marker&gt;
+     &lt;/defs&gt;
+    &lt;path d=&quot;M 20,20 l30,30 30,30&quot; marker-start=&quot;url(#arrow)&quot; marker-mid=&quot;url(#arrow)&quot; marker-end=&quot;url(#arrow)&quot; stroke=&quot;black&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgdomSVGAnimatedEnumerationSVGMarkerElementexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt (197737 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt        2016-03-08 08:16:29 UTC (rev 197737)
+++ trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -37,6 +37,13 @@
</span><span class="cx"> PASS markerElement.orientAngle.baseVal.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED
</span><span class="cx"> PASS markerElement.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_AUTO
</span><span class="cx"> 
</span><ins>+Switch to 'auto-start-reverse' value - by modifying the orient attribute.
+PASS markerElement.setAttribute('orient', 'auto-start-reverse') did not throw exception.
+PASS markerElement.orientAngle.baseVal.value is 0
+PASS markerElement.orientAngle.baseVal.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED
+PASS markerElement.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN
+PASS markerElement.getAttribute('orient') is &quot;auto-start-reverse&quot;
+
</ins><span class="cx"> Switch to 'Pi/2 rad' value - via setOrientToAngle()
</span><span class="cx"> PASS anglePiHalfRad = svgElement.createSVGAngle(); anglePiHalfRad.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_RAD, (Math.PI / 2).toFixed(2)) is undefined.
</span><span class="cx"> PASS markerElement.setOrientToAngle(anglePiHalfRad) is undefined.
</span><span class="lines">@@ -92,6 +99,14 @@
</span><span class="cx"> PASS markerElement.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
</span><span class="cx"> PASS markerElement.getAttribute('orient') is &quot;10deg&quot;
</span><span class="cx"> 
</span><ins>+Test case sensitivity of attributes - try setting invalid values
+PASS markerElement.setAttribute('orient', 'AUTO-START-REVERSE') did not throw exception.
+FAIL markerElement.getAttribute('orient') should be AUTO-START-REVERSE. Was 10deg.
+PASS markerElement.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
+PASS markerElement.setAttribute('orient', 'AUTO') did not throw exception.
+FAIL markerElement.getAttribute('orient') should be AUTO. Was 10deg.
+PASS markerElement.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
+
</ins><span class="cx"> Switch back to 'auto' value
</span><span class="cx"> PASS markerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO is SVGMarkerElement.SVG_MARKER_ORIENT_AUTO
</span><span class="cx"> PASS markerElement.orientAngle.baseVal.value is 10
</span></span></pre></div>
<a id="trunkLayoutTestssvgdomscripttestsSVGAnimatedEnumerationSVGMarkerElementjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGMarkerElement.js (197737 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGMarkerElement.js        2016-03-08 08:16:29 UTC (rev 197737)
+++ trunk/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGMarkerElement.js        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -49,6 +49,14 @@
</span><span class="cx"> shouldBe(&quot;markerElement.orientType.baseVal&quot;, &quot;SVGMarkerElement.SVG_MARKER_ORIENT_AUTO&quot;);
</span><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><ins>+debug(&quot;Switch to 'auto-start-reverse' value - by modifying the orient attribute.&quot;);
+shouldNotThrow(&quot;markerElement.setAttribute('orient', 'auto-start-reverse')&quot;);
+shouldBe(&quot;markerElement.orientAngle.baseVal.value&quot;, &quot;0&quot;);
+shouldBe(&quot;markerElement.orientAngle.baseVal.unitType&quot;, &quot;SVGAngle.SVG_ANGLETYPE_UNSPECIFIED&quot;);
+shouldBe(&quot;markerElement.orientType.baseVal&quot;, &quot;SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN&quot;);
+shouldBeEqualToString(&quot;markerElement.getAttribute('orient')&quot;, &quot;auto-start-reverse&quot;);
+
+debug(&quot;&quot;);
</ins><span class="cx"> debug(&quot;Switch to 'Pi/2 rad' value - via setOrientToAngle()&quot;);
</span><span class="cx"> shouldBeUndefined(&quot;anglePiHalfRad = svgElement.createSVGAngle(); anglePiHalfRad.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_RAD, (Math.PI / 2).toFixed(2))&quot;);
</span><span class="cx"> shouldBeUndefined(&quot;markerElement.setOrientToAngle(anglePiHalfRad)&quot;);
</span><span class="lines">@@ -113,6 +121,22 @@
</span><span class="cx"> shouldBeEqualToString(&quot;markerElement.getAttribute('orient')&quot;, &quot;10deg&quot;);
</span><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><ins>+debug(&quot;Test case sensitivity of attributes - try setting invalid values&quot;);
+shouldNotThrow(&quot;markerElement.setAttribute('orient', 'AUTO-START-REVERSE')&quot;);
+// The line below fails as a result of https://bugs.webkit.org/show_bug.cgi?id=154141
+// The attribute value is not updated to the invalid value.
+// The expected result recognises this and should be updated when the above bug
+// is resolved.
+// What's important here though is that the DOM values are unchanged, and this
+// is demonstrated correctly.
+shouldBeEqualToString(&quot;markerElement.getAttribute('orient')&quot;, &quot;AUTO-START-REVERSE&quot;);
+shouldBe(&quot;markerElement.orientType.baseVal&quot;, &quot;SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE&quot;);
+
+shouldNotThrow(&quot;markerElement.setAttribute('orient', 'AUTO')&quot;);
+shouldBeEqualToString(&quot;markerElement.getAttribute('orient')&quot;, &quot;AUTO&quot;);
+shouldBe(&quot;markerElement.orientType.baseVal&quot;, &quot;SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE&quot;); 
+
+debug(&quot;&quot;);
</ins><span class="cx"> debug(&quot;Switch back to 'auto' value&quot;);
</span><span class="cx"> shouldBe(&quot;markerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO&quot;, &quot;SVGMarkerElement.SVG_MARKER_ORIENT_AUTO&quot;);
</span><span class="cx"> shouldBe(&quot;markerElement.orientAngle.baseVal.value&quot;, &quot;10&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197737 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-08 08:16:29 UTC (rev 197737)
+++ trunk/Source/WebCore/ChangeLog        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2016-03-08  Nikos Andronikos  &lt;nikos.andronikos-webkit@cisra.canon.com.au&gt;
+
+        [SVG2] Implement marker orient='auto-start-reverse'
+        https://bugs.webkit.org/show_bug.cgi?id=138456
+
+        Reviewed by Darin Adler.
+
+        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=&lt;angle&gt;. Uses setOrient.
+        (WebCore::SVGMarkerElement::synchronizeOrientType):
+          Support auto-start-reverse as a possible case.
+        * svg/SVGMarkerElement.h:
+        (WebCore::SVGIDLEnumLimits&lt;SVGMarkerOrientType&gt;::highestExposedEnumValue):
+          Limit the orient DOM property so that the new enum value
+          required for auto-start-reverse is not exposed.
+        (WebCore::SVGPropertyTraits&lt;SVGMarkerOrientType&gt;::highestEnumValue):
+          Support auto-start-reverse.
+        (WebCore::SVGPropertyTraits&lt;SVGMarkerOrientType&gt;::fromString):
+          Support auto-start-reverse.
+
</ins><span class="cx"> 2016-03-07  Keith Rollin  &lt;krollin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Enhance logging: Use &quot;always on&quot; macros
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGShapecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp (197737 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp        2016-03-08 08:16:29 UTC (rev 197737)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -482,7 +482,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_path);
</span><span class="cx"> 
</span><del>-    SVGMarkerData markerData(m_markerPositions);
</del><ins>+    SVGMarkerData markerData(m_markerPositions, SVGResourcesCache::cachedResourcesForRenderer(*this)-&gt;markerReverseStart());
</ins><span class="cx">     m_path-&gt;apply([&amp;markerData](const PathElement&amp; pathElement) {
</span><span class="cx">         SVGMarkerData::updateFromPathElement(markerData, pathElement);
</span><span class="cx">     });
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGMarkerDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGMarkerData.h (197737 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGMarkerData.h        2016-03-08 08:16:29 UTC (rev 197737)
+++ trunk/Source/WebCore/rendering/svg/SVGMarkerData.h        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -48,9 +48,10 @@
</span><span class="cx"> 
</span><span class="cx"> class SVGMarkerData {
</span><span class="cx"> public:
</span><del>-    SVGMarkerData(Vector&lt;MarkerPosition&gt;&amp; positions)
</del><ins>+    SVGMarkerData(Vector&lt;MarkerPosition&gt;&amp; positions, bool reverseStart)
</ins><span class="cx">         : m_positions(positions)
</span><span class="cx">         , m_elementIndex(0)
</span><ins>+        , m_reverseStart(reverseStart)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -87,6 +88,8 @@
</span><span class="cx"> 
</span><span class="cx">         switch (type) {
</span><span class="cx">         case StartMarker:
</span><ins>+            if (m_reverseStart)
+                return narrowPrecisionToFloat(outAngle - 180);
</ins><span class="cx">             return narrowPrecisionToFloat(outAngle);
</span><span class="cx">         case MidMarker:
</span><span class="cx">             // WK193015: Prevent bugs due to angles being non-continuous.
</span><span class="lines">@@ -147,6 +150,7 @@
</span><span class="cx">     FloatPoint m_subpathStart;
</span><span class="cx">     FloatPoint m_inslopePoints[2];
</span><span class="cx">     FloatPoint m_outslopePoints[2];
</span><ins>+    bool m_reverseStart;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGResourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGResources.cpp (197737 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGResources.cpp        2016-03-08 08:16:29 UTC (rev 197737)
+++ trunk/Source/WebCore/rendering/svg/SVGResources.cpp        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -305,6 +305,13 @@
</span><span class="cx">         markerEnd()-&gt;layoutIfNeeded();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool SVGResources::markerReverseStart() const
+{
+    return m_markerData
+        &amp;&amp; m_markerData-&gt;markerStart
+        &amp;&amp; m_markerData-&gt;markerStart-&gt;markerElement().orientType() == SVGMarkerOrientAutoStartReverse;
+}
+
</ins><span class="cx"> void SVGResources::removeClientFromCache(RenderElement&amp; renderer, bool markForInvalidation) const
</span><span class="cx"> {
</span><span class="cx">     if (!m_clipperFilterMaskerData &amp;&amp; !m_markerData &amp;&amp; !m_fillStrokeData &amp;&amp; !m_linkedResource)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGResourcesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGResources.h (197737 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGResources.h        2016-03-08 08:16:29 UTC (rev 197737)
+++ trunk/Source/WebCore/rendering/svg/SVGResources.h        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -20,6 +20,8 @@
</span><span class="cx"> #ifndef SVGResources_h
</span><span class="cx"> #define SVGResources_h
</span><span class="cx"> 
</span><ins>+#include &quot;RenderSVGResourceMarker.h&quot;
+
</ins><span class="cx"> #include &lt;memory&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="lines">@@ -52,6 +54,7 @@
</span><span class="cx">     RenderSVGResourceMarker* markerStart() const { return m_markerData ? m_markerData-&gt;markerStart : nullptr; }
</span><span class="cx">     RenderSVGResourceMarker* markerMid() const { return m_markerData ? m_markerData-&gt;markerMid : nullptr; }
</span><span class="cx">     RenderSVGResourceMarker* markerEnd() const { return m_markerData ? m_markerData-&gt;markerEnd : nullptr; }
</span><ins>+    bool markerReverseStart() const;
</ins><span class="cx">     RenderSVGResourceMasker* masker() const { return m_clipperFilterMaskerData ? m_clipperFilterMaskerData-&gt;masker : nullptr; }
</span><span class="cx">     RenderSVGResourceFilter* filter() const { return m_clipperFilterMaskerData ? m_clipperFilterMaskerData-&gt;filter : nullptr; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimatedAnglecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp (197737 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp        2016-03-08 08:16:29 UTC (rev 197737)
+++ trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">     std::pair&lt;SVGAngle, unsigned&gt;&amp; animatedPair = animatedType-&gt;angleAndEnumeration();
</span><span class="cx"> 
</span><span class="cx">     SVGAngle angle;
</span><del>-    SVGMarkerOrientType orientType = SVGPropertyTraits&lt;SVGMarkerOrientType&gt;::fromString(string,  angle);
</del><ins>+    SVGMarkerOrientType orientType = SVGPropertyTraits&lt;SVGMarkerOrientType&gt;::fromString(string, angle);
</ins><span class="cx">     if (orientType &gt; 0)
</span><span class="cx">         animatedPair.second = orientType;
</span><span class="cx">     if (orientType == SVGMarkerOrientAngle)
</span><span class="lines">@@ -113,28 +113,25 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // From 'auto' to 'auto'.
-    if (fromAngleAndEnumeration.second == SVGMarkerOrientAuto) {
-        animatedAngleAndEnumeration.first.setValue(0);
-        animatedAngleAndEnumeration.second = SVGMarkerOrientAuto;
-        return;
-    }
</del><ins>+    if (fromAngleAndEnumeration.second == SVGMarkerOrientAngle) {
+        // Regular from angle to angle animation, with support for smooth interpolation, and additive and accumulated animation.
+        animatedAngleAndEnumeration.second = SVGMarkerOrientAngle;
</ins><span class="cx"> 
</span><del>-    // If the enumeration value is not angle or auto, its unknown.
-    if (fromAngleAndEnumeration.second != SVGMarkerOrientAngle) {
-        animatedAngleAndEnumeration.first.setValue(0);
-        animatedAngleAndEnumeration.second = SVGMarkerOrientUnknown;
</del><ins>+        SVGAngle&amp; animatedSVGAngle = animatedAngleAndEnumeration.first;
+        const SVGAngle&amp; toAtEndOfDurationSVGAngle = toAtEndOfDurationAngleAndEnumeration.first;
+        float animatedAngle = animatedSVGAngle.value();
+        m_animationElement-&gt;animateAdditiveNumber(percentage, repeatCount, fromAngleAndEnumeration.first.value(), toAngleAndEnumeration.first.value(), toAtEndOfDurationSVGAngle.value(), animatedAngle);
+        animatedSVGAngle.setValue(animatedAngle);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // Regular from angle to angle animation, with all features like additive etc.
-    animatedAngleAndEnumeration.second = SVGMarkerOrientAngle;
</del><ins>+    // auto, auto-start-reverse, or unknown.
+    animatedAngleAndEnumeration.first.setValue(0);
</ins><span class="cx"> 
</span><del>-    SVGAngle&amp; animatedSVGAngle = animatedAngleAndEnumeration.first;
-    const SVGAngle&amp; toAtEndOfDurationSVGAngle = toAtEndOfDurationAngleAndEnumeration.first;
-    float animatedAngle = animatedSVGAngle.value();
-    m_animationElement-&gt;animateAdditiveNumber(percentage, repeatCount, fromAngleAndEnumeration.first.value(), toAngleAndEnumeration.first.value(), toAtEndOfDurationSVGAngle.value(), animatedAngle);
-    animatedSVGAngle.setValue(animatedAngle);
</del><ins>+    if (fromAngleAndEnumeration.second == SVGMarkerOrientAuto || fromAngleAndEnumeration.second == SVGMarkerOrientAutoStartReverse)
+        animatedAngleAndEnumeration.second = fromAngleAndEnumeration.second;
+    else
+        animatedAngleAndEnumeration.second = SVGMarkerOrientUnknown;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> float SVGAnimatedAngleAnimator::calculateDistance(const String&amp; fromString, const String&amp; toString)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGMarkerElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGMarkerElement.cpp (197737 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGMarkerElement.cpp        2016-03-08 08:16:29 UTC (rev 197737)
+++ trunk/Source/WebCore/svg/SVGMarkerElement.cpp        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -189,11 +189,11 @@
</span><span class="cx">         object-&gt;setNeedsLayout();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SVGMarkerElement::setOrientToAuto()
</del><ins>+void SVGMarkerElement::setOrient(SVGMarkerOrientType orientType, const SVGAngle&amp; angle)
</ins><span class="cx"> {
</span><del>-    setOrientTypeBaseValue(SVGMarkerOrientAuto);
-    setOrientAngleBaseValue(SVGAngle());

</del><ins>+    setOrientTypeBaseValue(orientType);
+    setOrientAngleBaseValue(angle);
+
</ins><span class="cx">     // Mark orientAttr dirty - the next XML DOM access of that attribute kicks in synchronization.
</span><span class="cx">     m_orientAngle.shouldSynchronize = true;
</span><span class="cx">     m_orientType.shouldSynchronize = true;
</span><span class="lines">@@ -201,16 +201,14 @@
</span><span class="cx">     svgAttributeChanged(orientAnglePropertyInfo()-&gt;attributeName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void SVGMarkerElement::setOrientToAuto()
+{
+    setOrient(SVGMarkerOrientAuto, { });
+}
+
</ins><span class="cx"> void SVGMarkerElement::setOrientToAngle(const SVGAngle&amp; angle)
</span><span class="cx"> {
</span><del>-    setOrientTypeBaseValue(SVGMarkerOrientAngle);
-    setOrientAngleBaseValue(angle);
-
-    // Mark orientAttr dirty - the next XML DOM access of that attribute kicks in synchronization.
-    m_orientAngle.shouldSynchronize = true;
-    m_orientType.shouldSynchronize = true;
-    invalidateSVGAttributes();
-    svgAttributeChanged(orientAnglePropertyInfo()-&gt;attributeName);
</del><ins>+    setOrient(SVGMarkerOrientAngle, angle);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderPtr&lt;RenderElement&gt; SVGMarkerElement::createElementRenderer(Ref&lt;RenderStyle&gt;&amp;&amp; style, const RenderTreePosition&amp;)
</span><span class="lines">@@ -233,12 +231,17 @@
</span><span class="cx">     if (!ownerType.m_orientType.shouldSynchronize)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    // If orient is not auto, the previous call to synchronizeOrientAngle already set the orientAttr to the right angle.
-    if (ownerType.m_orientType.value != SVGMarkerOrientAuto)
</del><ins>+    static NeverDestroyed&lt;AtomicString&gt; autoString(&quot;auto&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; autoStartReverseString(&quot;auto-start-reverse&quot;, AtomicString::ConstructFromLiteral);
+
+    // If orient is not auto or auto-start-reverse, the previous call to synchronizeOrientAngle already set the orientAttr to the right angle.
+    if (ownerType.m_orientType.value == SVGMarkerOrientAuto) {
+        ownerType.m_orientType.synchronize(&amp;ownerType, orientTypePropertyInfo()-&gt;attributeName, autoString);
</ins><span class="cx">         return;
</span><ins>+    }
</ins><span class="cx"> 
</span><del>-    static NeverDestroyed&lt;AtomicString&gt; autoString(&quot;auto&quot;, AtomicString::ConstructFromLiteral);
-    ownerType.m_orientType.synchronize(&amp;ownerType, orientTypePropertyInfo()-&gt;attributeName, autoString);
</del><ins>+    if (ownerType.m_orientType.value == SVGMarkerOrientAutoStartReverse)
+        ownerType.m_orientType.synchronize(&amp;ownerType, orientTypePropertyInfo()-&gt;attributeName, autoStartReverseString);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;SVGAnimatedProperty&gt; SVGMarkerElement::lookupOrCreateOrientTypeWrapper(SVGElement* contextElement)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGMarkerElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGMarkerElement.h (197737 => 197738)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGMarkerElement.h        2016-03-08 08:16:29 UTC (rev 197737)
+++ trunk/Source/WebCore/svg/SVGMarkerElement.h        2016-03-08 08:20:22 UTC (rev 197738)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx">     SVGMarkerOrientUnknown = 0,
</span><span class="cx">     SVGMarkerOrientAuto,
</span><span class="cx">     SVGMarkerOrientAngle,
</span><ins>+    SVGMarkerOrientAutoStartReverse,
</ins><span class="cx"> 
</span><span class="cx">     // Add new elements before here.
</span><span class="cx">     SVGMarkerOrientMax
</span><span class="lines">@@ -78,8 +79,11 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;&gt;
</span><ins>+inline unsigned SVGIDLEnumLimits&lt;SVGMarkerOrientType&gt;::highestExposedEnumValue() { return SVGMarkerOrientAngle; }
+
+template&lt;&gt;
</ins><span class="cx"> struct SVGPropertyTraits&lt;SVGMarkerOrientType&gt; {
</span><del>-    static unsigned highestEnumValue() { return SVGMarkerOrientAngle; }
</del><ins>+    static unsigned highestEnumValue() { return SVGMarkerOrientAutoStartReverse; }
</ins><span class="cx"> 
</span><span class="cx">     // toString is not needed, synchronizeOrientType() handles this on its own.
</span><span class="cx"> 
</span><span class="lines">@@ -87,6 +91,8 @@
</span><span class="cx">     {
</span><span class="cx">         if (value == &quot;auto&quot;)
</span><span class="cx">             return SVGMarkerOrientAuto;
</span><ins>+        if (value == &quot;auto-start-reverse&quot;)
+            return SVGMarkerOrientAutoStartReverse;
</ins><span class="cx"> 
</span><span class="cx">         ExceptionCode ec = 0;
</span><span class="cx">         angle.setValueAsString(value, ec);
</span><span class="lines">@@ -110,7 +116,8 @@
</span><span class="cx">     enum {
</span><span class="cx">         SVG_MARKER_ORIENT_UNKNOWN = SVGMarkerOrientUnknown,
</span><span class="cx">         SVG_MARKER_ORIENT_AUTO = SVGMarkerOrientAuto,
</span><del>-        SVG_MARKER_ORIENT_ANGLE = SVGMarkerOrientAngle
</del><ins>+        SVG_MARKER_ORIENT_ANGLE = SVGMarkerOrientAngle,
+        SVG_MARKER_ORIENT_AUTOSTARTREVERSE = SVGMarkerOrientAutoStartReverse
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     static Ref&lt;SVGMarkerElement&gt; create(const QualifiedName&amp;, Document&amp;);
</span><span class="lines">@@ -137,6 +144,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool selfHasRelativeLengths() const override;
</span><span class="cx"> 
</span><ins>+    void setOrient(SVGMarkerOrientType, const SVGAngle&amp;);
+
</ins><span class="cx">     void synchronizeOrientType();
</span><span class="cx"> 
</span><span class="cx">     static const AtomicString&amp; orientTypeIdentifier();
</span></span></pre>
</div>
</div>

</body>
</html>