<!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>[191494] 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/191494">191494</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-23 01:39:01 -0700 (Fri, 23 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Support for SVG `beginEvent` event and `onbegin` attribute
https://bugs.webkit.org/show_bug.cgi?id=150442
Patch by Antoine Quint <graouts@apple.com> on 2015-10-23
Reviewed by Dean Jackson.
Source/WebCore:
Add support for the SVG `beginEvent` event, which is fired as an SVG timing element enters its active interval.
Also add support for the SVG `onbegin` attribute which allows the definition of a JS event listener declaratively
for the SVG `beginEvent` event.
Tests: svg/animations/begin-event-attribute.svg
svg/animations/begin-event-script.svg
svg/animations/begin-event-syncbase.svg
* dom/EventNames.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::smilBeginEventSender):
(WebCore::smilEndEventSender):
(WebCore::SVGSMILElement::~SVGSMILElement):
(WebCore::SVGSMILElement::parseAttribute):
(WebCore::SVGSMILElement::progress):
(WebCore::SVGSMILElement::dispatchPendingEvent):
* svg/svgattrs.in:
LayoutTests:
* svg/animations/begin-event-attribute-expected.svg: Added.
* svg/animations/begin-event-attribute.svg: Added.
Test for the newly supported `onbegin` attribute.
* svg/animations/begin-event-script-expected.svg: Added.
* svg/animations/begin-event-script.svg: Added.
Test for the newly supported `beginEvent` event handled via `addEventListener()`.
* svg/animations/begin-event-syncbase-expected.svg: Added.
* svg/animations/begin-event-syncbase.svg: Added.
Test for the newly supported `beginEvent` event used as a syncbase value in a
timing attribute.
* svg/animations/end-event-attribute-expected.svg:
* svg/animations/end-event-attribute.svg:
* svg/animations/end-event-script-expected.svg:
* svg/animations/end-event-script.svg:
* svg/animations/end-event-syncbase-expected.svg:
* svg/animations/end-event-syncbase.svg:
Cleaned up tests previously added to remove unnecessary XLink namespace, DOCTYPE and
processing instruction to match new tests.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestssvganimationsendeventattributeexpectedsvg">trunk/LayoutTests/svg/animations/end-event-attribute-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvganimationsendeventattributesvg">trunk/LayoutTests/svg/animations/end-event-attribute.svg</a></li>
<li><a href="#trunkLayoutTestssvganimationsendeventscriptexpectedsvg">trunk/LayoutTests/svg/animations/end-event-script-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvganimationsendeventscriptsvg">trunk/LayoutTests/svg/animations/end-event-script.svg</a></li>
<li><a href="#trunkLayoutTestssvganimationsendeventsyncbaseexpectedsvg">trunk/LayoutTests/svg/animations/end-event-syncbase-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvganimationsendeventsyncbasesvg">trunk/LayoutTests/svg/animations/end-event-syncbase.svg</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomEventNamesh">trunk/Source/WebCore/dom/EventNames.h</a></li>
<li><a href="#trunkSourceWebCoresvganimationSVGSMILElementcpp">trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgsvgattrsin">trunk/Source/WebCore/svg/svgattrs.in</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvganimationsbegineventattributeexpectedsvg">trunk/LayoutTests/svg/animations/begin-event-attribute-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvganimationsbegineventattributesvg">trunk/LayoutTests/svg/animations/begin-event-attribute.svg</a></li>
<li><a href="#trunkLayoutTestssvganimationsbegineventscriptexpectedsvg">trunk/LayoutTests/svg/animations/begin-event-script-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvganimationsbegineventscriptsvg">trunk/LayoutTests/svg/animations/begin-event-script.svg</a></li>
<li><a href="#trunkLayoutTestssvganimationsbegineventsyncbaseexpectedsvg">trunk/LayoutTests/svg/animations/begin-event-syncbase-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvganimationsbegineventsyncbasesvg">trunk/LayoutTests/svg/animations/begin-event-syncbase.svg</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191493 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-23 08:10:24 UTC (rev 191493)
+++ trunk/LayoutTests/ChangeLog        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2015-10-23 Antoine Quint <graouts@apple.com>
+
+ Support for SVG `beginEvent` event and `onbegin` attribute
+ https://bugs.webkit.org/show_bug.cgi?id=150442
+
+ Reviewed by Dean Jackson.
+
+ * svg/animations/begin-event-attribute-expected.svg: Added.
+ * svg/animations/begin-event-attribute.svg: Added.
+
+ Test for the newly supported `onbegin` attribute.
+
+ * svg/animations/begin-event-script-expected.svg: Added.
+ * svg/animations/begin-event-script.svg: Added.
+
+ Test for the newly supported `beginEvent` event handled via `addEventListener()`.
+
+ * svg/animations/begin-event-syncbase-expected.svg: Added.
+ * svg/animations/begin-event-syncbase.svg: Added.
+
+ Test for the newly supported `beginEvent` event used as a syncbase value in a
+ timing attribute.
+
+ * svg/animations/end-event-attribute-expected.svg:
+ * svg/animations/end-event-attribute.svg:
+ * svg/animations/end-event-script-expected.svg:
+ * svg/animations/end-event-script.svg:
+ * svg/animations/end-event-syncbase-expected.svg:
+ * svg/animations/end-event-syncbase.svg:
+
+ Cleaned up tests previously added to remove unnecessary XLink namespace, DOCTYPE and
+ processing instruction to match new tests.
+
</ins><span class="cx"> 2015-10-23 Hyemi Shin <hyemi.sin@samsung.com>
</span><span class="cx">
</span><span class="cx"> ConvolverNode.buffer must have same sample rate as the AudioContext
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsbegineventattributeexpectedsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/begin-event-attribute-expected.svg (0 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/begin-event-attribute-expected.svg         (rev 0)
+++ trunk/LayoutTests/svg/animations/begin-event-attribute-expected.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect x="0" y="0" width="50" height="50" fill="green" />
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsbegineventattributesvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/begin-event-attribute.svg (0 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/begin-event-attribute.svg         (rev 0)
+++ trunk/LayoutTests/svg/animations/begin-event-attribute.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+<svg onload="loaded()" xmlns="http://www.w3.org/2000/svg">
+<rect id="rect" x="0" y="0" width="50" height="50" fill="red">
+ <animate id="anim" attributeName="visibility" to="visible" begin="1s" end="2s" onbegin="handleBeginEvent()" />
+</rect>
+<script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ function handleBeginEvent(event) {
+ document.getElementById("rect").setAttribute("fill", "green");
+ testRunner.notifyDone();
+ }
+
+ function loaded() {
+ document.documentElement.setCurrentTime(1);
+ }
+
+</script>
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsbegineventscriptexpectedsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/begin-event-script-expected.svg (0 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/begin-event-script-expected.svg         (rev 0)
+++ trunk/LayoutTests/svg/animations/begin-event-script-expected.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect x="0" y="0" width="50" height="50" fill="green" />
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsbegineventscriptsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/begin-event-script.svg (0 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/begin-event-script.svg         (rev 0)
+++ trunk/LayoutTests/svg/animations/begin-event-script.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+<svg onload="loaded()" xmlns="http://www.w3.org/2000/svg">
+<rect id="rect" x="0" y="0" width="50" height="50" fill="red">
+ <animate id="anim" attributeName="visibility" to="visible" begin="1s" end="2s" />
+</rect>
+<script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ function loaded() {
+ document.getElementById("anim").addEventListener("beginEvent", function(event) {
+ document.getElementById("rect").setAttribute("fill", "green");
+ testRunner.notifyDone();
+ });
+
+ document.documentElement.setCurrentTime(1);
+ }
+
+</script>
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsbegineventsyncbaseexpectedsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/begin-event-syncbase-expected.svg (0 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/begin-event-syncbase-expected.svg         (rev 0)
+++ trunk/LayoutTests/svg/animations/begin-event-syncbase-expected.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <rect x="0" y="0" width="50" height="50" fill="green" />
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsbegineventsyncbasesvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/begin-event-syncbase.svg (0 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/begin-event-syncbase.svg         (rev 0)
+++ trunk/LayoutTests/svg/animations/begin-event-syncbase.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+<svg onload="loaded()" xmlns="http://www.w3.org/2000/svg">
+<rect x="0" y="0" width="50" height="50" fill="red">
+ <animate id="anim" attributeName="visibility" to="visible" begin="1s" end="2s" />
+ <set attributeName="fill" to="green" begin="anim.beginEvent" />
+</rect>
+<script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ function loaded() {
+ document.documentElement.setCurrentTime(1);
+
+ if (window.testRunner)
+ setTimeout(function() {testRunner.notifyDone();}, 100);
+ }
+</script>
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsendeventattributeexpectedsvg"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/animations/end-event-attribute-expected.svg (191493 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/end-event-attribute-expected.svg        2015-10-23 08:10:24 UTC (rev 191493)
+++ trunk/LayoutTests/svg/animations/end-event-attribute-expected.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -1,5 +1,3 @@
</span><del>-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
</del><ins>+<svg xmlns="http://www.w3.org/2000/svg">
</ins><span class="cx"> <rect x="0" y="0" width="50" height="50" fill="green" />
</span><span class="cx"> </svg>
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsendeventattributesvg"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/animations/end-event-attribute.svg (191493 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/end-event-attribute.svg        2015-10-23 08:10:24 UTC (rev 191493)
+++ trunk/LayoutTests/svg/animations/end-event-attribute.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -1,6 +1,4 @@
</span><del>-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg onload="loaded()" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
</del><ins>+<svg onload="loaded()" xmlns="http://www.w3.org/2000/svg">
</ins><span class="cx"> <rect id="rect" x="0" y="0" width="50" height="50" fill="red">
</span><span class="cx"> <animate id="anim" attributeName="visibility" to="visible" begin="0s" end="2s" onend="handleEndEvent()" />
</span><span class="cx"> </rect>
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsendeventscriptexpectedsvg"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/animations/end-event-script-expected.svg (191493 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/end-event-script-expected.svg        2015-10-23 08:10:24 UTC (rev 191493)
+++ trunk/LayoutTests/svg/animations/end-event-script-expected.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -1,5 +1,3 @@
</span><del>-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
</del><ins>+<svg xmlns="http://www.w3.org/2000/svg">
</ins><span class="cx"> <rect x="0" y="0" width="50" height="50" fill="green" />
</span><span class="cx"> </svg>
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsendeventscriptsvg"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/animations/end-event-script.svg (191493 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/end-event-script.svg        2015-10-23 08:10:24 UTC (rev 191493)
+++ trunk/LayoutTests/svg/animations/end-event-script.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -1,6 +1,4 @@
</span><del>-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg onload="loaded()" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
</del><ins>+<svg onload="loaded()" xmlns="http://www.w3.org/2000/svg">
</ins><span class="cx"> <rect id="rect" x="0" y="0" width="50" height="50" fill="red">
</span><span class="cx"> <animate id="anim" attributeName="visibility" to="visible" begin="0s" end="2s" />
</span><span class="cx"> </rect>
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsendeventsyncbaseexpectedsvg"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/animations/end-event-syncbase-expected.svg (191493 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/end-event-syncbase-expected.svg        2015-10-23 08:10:24 UTC (rev 191493)
+++ trunk/LayoutTests/svg/animations/end-event-syncbase-expected.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -1,5 +1,3 @@
</span><del>-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
</del><ins>+<svg xmlns="http://www.w3.org/2000/svg">
</ins><span class="cx"> <rect x="0" y="0" width="50" height="50" fill="green" />
</span><span class="cx"> </svg>
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsendeventsyncbasesvg"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/animations/end-event-syncbase.svg (191493 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/end-event-syncbase.svg        2015-10-23 08:10:24 UTC (rev 191493)
+++ trunk/LayoutTests/svg/animations/end-event-syncbase.svg        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -1,6 +1,4 @@
</span><del>-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg onload="loaded()" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
</del><ins>+<svg onload="loaded()" xmlns="http://www.w3.org/2000/svg">
</ins><span class="cx"> <rect x="0" y="0" width="50" height="50" fill="red">
</span><span class="cx"> <animate id="anim" attributeName="visibility" to="visible" begin="0s" end="2s" />
</span><span class="cx"> <set attributeName="fill" to="green" begin="anim.endEvent" />
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191493 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-23 08:10:24 UTC (rev 191493)
+++ trunk/Source/WebCore/ChangeLog        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2015-10-23 Antoine Quint <graouts@apple.com>
+
+ Support for SVG `beginEvent` event and `onbegin` attribute
+ https://bugs.webkit.org/show_bug.cgi?id=150442
+
+ Reviewed by Dean Jackson.
+
+ Add support for the SVG `beginEvent` event, which is fired as an SVG timing element enters its active interval.
+ Also add support for the SVG `onbegin` attribute which allows the definition of a JS event listener declaratively
+ for the SVG `beginEvent` event.
+
+ Tests: svg/animations/begin-event-attribute.svg
+ svg/animations/begin-event-script.svg
+ svg/animations/begin-event-syncbase.svg
+
+ * dom/EventNames.h:
+ * svg/animation/SVGSMILElement.cpp:
+ (WebCore::smilBeginEventSender):
+ (WebCore::smilEndEventSender):
+ (WebCore::SVGSMILElement::~SVGSMILElement):
+ (WebCore::SVGSMILElement::parseAttribute):
+ (WebCore::SVGSMILElement::progress):
+ (WebCore::SVGSMILElement::dispatchPendingEvent):
+ * svg/svgattrs.in:
+
</ins><span class="cx"> 2015-10-23 Hyemi Shin <hyemi.sin@samsung.com>
</span><span class="cx">
</span><span class="cx"> ConvolverNode.buffer must have same sample-rate as the AudioContext
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventNames.h (191493 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventNames.h        2015-10-23 08:10:24 UTC (rev 191493)
+++ trunk/Source/WebCore/dom/EventNames.h        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx"> macro(beforeload) \
</span><span class="cx"> macro(beforepaste) \
</span><span class="cx"> macro(beforeunload) \
</span><ins>+ macro(beginEvent) \
</ins><span class="cx"> macro(blocked) \
</span><span class="cx"> macro(blur) \
</span><span class="cx"> macro(boundary) \
</span></span></pre></div>
<a id="trunkSourceWebCoresvganimationSVGSMILElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp (191493 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp        2015-10-23 08:10:24 UTC (rev 191493)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -47,9 +47,15 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+static SMILEventSender& smilBeginEventSender()
+{
+ static NeverDestroyed<SMILEventSender> sender(eventNames().beginEventEvent);
+ return sender;
+}
+
</ins><span class="cx"> static SMILEventSender& smilEndEventSender()
</span><span class="cx"> {
</span><del>- static NeverDestroyed<SMILEventSender> sender("endEvent");
</del><ins>+ static NeverDestroyed<SMILEventSender> sender(eventNames().endEventEvent);
</ins><span class="cx"> return sender;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -142,6 +148,7 @@
</span><span class="cx"> SVGSMILElement::~SVGSMILElement()
</span><span class="cx"> {
</span><span class="cx"> clearResourceReferences();
</span><ins>+ smilBeginEventSender().cancelEvent(*this);
</ins><span class="cx"> smilEndEventSender().cancelEvent(*this);
</span><span class="cx"> disconnectConditions();
</span><span class="cx"> if (m_timeContainer && m_targetElement && hasValidAttributeName())
</span><span class="lines">@@ -480,9 +487,11 @@
</span><span class="cx"> parseBeginOrEnd(value.string(), End);
</span><span class="cx"> if (inDocument())
</span><span class="cx"> connectConditions();
</span><del>- } else if (name == SVGNames::onendAttr) {
</del><ins>+ } else if (name == SVGNames::onendAttr)
</ins><span class="cx"> setAttributeEventListener(eventNames().endEventEvent, name, value);
</span><del>- } else
</del><ins>+ else if (name == SVGNames::onbeginAttr)
+ setAttributeEventListener(eventNames().beginEventEvent, name, value);
+ else
</ins><span class="cx"> SVGElement::parseAttribute(name, value);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1118,7 +1127,8 @@
</span><span class="cx"> endedActiveInterval();
</span><span class="cx"> if (m_activeState != Frozen)
</span><span class="cx"> clearAnimatedType(m_targetElement);
</span><del>- }
</del><ins>+ } else if (oldActiveState != Active && m_activeState == Active)
+ smilBeginEventSender().dispatchEventSoon(*this);
</ins><span class="cx">
</span><span class="cx"> // Triggering all the pending events if the animation timeline is changed.
</span><span class="cx"> if (seekToTime) {
</span><span class="lines">@@ -1203,7 +1213,7 @@
</span><span class="cx">
</span><span class="cx"> void SVGSMILElement::dispatchPendingEvent(SMILEventSender* eventSender)
</span><span class="cx"> {
</span><del>- ASSERT(eventSender == &smilEndEventSender());
</del><ins>+ ASSERT(eventSender == &smilBeginEventSender() || eventSender == &smilEndEventSender());
</ins><span class="cx"> const AtomicString& eventType = eventSender->eventType();
</span><span class="cx"> dispatchEvent(Event::create(eventType, false, false));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoresvgsvgattrsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/svgattrs.in (191493 => 191494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/svgattrs.in        2015-10-23 08:10:24 UTC (rev 191493)
+++ trunk/Source/WebCore/svg/svgattrs.in        2015-10-23 08:39:01 UTC (rev 191494)
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx"> name
</span><span class="cx"> numOctaves
</span><span class="cx"> offset
</span><ins>+onbegin
</ins><span class="cx"> onend
</span><span class="cx"> onzoom
</span><span class="cx"> opacity
</span></span></pre>
</div>
</div>
</body>
</html>