<!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>[179467] 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/179467">179467</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2015-02-01 07:22:57 -0800 (Sun, 01 Feb 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Source/WebCore:
Stop dispatching events to with SVGElementInstance objects as their targets
https://bugs.webkit.org/show_bug.cgi?id=141108
Reviewed by Anders Carlsson.
Test: svg/custom/use-event-retargeting.html
* dom/EventDispatcher.cpp:
(WebCore::eventTargetRespectingTargetRules): Replaced the code that retargeted
events at SVGElementInstance objects with code that retargets them at the use
element instead. Also wrote the code in a simpler way.
LayoutTests:
Stop dispatching events with SVGElementInstance objects as their targets
https://bugs.webkit.org/show_bug.cgi?id=141108
Reviewed by Anders Carlsson.
Many tests are no longer relevant once we aren't doing this any more.
* platform/gtk/svg/custom/use-instanceRoot-event-bubbling-expected.png: Removed.
* platform/gtk/svg/custom/use-instanceRoot-modifications-expected.png: Removed.
* platform/gtk/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
* platform/ios-sim-deprecated/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
* platform/ios-simulator/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
* platform/mac-mountainlion/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
* platform/mac/svg/custom/use-instanceRoot-event-bubbling-expected.png: Removed.
* platform/mac/svg/custom/use-instanceRoot-modifications-expected.png: Removed.
* platform/mac/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
* svg/custom/use-instanceRoot-modifications.svg: Removed.
* svg/custom/use-instanceRoot-with-use-removed-expected.txt: Removed.
* svg/custom/use-instanceRoot-with-use-removed.svg: Removed.
* svg/custom/resources/use-instanceRoot-event-bubbling.js: Updated this test to expect
the events to be dispatched with the SVGUseElement as the target. I talked this over with
Sam Weinig and we decided this is good behavior for now, and it almost matches what the
spec says. Might be worth refining later.
* svg/custom/use-instanceRoot-event-bubbling-expected.txt: Updated expected results.
* svg/custom/use-instanceRoot-event-bubbling.xhtml: Tweaked the test a little. It still
could use improvement; it's like half a "repaint test", which is strange.
* svg/custom/use-event-retargeting-expected.txt: Added. Got this test from Blink.
* svg/custom/use-event-retargeting.html: Added. Ditto.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestssvgcustomresourcesuseinstanceRooteventbubblingjs">trunk/LayoutTests/svg/custom/resources/use-instanceRoot-event-bubbling.js</a></li>
<li><a href="#trunkLayoutTestssvgcustomuseinstanceRooteventbubblingexpectedtxt">trunk/LayoutTests/svg/custom/use-instanceRoot-event-bubbling-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomuseinstanceRooteventbubblingxhtml">trunk/LayoutTests/svg/custom/use-instanceRoot-event-bubbling.xhtml</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomEventDispatchercpp">trunk/Source/WebCore/dom/EventDispatcher.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgcustomuseeventretargetingexpectedtxt">trunk/LayoutTests/svg/custom/use-event-retargeting-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomuseeventretargetinghtml">trunk/LayoutTests/svg/custom/use-event-retargeting.html</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformgtksvgcustomuseinstanceRooteventbubblingexpectedpng">trunk/LayoutTests/platform/gtk/svg/custom/use-instanceRoot-event-bubbling-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformgtksvgcustomuseinstanceRootmodificationsexpectedpng">trunk/LayoutTests/platform/gtk/svg/custom/use-instanceRoot-modifications-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformgtksvgcustomuseinstanceRootmodificationsexpectedtxt">trunk/LayoutTests/platform/gtk/svg/custom/use-instanceRoot-modifications-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimdeprecatedsvgcustomuseinstanceRootmodificationsexpectedtxt">trunk/LayoutTests/platform/ios-sim-deprecated/svg/custom/use-instanceRoot-modifications-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorsvgcustomuseinstanceRootmodificationsexpectedtxt">trunk/LayoutTests/platform/ios-simulator/svg/custom/use-instanceRoot-modifications-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgcustomuseinstanceRooteventbubblingexpectedpng">trunk/LayoutTests/platform/mac/svg/custom/use-instanceRoot-event-bubbling-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgcustomuseinstanceRootmodificationsexpectedpng">trunk/LayoutTests/platform/mac/svg/custom/use-instanceRoot-modifications-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgcustomuseinstanceRootmodificationsexpectedtxt">trunk/LayoutTests/platform/mac/svg/custom/use-instanceRoot-modifications-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacmountainlionsvgcustomuseinstanceRootmodificationsexpectedtxt">trunk/LayoutTests/platform/mac-mountainlion/svg/custom/use-instanceRoot-modifications-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomuseinstanceRootmodificationssvg">trunk/LayoutTests/svg/custom/use-instanceRoot-modifications.svg</a></li>
<li><a href="#trunkLayoutTestssvgcustomuseinstanceRootwithuseremovedexpectedtxt">trunk/LayoutTests/svg/custom/use-instanceRoot-with-use-removed-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomuseinstanceRootwithuseremovedsvg">trunk/LayoutTests/svg/custom/use-instanceRoot-with-use-removed.svg</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/ChangeLog        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2015-01-31 Darin Adler <darin@apple.com>
+
+ Stop dispatching events with SVGElementInstance objects as their targets
+ https://bugs.webkit.org/show_bug.cgi?id=141108
+
+ Reviewed by Anders Carlsson.
+
+ Many tests are no longer relevant once we aren't doing this any more.
+
+ * platform/gtk/svg/custom/use-instanceRoot-event-bubbling-expected.png: Removed.
+ * platform/gtk/svg/custom/use-instanceRoot-modifications-expected.png: Removed.
+ * platform/gtk/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
+ * platform/ios-sim-deprecated/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
+ * platform/ios-simulator/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
+ * platform/mac-mountainlion/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
+ * platform/mac/svg/custom/use-instanceRoot-event-bubbling-expected.png: Removed.
+ * platform/mac/svg/custom/use-instanceRoot-modifications-expected.png: Removed.
+ * platform/mac/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
+ * svg/custom/use-instanceRoot-modifications.svg: Removed.
+ * svg/custom/use-instanceRoot-with-use-removed-expected.txt: Removed.
+ * svg/custom/use-instanceRoot-with-use-removed.svg: Removed.
+
+ * svg/custom/resources/use-instanceRoot-event-bubbling.js: Updated this test to expect
+ the events to be dispatched with the SVGUseElement as the target. I talked this over with
+ Sam Weinig and we decided this is good behavior for now, and it almost matches what the
+ spec says. Might be worth refining later.
+ * svg/custom/use-instanceRoot-event-bubbling-expected.txt: Updated expected results.
+ * svg/custom/use-instanceRoot-event-bubbling.xhtml: Tweaked the test a little. It still
+ could use improvement; it's like half a "repaint test", which is strange.
+
+ * svg/custom/use-event-retargeting-expected.txt: Added. Got this test from Blink.
+ * svg/custom/use-event-retargeting.html: Added. Ditto.
+
</ins><span class="cx"> 2015-02-01 Gyuyoung Kim <gyuyoung.kim@samsung.com>
</span><span class="cx">
</span><span class="cx"> Unreviewd EFL gardening. Add new failing tests related to W3C SVG 1.1.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtksvgcustomuseinstanceRooteventbubblingexpectedpng"></a>
<div class="binary"><h4>Deleted: trunk/LayoutTests/platform/gtk/svg/custom/use-instanceRoot-event-bubbling-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtksvgcustomuseinstanceRootmodificationsexpectedpng"></a>
<div class="binary"><h4>Deleted: trunk/LayoutTests/platform/gtk/svg/custom/use-instanceRoot-modifications-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtksvgcustomuseinstanceRootmodificationsexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/gtk/svg/custom/use-instanceRoot-modifications-expected.txt (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/svg/custom/use-instanceRoot-modifications-expected.txt        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/platform/gtk/svg/custom/use-instanceRoot-modifications-expected.txt        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderSVGRoot {svg} at (45,40) size 330x107
- RenderSVGHiddenContainer {defs} at (0,0) size 0x0
- RenderSVGContainer {g} at (0,0) size 125x30
- RenderSVGRect {rect} at (0,0) size 125x25 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (40,0) size 40x30 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGContainer {use} at (45,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(25.00,25.00)}]
- RenderSVGContainer {g} at (45,40) size 130x40
- RenderSVGRect {rect} at (45,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (90,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGContainer {use} at (245,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(125.00,25.00)}]
- RenderSVGContainer {g} at (245,40) size 130x40
- RenderSVGRect {rect} at (245,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (290,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGText {text} at (70,55) size 78x19 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 78x18
- chunk 1 text run 1 at (70.00,70.00) startOffset 0 endOffset 12 width 77.50: "Test passed."
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimdeprecatedsvgcustomuseinstanceRootmodificationsexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/ios-sim-deprecated/svg/custom/use-instanceRoot-modifications-expected.txt (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-sim-deprecated/svg/custom/use-instanceRoot-modifications-expected.txt        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/platform/ios-sim-deprecated/svg/custom/use-instanceRoot-modifications-expected.txt        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderSVGRoot {svg} at (45,40) size 330x107
- RenderSVGHiddenContainer {defs} at (0,0) size 0x0
- RenderSVGContainer {g} at (0,0) size 125x30
- RenderSVGRect {rect} at (0,0) size 125x25 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (40,0) size 40x30 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGContainer {use} at (45,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(25.00,25.00)}]
- RenderSVGContainer {g} at (45,40) size 130x40
- RenderSVGRect {rect} at (45,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (90,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGContainer {use} at (245,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(125.00,25.00)}]
- RenderSVGContainer {g} at (245,40) size 130x40
- RenderSVGRect {rect} at (245,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (290,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGText {text} at (70,55) size 79x19 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 79x18
- chunk 1 text run 1 at (70.00,70.00) startOffset 0 endOffset 12 width 78.20: "Test passed."
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorsvgcustomuseinstanceRootmodificationsexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/ios-simulator/svg/custom/use-instanceRoot-modifications-expected.txt (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/svg/custom/use-instanceRoot-modifications-expected.txt        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/platform/ios-simulator/svg/custom/use-instanceRoot-modifications-expected.txt        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderSVGRoot {svg} at (45,40) size 330x107
- RenderSVGHiddenContainer {defs} at (0,0) size 0x0
- RenderSVGContainer {g} at (0,0) size 125x30
- RenderSVGRect {rect} at (0,0) size 125x25 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (40,0) size 40x30 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGContainer {use} at (45,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(25.00,25.00)}]
- RenderSVGContainer {g} at (45,40) size 130x40
- RenderSVGRect {rect} at (45,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (90,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGContainer {use} at (245,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(125.00,25.00)}]
- RenderSVGContainer {g} at (245,40) size 130x40
- RenderSVGRect {rect} at (245,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (290,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGText {text} at (70,55) size 79x19 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 79x18
- chunk 1 text run 1 at (70.00,70.00) startOffset 0 endOffset 12 width 78.20: "Test passed."
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgcustomuseinstanceRooteventbubblingexpectedpng"></a>
<div class="binary"><h4>Deleted: trunk/LayoutTests/platform/mac/svg/custom/use-instanceRoot-event-bubbling-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgcustomuseinstanceRootmodificationsexpectedpng"></a>
<div class="binary"><h4>Deleted: trunk/LayoutTests/platform/mac/svg/custom/use-instanceRoot-modifications-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgcustomuseinstanceRootmodificationsexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/mac/svg/custom/use-instanceRoot-modifications-expected.txt (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/svg/custom/use-instanceRoot-modifications-expected.txt        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/platform/mac/svg/custom/use-instanceRoot-modifications-expected.txt        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderSVGRoot {svg} at (45,40) size 330x108
- RenderSVGHiddenContainer {defs} at (0,0) size 0x0
- RenderSVGContainer {g} at (0,0) size 125x30
- RenderSVGRect {rect} at (0,0) size 125x25 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (40,0) size 40x30 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGContainer {use} at (45,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(25.00,25.00)}]
- RenderSVGContainer {g} at (45,40) size 130x40
- RenderSVGRect {rect} at (45,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (90,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGContainer {use} at (245,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(125.00,25.00)}]
- RenderSVGContainer {g} at (245,40) size 130x40
- RenderSVGRect {rect} at (245,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (290,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGText {text} at (70,55) size 79x19 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 79x19
- chunk 1 text run 1 at (70.00,70.00) startOffset 0 endOffset 12 width 78.20: "Test passed."
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmacmountainlionsvgcustomuseinstanceRootmodificationsexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/mac-mountainlion/svg/custom/use-instanceRoot-modifications-expected.txt (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-mountainlion/svg/custom/use-instanceRoot-modifications-expected.txt        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/platform/mac-mountainlion/svg/custom/use-instanceRoot-modifications-expected.txt        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderSVGRoot {svg} at (45,40) size 330x108
- RenderSVGHiddenContainer {defs} at (0,0) size 0x0
- RenderSVGContainer {g} at (0,0) size 125x30
- RenderSVGRect {rect} at (0,0) size 125x25 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (40,0) size 40x30 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGContainer {use} at (45,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(25.00,25.00)}]
- RenderSVGContainer {g} at (45,40) size 130x40
- RenderSVGRect {rect} at (45,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (90,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGContainer {use} at (245,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(125.00,25.00)}]
- RenderSVGContainer {g} at (245,40) size 130x40
- RenderSVGRect {rect} at (245,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=60.00] [height=10.00]
- RenderSVGEllipse {circle} at (290,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [cx=30.00] [cy=5.00] [r=10.00]
- RenderSVGText {text} at (70,55) size 78x19 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 78x19
- chunk 1 text run 1 at (70.00,70.00) startOffset 0 endOffset 12 width 77.50: "Test passed."
</del></span></pre></div>
<a id="trunkLayoutTestssvgcustomresourcesuseinstanceRooteventbubblingjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/custom/resources/use-instanceRoot-event-bubbling.js (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/resources/use-instanceRoot-event-bubbling.js        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/svg/custom/resources/use-instanceRoot-event-bubbling.js        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,7 +1,9 @@
</span><del>-description("Tests wheter SVG event bubbling works accross shadow trees.");
</del><ins>+description("Tests whether SVG event bubbling works across shadow trees.");
</ins><span class="cx">
</span><del>-if (window.testRunner)
</del><ins>+if (window.testRunner) {
</ins><span class="cx"> testRunner.waitUntilDone();
</span><ins>+ testRunner.dumpAsText();
+}
</ins><span class="cx">
</span><span class="cx"> var svgNS = "http://www.w3.org/2000/svg";
</span><span class="cx"> var xhtmlNS = "http://www.w3.org/1999/xhtml";
</span><span class="lines">@@ -18,8 +20,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function eventHandler(evt, label) {
</span><del>- var targetId = evt.target.correspondingElement ? evt.target.correspondingElement.id : evt.target.id;
- var curTargetId = evt.currentTarget.correspondingElement ? evt.currentTarget.correspondingElement.id : evt.currentTarget.id;
</del><ins>+ var targetId = evt.target.id;
+ var curTargetId = evt.currentTarget.id;
</ins><span class="cx">
</span><span class="cx"> var phaseString = "";
</span><span class="cx"> switch (evt.eventPhase) {
</span><span class="lines">@@ -41,10 +43,7 @@
</span><span class="cx">
</span><span class="cx"> function finishTest()
</span><span class="cx"> {
</span><del>- successfullyParsed = true;
-
</del><span class="cx"> document.getElementById("rectParent").setAttribute("fill", "green");
</span><del>- shouldBeTrue("successfullyParsed");
</del><span class="cx"> debug('<br /><span class="pass">TEST COMPLETE</span>');
</span><span class="cx">
</span><span class="cx"> if (window.testRunner)
</span><span class="lines">@@ -59,22 +58,22 @@
</span><span class="cx"> switch (counter) {
</span><span class="cx"> case 1:
</span><span class="cx"> rect.onclick = function(evt) { eventHandler(evt, 1); };
</span><del>- expected[0] = "[EventHandler 1] type: click phase: AT_TARGET target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rect)";
</del><ins>+ expected[0] = "[EventHandler 1] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)";
</ins><span class="cx"> testListeners();
</span><span class="cx"> break;
</span><span class="cx"> case 2:
</span><span class="cx"> rectContainer.addEventListener("click", function(evt) { eventHandler(evt, 2) }, false);
</span><del>- expected[1] = "[EventHandler 2] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rectParent)";
</del><ins>+ expected[1] = "[EventHandler 2] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)";
</ins><span class="cx"> testListeners();
</span><span class="cx"> break;
</span><span class="cx"> case 3:
</span><span class="cx"> use.setAttribute("onclick", "eventHandler(evt, 3)");
</span><del>- expected[2] = "[EventHandler 3] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGUseElement] (id: use)";
</del><ins>+ expected[2] = "[EventHandler 3] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)";
</ins><span class="cx"> testListeners();
</span><span class="cx"> break;
</span><span class="cx"> case 4:
</span><span class="cx"> useContainer.onclick = function(evt) { eventHandler(evt, 4) };
</span><del>- expected[3] = "[EventHandler 4] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGGElement] (id: useParent)";
</del><ins>+ expected[3] = "[EventHandler 4] type: click phase: BUBBLING target: [object SVGUseElement] (id: use) currentTarget: [object SVGGElement] (id: useParent)";
</ins><span class="cx"> testListeners();
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -106,7 +105,7 @@
</span><span class="cx">
</span><span class="cx"> var rect = document.createElementNS(svgNS, "rect");
</span><span class="cx"> rect.id = "rect";
</span><del>-rect.style.fill = "red";
</del><ins>+rect.style.fill = "blue";
</ins><span class="cx"> rect.width.baseVal.value = 100;
</span><span class="cx"> rect.height.baseVal.value = 100;
</span><span class="cx"> rectContainer.appendChild(rect);
</span><span class="lines">@@ -121,8 +120,4 @@
</span><span class="cx"> use.href.baseVal = "#rectParent";
</span><span class="cx"> useContainer.appendChild(use);
</span><span class="cx">
</span><del>-function repaintTest() {
- if (window.testRunner)
- testRunner.waitUntilDone();
- nextTest();
-}
</del><ins>+nextTest();
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomuseeventretargetingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/use-event-retargeting-expected.txt (0 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/use-event-retargeting-expected.txt         (rev 0)
+++ trunk/LayoutTests/svg/custom/use-event-retargeting-expected.txt        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+PASS - [object SVGUseElement] was clicked.
+PASS - [object HTMLDivElement] was clicked.
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/svg/custom/use-event-retargeting-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestssvgcustomuseeventretargetinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/use-event-retargeting.html (0 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/use-event-retargeting.html         (rev 0)
+++ trunk/LayoutTests/svg/custom/use-event-retargeting.html        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+<!DOCTYPE html>
+<head>
+ <style>
+ * { margin: 0; padding: 0; }
+ svg { width: 200px; height: 100px; }
+ a div { width: 200px; height: 100px; background-color: yellow; }
+ </style>
+</head>
+<body>
+ <a href="#" class="icon-link">
+ <svg>
+ <defs>
+ <rect id="blue-rectangle" width="200" height="100" style="fill:#00f;" />
+ </defs>
+ <use xlink:href="#blue-rectangle"></use>
+ </svg>
+ <div></div>
+ </a>
+
+ <div class="log"></div>
+
+ <script>
+ var expected = null;
+
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function clickAt(x, y, expectedElement)
+ {
+ expected = expectedElement;
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+ expected = null;
+ }
+
+ document.querySelector("a").addEventListener("click", function(event) {
+ var result = "";
+ if (event.target == expected)
+ result = "PASS - " + event.target + " was clicked.";
+ else
+ result = "FAIL - expected " + expected + " but got " + event.target + ".";
+ document.querySelector('.log').innerHTML += result + '<br />';
+ event.preventDefault();
+ }, false);
+
+ clickAt(50, 50, document.querySelector("use"));
+ clickAt(50, 130, document.querySelector("a div"));
+ </script>
+</body>
</ins><span class="cx">Property changes on: trunk/LayoutTests/svg/custom/use-event-retargeting.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestssvgcustomuseinstanceRooteventbubblingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/custom/use-instanceRoot-event-bubbling-expected.txt (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/use-instanceRoot-event-bubbling-expected.txt        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/svg/custom/use-instanceRoot-event-bubbling-expected.txt        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,19 +1,18 @@
</span><del>-Tests wheter SVG event bubbling works accross shadow trees.
</del><ins>+Tests whether SVG event bubbling works across shadow trees.
</ins><span class="cx">
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS msg is "[EventHandler 1] type: click phase: AT_TARGET target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rect)"
-PASS msg is "[EventHandler 1] type: click phase: AT_TARGET target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rect)"
-PASS msg is "[EventHandler 2] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rectParent)"
-PASS msg is "[EventHandler 1] type: click phase: AT_TARGET target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rect)"
-PASS msg is "[EventHandler 2] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rectParent)"
-PASS msg is "[EventHandler 3] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGUseElement] (id: use)"
-PASS msg is "[EventHandler 1] type: click phase: AT_TARGET target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rect)"
-PASS msg is "[EventHandler 2] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rectParent)"
-PASS msg is "[EventHandler 3] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGUseElement] (id: use)"
-PASS msg is "[EventHandler 4] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGGElement] (id: useParent)"
-PASS successfullyParsed is true
</del><ins>+PASS msg is "[EventHandler 1] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)"
+PASS msg is "[EventHandler 1] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)"
+PASS msg is "[EventHandler 2] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)"
+PASS msg is "[EventHandler 1] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)"
+PASS msg is "[EventHandler 2] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)"
+PASS msg is "[EventHandler 3] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)"
+PASS msg is "[EventHandler 1] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)"
+PASS msg is "[EventHandler 2] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)"
+PASS msg is "[EventHandler 3] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)"
+PASS msg is "[EventHandler 4] type: click phase: BUBBLING target: [object SVGUseElement] (id: use) currentTarget: [object SVGGElement] (id: useParent)"
</ins><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestssvgcustomuseinstanceRooteventbubblingxhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/custom/use-instanceRoot-event-bubbling.xhtml (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/use-instanceRoot-event-bubbling.xhtml        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/svg/custom/use-instanceRoot-event-bubbling.xhtml        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,12 +1,11 @@
</span><span class="cx"> <html xmlns="http://www.w3.org/1999/xhtml">
</span><span class="cx"> <head>
</span><span class="cx"> <script>window.enablePixelTesting = true;</script>
</span><del>-<script src="../../resources/js-test-pre.js"></script>
-<script src="../../fast/repaint/resources/repaint.js"></script>
</del><ins>+<script src="../../resources/js-test-pre.js"/>
</ins><span class="cx"> </head>
</span><del>-<body onload="runRepaintTest()">
-<p id="description"></p>
-<div id="console"></div>
-<script src="resources/use-instanceRoot-event-bubbling.js"></script>
</del><ins>+<body>
+<p id="description"/>
+<div id="console"/>
+<script src="resources/use-instanceRoot-event-bubbling.js"/>
</ins><span class="cx"> </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkLayoutTestssvgcustomuseinstanceRootmodificationssvg"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/svg/custom/use-instanceRoot-modifications.svg (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/use-instanceRoot-modifications.svg        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/svg/custom/use-instanceRoot-modifications.svg        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,38 +0,0 @@
</span><del>-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg viewBox="0 0 400 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<defs>
- <g id="g">
- <rect id="rect" stroke-width="5px" fill="red" stroke="navy" width="60" height="10"/>
- <circle id="circle" opacity="0.5" fill="green" cx="30" cy="5" r="10"/>
- </g>
-</defs>
-
-<use x="25" y="25" xlink:href="#g"/>
-<use x="125" y="25" xlink:href="#g"/>
-
-<text id="text" x="70" y="70">Test failed.</text>
-
-<script>
-function runInstanceRootTest() {
- var useElement = document.getElementsByTagName("use")[1];
- var element = document.getElementById("g");
-
- // element.firstChild is a #text node! the next sibling gives the rect
- var rect = element.firstChild.nextSibling;
- if (rect != document.getElementById("rect"))
- return;
-
- // rect.nextSibling is a #text node! the next sibling gives the circle
- var circle = rect.nextSibling.nextSibling;
- if (circle != document.getElementById("circle"))
- return;
-
- rect.setAttribute("fill", "green");
- circle.setAttribute("opacity", "0.8");
-
- document.getElementById("text").firstChild.nodeValue = "Test passed.";
-}
-runInstanceRootTest();
-</script>
-</svg>
</del></span></pre></div>
<a id="trunkLayoutTestssvgcustomuseinstanceRootwithuseremovedexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/svg/custom/use-instanceRoot-with-use-removed-expected.txt (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/use-instanceRoot-with-use-removed-expected.txt        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/svg/custom/use-instanceRoot-with-use-removed-expected.txt        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-PASS: Successfully removed use element.
</del></span></pre></div>
<a id="trunkLayoutTestssvgcustomuseinstanceRootwithuseremovedsvg"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/svg/custom/use-instanceRoot-with-use-removed.svg (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/use-instanceRoot-with-use-removed.svg        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/LayoutTests/svg/custom/use-instanceRoot-with-use-removed.svg        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,31 +0,0 @@
</span><del>-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<script>
-<![CDATA[
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- gc = function(){window.GCController.collect()};
-} else if (!window.gc)
- gc = function(){};
-
-window.onload = function(){
- if (location.hash != "#2") {
- if (location.hash)
- location.hash = "#" + (parseInt(location.hash.slice(1)) + 1).toString();
- else
- location.hash = "#1";
- document.getElementById("use1").parentElement.removeChild(document.getElementById("use1"));
- gc();
- setTimeout(function(){location.reload()},0);
- } else {
- document.getElementById("t1").appendChild(document.createTextNode("PASS: Successfully removed use element."));
- if (window.testRunner)
- testRunner.notifyDone();
- }
-}
-//]]>
-</script>
-<g id="g1" />
-<use xlink:href="#g1" id="use1" />
-<text x="20" y="20" fill="green" id="t1"></text>
-</svg>
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/Source/WebCore/ChangeLog        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-01-31 Darin Adler <darin@apple.com>
+
+ Stop dispatching events to with SVGElementInstance objects as their targets
+ https://bugs.webkit.org/show_bug.cgi?id=141108
+
+ Reviewed by Anders Carlsson.
+
+ Test: svg/custom/use-event-retargeting.html
+
+ * dom/EventDispatcher.cpp:
+ (WebCore::eventTargetRespectingTargetRules): Replaced the code that retargeted
+ events at SVGElementInstance objects with code that retargets them at the use
+ element instead. Also wrote the code in a simpler way.
+
</ins><span class="cx"> 2015-02-01 Zan Dobersek <zdobersek@igalia.com>
</span><span class="cx">
</span><span class="cx"> [TexMap] Optimize TextureMapperLayer::removeAllChildren()
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventDispatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventDispatcher.cpp (179466 => 179467)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventDispatcher.cpp        2015-02-01 14:53:01 UTC (rev 179466)
+++ trunk/Source/WebCore/dom/EventDispatcher.cpp        2015-02-01 15:22:57 UTC (rev 179467)
</span><span class="lines">@@ -206,25 +206,16 @@
</span><span class="cx"> inline EventTarget& eventTargetRespectingTargetRules(Node& referenceNode)
</span><span class="cx"> {
</span><span class="cx"> if (is<PseudoElement>(referenceNode)) {
</span><del>- EventTarget* hostElement = downcast<PseudoElement>(referenceNode).hostElement();
- ASSERT(hostElement);
- return *hostElement;
</del><ins>+ ASSERT(downcast<PseudoElement>(referenceNode).hostElement());
+ return *downcast<PseudoElement>(referenceNode).hostElement();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (!referenceNode.isSVGElement() || !referenceNode.isInShadowTree())
- return referenceNode;
</del><ins>+ // Events sent to elements inside an SVG use element's shadow tree go to the use element.
+ if (is<SVGElement>(referenceNode)) {
+ if (auto* useElement = downcast<SVGElement>(referenceNode).correspondingUseElement())
+ return *useElement;
+ }
</ins><span class="cx">
</span><del>- // Spec: The event handling for the non-exposed tree works as if the referenced element had been textually included
- // as a deeply cloned child of the 'use' element, except that events are dispatched to the SVGElementInstance objects
- auto& rootNode = referenceNode.treeScope().rootNode();
- Element* shadowHostElement = is<ShadowRoot>(rootNode) ? downcast<ShadowRoot>(rootNode).hostElement() : nullptr;
- // At this time, SVG nodes are not supported in non-<use> shadow trees.
- if (!shadowHostElement || !shadowHostElement->hasTagName(SVGNames::useTag))
- return referenceNode;
- SVGUseElement& useElement = downcast<SVGUseElement>(*shadowHostElement);
- if (SVGElementInstance* instance = useElement.instanceForShadowTreeElement(&referenceNode))
- return *instance;
-
</del><span class="cx"> return referenceNode;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>