- Revision
- 191392
- Author
- commit-qu...@webkit.org
- Date
- 2015-10-21 11:29:39 -0700 (Wed, 21 Oct 2015)
Log Message
Support for the SVG `onend` attribute
https://bugs.webkit.org/show_bug.cgi?id=150393
Patch by Antoine Quint <grao...@apple.com> on 2015-10-21
Reviewed by Dean Jackson.
Source/WebCore:
Add support for the SVG `onend` attribute to SVG timing and animation elements, which allow the definition
of a JS event listener declaratively for the SVG `endEvent` event.
Tests: svg/animations/end-event-attribute-expected.svg
svg/animations/end-event-attribute.svg
svg/animations/end-event-syncbase-expected.svg
svg/animations/end-event-syncbase.svg
* dom/EventNames.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseAttribute):
* svg/svgattrs.in:
LayoutTests:
Create a new test for the `onend` attribute and rename the previously-named "end-event-declarative.svg" test to
"end-event-syncbase.svg" since the term "declarative" was a little loose.
* svg/animations/end-event-attribute-expected.svg: Copied from LayoutTests/svg/animations/end-event-declarative-expected.svg.
* svg/animations/end-event-attribute.svg: Copied from LayoutTests/svg/animations/end-event-declarative.svg.
* svg/animations/end-event-syncbase-expected.svg: Renamed from LayoutTests/svg/animations/end-event-declarative-expected.svg.
* svg/animations/end-event-syncbase.svg: Renamed from LayoutTests/svg/animations/end-event-declarative.svg.
Modified Paths
Added Paths
Removed Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (191391 => 191392)
--- trunk/LayoutTests/ChangeLog 2015-10-21 17:46:40 UTC (rev 191391)
+++ trunk/LayoutTests/ChangeLog 2015-10-21 18:29:39 UTC (rev 191392)
@@ -1,3 +1,18 @@
+2015-10-21 Antoine Quint <grao...@apple.com>
+
+ Support for the SVG `onend` attribute
+ https://bugs.webkit.org/show_bug.cgi?id=150393
+
+ Reviewed by Dean Jackson.
+
+ Create a new test for the `onend` attribute and rename the previously-named "end-event-declarative.svg" test to
+ "end-event-syncbase.svg" since the term "declarative" was a little loose.
+
+ * svg/animations/end-event-attribute-expected.svg: Copied from LayoutTests/svg/animations/end-event-declarative-expected.svg.
+ * svg/animations/end-event-attribute.svg: Copied from LayoutTests/svg/animations/end-event-declarative.svg.
+ * svg/animations/end-event-syncbase-expected.svg: Renamed from LayoutTests/svg/animations/end-event-declarative-expected.svg.
+ * svg/animations/end-event-syncbase.svg: Renamed from LayoutTests/svg/animations/end-event-declarative.svg.
+
2015-10-21 Nan Wang <n_w...@apple.com>
AX: Expose table size and cell indexes on iOS
Copied: trunk/LayoutTests/svg/animations/end-event-attribute-expected.svg (from rev 191391, trunk/LayoutTests/svg/animations/end-event-declarative-expected.svg) (0 => 191392)
--- trunk/LayoutTests/svg/animations/end-event-attribute-expected.svg (rev 0)
+++ trunk/LayoutTests/svg/animations/end-event-attribute-expected.svg 2015-10-21 18:29:39 UTC (rev 191392)
@@ -0,0 +1,5 @@
+<?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">
+ <rect x="0" y="0" width="50" height="50" fill="green" />
+</svg>
\ No newline at end of file
Copied: trunk/LayoutTests/svg/animations/end-event-attribute.svg (from rev 191391, trunk/LayoutTests/svg/animations/end-event-declarative.svg) (0 => 191392)
--- trunk/LayoutTests/svg/animations/end-event-attribute.svg (rev 0)
+++ trunk/LayoutTests/svg/animations/end-event-attribute.svg 2015-10-21 18:29:39 UTC (rev 191392)
@@ -0,0 +1,21 @@
+<?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">
+<rect id="rect" x="0" y="0" width="50" height="50" fill="red">
+ <animate id="anim" attributeName="visibility" to="visible" begin="0s" end="2s" _onend_="handleEndEvent()" />
+</rect>
+<script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ function handleEndEvent(event) {
+ document.getElementById("rect").setAttribute("fill", "green");
+ testRunner.notifyDone();
+ }
+
+ function loaded() {
+ document.documentElement.setCurrentTime(2);
+ }
+
+</script>
+</svg>
\ No newline at end of file
Deleted: trunk/LayoutTests/svg/animations/end-event-declarative-expected.svg (191391 => 191392)
--- trunk/LayoutTests/svg/animations/end-event-declarative-expected.svg 2015-10-21 17:46:40 UTC (rev 191391)
+++ trunk/LayoutTests/svg/animations/end-event-declarative-expected.svg 2015-10-21 18:29:39 UTC (rev 191392)
@@ -1,5 +0,0 @@
-<?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">
- <rect x="0" y="0" width="50" height="50" fill="green" />
-</svg>
\ No newline at end of file
Deleted: trunk/LayoutTests/svg/animations/end-event-declarative.svg (191391 => 191392)
--- trunk/LayoutTests/svg/animations/end-event-declarative.svg 2015-10-21 17:46:40 UTC (rev 191391)
+++ trunk/LayoutTests/svg/animations/end-event-declarative.svg 2015-10-21 18:29:39 UTC (rev 191392)
@@ -1,19 +0,0 @@
-<?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">
-<rect x="0" y="0" width="50" height="50" fill="red">
- <animate id="anim" attributeName="visibility" to="visible" begin="0s" end="2s" />
- <set attributeName="fill" to="green" begin="anim.endEvent" />
-</rect>
-<script>
- if (window.testRunner)
- testRunner.waitUntilDone();
-
- function loaded() {
- document.documentElement.setCurrentTime(2);
-
- if (window.testRunner)
- setTimeout(function() {testRunner.notifyDone();}, 100);
- }
-</script>
-</svg>
\ No newline at end of file
Copied: trunk/LayoutTests/svg/animations/end-event-syncbase-expected.svg (from rev 191391, trunk/LayoutTests/svg/animations/end-event-declarative-expected.svg) (0 => 191392)
--- trunk/LayoutTests/svg/animations/end-event-syncbase-expected.svg (rev 0)
+++ trunk/LayoutTests/svg/animations/end-event-syncbase-expected.svg 2015-10-21 18:29:39 UTC (rev 191392)
@@ -0,0 +1,5 @@
+<?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">
+ <rect x="0" y="0" width="50" height="50" fill="green" />
+</svg>
\ No newline at end of file
Copied: trunk/LayoutTests/svg/animations/end-event-syncbase.svg (from rev 191391, trunk/LayoutTests/svg/animations/end-event-declarative.svg) (0 => 191392)
--- trunk/LayoutTests/svg/animations/end-event-syncbase.svg (rev 0)
+++ trunk/LayoutTests/svg/animations/end-event-syncbase.svg 2015-10-21 18:29:39 UTC (rev 191392)
@@ -0,0 +1,19 @@
+<?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">
+<rect x="0" y="0" width="50" height="50" fill="red">
+ <animate id="anim" attributeName="visibility" to="visible" begin="0s" end="2s" />
+ <set attributeName="fill" to="green" begin="anim.endEvent" />
+</rect>
+<script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ function loaded() {
+ document.documentElement.setCurrentTime(2);
+
+ if (window.testRunner)
+ setTimeout(function() {testRunner.notifyDone();}, 100);
+ }
+</script>
+</svg>
\ No newline at end of file
Modified: trunk/Source/WebCore/ChangeLog (191391 => 191392)
--- trunk/Source/WebCore/ChangeLog 2015-10-21 17:46:40 UTC (rev 191391)
+++ trunk/Source/WebCore/ChangeLog 2015-10-21 18:29:39 UTC (rev 191392)
@@ -1,3 +1,23 @@
+2015-10-21 Antoine Quint <grao...@apple.com>
+
+ Support for the SVG `onend` attribute
+ https://bugs.webkit.org/show_bug.cgi?id=150393
+
+ Reviewed by Dean Jackson.
+
+ Add support for the SVG `onend` attribute to SVG timing and animation elements, which allow the definition
+ of a JS event listener declaratively for the SVG `endEvent` event.
+
+ Tests: svg/animations/end-event-attribute-expected.svg
+ svg/animations/end-event-attribute.svg
+ svg/animations/end-event-syncbase-expected.svg
+ svg/animations/end-event-syncbase.svg
+
+ * dom/EventNames.h:
+ * svg/animation/SVGSMILElement.cpp:
+ (WebCore::SVGSMILElement::parseAttribute):
+ * svg/svgattrs.in:
+
2015-10-21 Nan Wang <n_w...@apple.com>
AX: Expose table size and cell indexes on iOS
Modified: trunk/Source/WebCore/dom/EventNames.h (191391 => 191392)
--- trunk/Source/WebCore/dom/EventNames.h 2015-10-21 17:46:40 UTC (rev 191391)
+++ trunk/Source/WebCore/dom/EventNames.h 2015-10-21 18:29:39 UTC (rev 191392)
@@ -96,6 +96,7 @@
macro(durationchange) \
macro(emptied) \
macro(end) \
+ macro(endEvent) \
macro(ended) \
macro(enter) \
macro(error) \
Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp (191391 => 191392)
--- trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp 2015-10-21 17:46:40 UTC (rev 191391)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp 2015-10-21 18:29:39 UTC (rev 191392)
@@ -480,6 +480,8 @@
parseBeginOrEnd(value.string(), End);
if (inDocument())
connectConditions();
+ } else if (name == SVGNames::onendAttr) {
+ setAttributeEventListener(eventNames().endEventEvent, name, value);
} else
SVGElement::parseAttribute(name, value);
}
Modified: trunk/Source/WebCore/svg/svgattrs.in (191391 => 191392)
--- trunk/Source/WebCore/svg/svgattrs.in 2015-10-21 17:46:40 UTC (rev 191391)
+++ trunk/Source/WebCore/svg/svgattrs.in 2015-10-21 18:29:39 UTC (rev 191392)
@@ -128,6 +128,7 @@
name
numOctaves
offset
+onend
onzoom
opacity
operator