<!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 &quot;repaint test&quot;, 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  &lt;darin@apple.com&gt;
+
+        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 &quot;repaint test&quot;, 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  &lt;gyuyoung.kim@samsung.com&gt;
</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: &quot;Test passed.&quot;
</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: &quot;Test passed.&quot;
</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: &quot;Test passed.&quot;
</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: &quot;Test passed.&quot;
</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: &quot;Test passed.&quot;
</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(&quot;Tests wheter SVG event bubbling works accross shadow trees.&quot;);
</del><ins>+description(&quot;Tests whether SVG event bubbling works across shadow trees.&quot;);
</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 = &quot;http://www.w3.org/2000/svg&quot;;
</span><span class="cx"> var xhtmlNS = &quot;http://www.w3.org/1999/xhtml&quot;;
</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 = &quot;&quot;;
</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(&quot;rectParent&quot;).setAttribute(&quot;fill&quot;, &quot;green&quot;);
</span><del>-    shouldBeTrue(&quot;successfullyParsed&quot;);
</del><span class="cx">     debug('&lt;br /&gt;&lt;span class=&quot;pass&quot;&gt;TEST COMPLETE&lt;/span&gt;');
</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] = &quot;[EventHandler 1] type: click phase: AT_TARGET target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rect)&quot;;
</del><ins>+        expected[0] = &quot;[EventHandler 1] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;;
</ins><span class="cx">         testListeners();
</span><span class="cx">         break;
</span><span class="cx">     case 2:
</span><span class="cx">         rectContainer.addEventListener(&quot;click&quot;, function(evt) { eventHandler(evt, 2) }, false);
</span><del>-        expected[1] = &quot;[EventHandler 2] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rectParent)&quot;;    
</del><ins>+        expected[1] = &quot;[EventHandler 2] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;;
</ins><span class="cx">         testListeners();
</span><span class="cx">         break;
</span><span class="cx">     case 3:
</span><span class="cx">         use.setAttribute(&quot;onclick&quot;, &quot;eventHandler(evt, 3)&quot;);
</span><del>-        expected[2] = &quot;[EventHandler 3] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGUseElement] (id: use)&quot;;
</del><ins>+        expected[2] = &quot;[EventHandler 3] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;;
</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] = &quot;[EventHandler 4] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGGElement] (id: useParent)&quot;;
</del><ins>+        expected[3] = &quot;[EventHandler 4] type: click phase: BUBBLING target: [object SVGUseElement] (id: use) currentTarget: [object SVGGElement] (id: useParent)&quot;;
</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, &quot;rect&quot;);
</span><span class="cx"> rect.id = &quot;rect&quot;;
</span><del>-rect.style.fill = &quot;red&quot;;
</del><ins>+rect.style.fill = &quot;blue&quot;;
</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 = &quot;#rectParent&quot;;
</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>+&lt;!DOCTYPE html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        * { margin: 0; padding: 0; }
+        svg { width: 200px; height: 100px; }
+        a div { width: 200px; height: 100px; background-color: yellow; }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;a href=&quot;#&quot; class=&quot;icon-link&quot;&gt;
+        &lt;svg&gt;
+            &lt;defs&gt;
+                &lt;rect id=&quot;blue-rectangle&quot; width=&quot;200&quot; height=&quot;100&quot; style=&quot;fill:#00f;&quot; /&gt;
+            &lt;/defs&gt;
+            &lt;use xlink:href=&quot;#blue-rectangle&quot;&gt;&lt;/use&gt;
+        &lt;/svg&gt;
+        &lt;div&gt;&lt;/div&gt;
+    &lt;/a&gt;
+
+    &lt;div class=&quot;log&quot;&gt;&lt;/div&gt;
+
+    &lt;script&gt;
+        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(&quot;a&quot;).addEventListener(&quot;click&quot;, function(event) {
+            var result = &quot;&quot;;
+            if (event.target == expected)
+                result = &quot;PASS - &quot; + event.target + &quot; was clicked.&quot;;
+            else
+                result = &quot;FAIL - expected &quot; + expected + &quot; but got &quot; + event.target + &quot;.&quot;;
+            document.querySelector('.log').innerHTML += result + '&lt;br /&gt;';
+            event.preventDefault();
+        }, false);
+
+        clickAt(50, 50, document.querySelector(&quot;use&quot;));
+        clickAt(50, 130, document.querySelector(&quot;a div&quot;));
+    &lt;/script&gt;
+&lt;/body&gt;
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS msg is &quot;[EventHandler 1] type: click phase: AT_TARGET target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rect)&quot;
-PASS msg is &quot;[EventHandler 1] type: click phase: AT_TARGET target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rect)&quot;
-PASS msg is &quot;[EventHandler 2] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rectParent)&quot;
-PASS msg is &quot;[EventHandler 1] type: click phase: AT_TARGET target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rect)&quot;
-PASS msg is &quot;[EventHandler 2] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rectParent)&quot;
-PASS msg is &quot;[EventHandler 3] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGUseElement] (id: use)&quot;
-PASS msg is &quot;[EventHandler 1] type: click phase: AT_TARGET target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rect)&quot;
-PASS msg is &quot;[EventHandler 2] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGElementInstance] (id: rectParent)&quot;
-PASS msg is &quot;[EventHandler 3] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGUseElement] (id: use)&quot;
-PASS msg is &quot;[EventHandler 4] type: click phase: BUBBLING target: [object SVGElementInstance] (id: rect) currentTarget: [object SVGGElement] (id: useParent)&quot;
-PASS successfullyParsed is true
</del><ins>+PASS msg is &quot;[EventHandler 1] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;
+PASS msg is &quot;[EventHandler 1] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;
+PASS msg is &quot;[EventHandler 2] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;
+PASS msg is &quot;[EventHandler 1] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;
+PASS msg is &quot;[EventHandler 2] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;
+PASS msg is &quot;[EventHandler 3] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;
+PASS msg is &quot;[EventHandler 1] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;
+PASS msg is &quot;[EventHandler 2] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;
+PASS msg is &quot;[EventHandler 3] type: click phase: AT_TARGET target: [object SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)&quot;
+PASS msg is &quot;[EventHandler 4] type: click phase: BUBBLING target: [object SVGUseElement] (id: use) currentTarget: [object SVGGElement] (id: useParent)&quot;
</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"> &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
</span><span class="cx"> &lt;head&gt;
</span><span class="cx"> &lt;script&gt;window.enablePixelTesting = true;&lt;/script&gt;
</span><del>-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../../fast/repaint/resources/repaint.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script src=&quot;../../resources/js-test-pre.js&quot;/&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><del>-&lt;body onload=&quot;runRepaintTest()&quot;&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;resources/use-instanceRoot-event-bubbling.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;body&gt;
+&lt;p id=&quot;description&quot;/&gt;
+&lt;div id=&quot;console&quot;/&gt;
+&lt;script src=&quot;resources/use-instanceRoot-event-bubbling.js&quot;/&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</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>-&lt;?xml version=&quot;1.0&quot; standalone=&quot;no&quot;?&gt;
-&lt;!DOCTYPE svg PUBLIC &quot;-//W3C//DTD SVG 1.1//EN&quot; &quot;http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd&quot;&gt;
-&lt;svg viewBox=&quot;0 0 400 300&quot; version=&quot;1.1&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
-&lt;defs&gt;
-    &lt;g id=&quot;g&quot;&gt;
-        &lt;rect id=&quot;rect&quot; stroke-width=&quot;5px&quot; fill=&quot;red&quot; stroke=&quot;navy&quot; width=&quot;60&quot; height=&quot;10&quot;/&gt;
-        &lt;circle id=&quot;circle&quot; opacity=&quot;0.5&quot; fill=&quot;green&quot; cx=&quot;30&quot; cy=&quot;5&quot; r=&quot;10&quot;/&gt;
-    &lt;/g&gt;
-&lt;/defs&gt;
-
-&lt;use x=&quot;25&quot; y=&quot;25&quot; xlink:href=&quot;#g&quot;/&gt;
-&lt;use x=&quot;125&quot; y=&quot;25&quot; xlink:href=&quot;#g&quot;/&gt;
-
-&lt;text id=&quot;text&quot; x=&quot;70&quot; y=&quot;70&quot;&gt;Test failed.&lt;/text&gt;
-
-&lt;script&gt;
-function runInstanceRootTest() {
-    var useElement = document.getElementsByTagName(&quot;use&quot;)[1];
-    var element = document.getElementById(&quot;g&quot;);
-
-    // element.firstChild is a #text node! the next sibling gives the rect
-    var rect = element.firstChild.nextSibling;
-    if (rect != document.getElementById(&quot;rect&quot;))
-        return;
-
-    // rect.nextSibling is a #text node! the next sibling gives the circle
-    var circle = rect.nextSibling.nextSibling;
-    if (circle != document.getElementById(&quot;circle&quot;))
-        return;
-
-    rect.setAttribute(&quot;fill&quot;, &quot;green&quot;);
-    circle.setAttribute(&quot;opacity&quot;, &quot;0.8&quot;);
-
-    document.getElementById(&quot;text&quot;).firstChild.nodeValue = &quot;Test passed.&quot;;
-}
-runInstanceRootTest();
-&lt;/script&gt;
-&lt;/svg&gt;
</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>-&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
-&lt;script&gt;
-&lt;![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 != &quot;#2&quot;) {
-        if (location.hash)
-            location.hash = &quot;#&quot; + (parseInt(location.hash.slice(1)) + 1).toString();
-        else
-            location.hash = &quot;#1&quot;;
-        document.getElementById(&quot;use1&quot;).parentElement.removeChild(document.getElementById(&quot;use1&quot;));
-        gc();
-        setTimeout(function(){location.reload()},0);
-    } else {
-        document.getElementById(&quot;t1&quot;).appendChild(document.createTextNode(&quot;PASS: Successfully removed use element.&quot;));
-        if (window.testRunner)
-            testRunner.notifyDone();
-    }
-}
-//]]&gt;
-&lt;/script&gt;
-&lt;g id=&quot;g1&quot; /&gt;
-&lt;use xlink:href=&quot;#g1&quot; id=&quot;use1&quot; /&gt;
-&lt;text x=&quot;20&quot; y=&quot;20&quot; fill=&quot;green&quot; id=&quot;t1&quot;&gt;&lt;/text&gt;
-&lt;/svg&gt;
</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  &lt;darin@apple.com&gt;
+
+        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  &lt;zdobersek@igalia.com&gt;
</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&amp; eventTargetRespectingTargetRules(Node&amp; referenceNode)
</span><span class="cx"> {
</span><span class="cx">     if (is&lt;PseudoElement&gt;(referenceNode)) {
</span><del>-        EventTarget* hostElement = downcast&lt;PseudoElement&gt;(referenceNode).hostElement();
-        ASSERT(hostElement);
-        return *hostElement;
</del><ins>+        ASSERT(downcast&lt;PseudoElement&gt;(referenceNode).hostElement());
+        return *downcast&lt;PseudoElement&gt;(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&lt;SVGElement&gt;(referenceNode)) {
+        if (auto* useElement = downcast&lt;SVGElement&gt;(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&amp; rootNode = referenceNode.treeScope().rootNode();
-    Element* shadowHostElement = is&lt;ShadowRoot&gt;(rootNode) ? downcast&lt;ShadowRoot&gt;(rootNode).hostElement() : nullptr;
-    // At this time, SVG nodes are not supported in non-&lt;use&gt; shadow trees.
-    if (!shadowHostElement || !shadowHostElement-&gt;hasTagName(SVGNames::useTag))
-        return referenceNode;
-    SVGUseElement&amp; useElement = downcast&lt;SVGUseElement&gt;(*shadowHostElement);
-    if (SVGElementInstance* instance = useElement.instanceForShadowTreeElement(&amp;referenceNode))
-        return *instance;
-
</del><span class="cx">     return referenceNode;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>