2009-07-12 22:50:45 +04:00
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=500174
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test Pointer Events</title>
|
2019-04-16 06:53:28 +03:00
|
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
2009-07-12 22:50:45 +04:00
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
</head>
|
2011-05-14 17:12:32 +04:00
|
|
|
<body onload="run()">
|
2009-07-12 22:50:45 +04:00
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
<![CDATA[
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
2019-03-25 22:22:09 +03:00
|
|
|
function run() {
|
2010-07-15 12:10:59 +04:00
|
|
|
var div = document.getElementById("div");
|
2011-05-14 20:55:53 +04:00
|
|
|
// Get the coords of the origin of the SVG canvas:
|
|
|
|
var originX = div.offsetLeft;
|
|
|
|
var originY = div.offsetTop;
|
2019-03-25 22:22:09 +03:00
|
|
|
var circle = document.getElementById("circle");
|
2011-05-14 20:55:53 +04:00
|
|
|
|
|
|
|
var elementFromPoint = document.elementFromPoint(originX + 55, originY + 55);
|
2011-05-14 21:06:02 +04:00
|
|
|
is(elementFromPoint, circle, 'Over circle stroke with pointer-events="all"');
|
2011-05-14 20:55:53 +04:00
|
|
|
|
|
|
|
elementFromPoint = document.elementFromPoint(originX + 205, originY + 55);
|
2019-03-25 22:22:09 +03:00
|
|
|
is(elementFromPoint, circle, "Over foreignObject, outside clip path");
|
2011-05-14 20:55:53 +04:00
|
|
|
|
|
|
|
elementFromPoint = document.elementFromPoint(originX + 225, originY + 75);
|
2011-05-14 23:10:18 +04:00
|
|
|
// XXX disabled. See See https://bugzilla.mozilla.org/show_bug.cgi?id=580983#c116
|
2019-03-25 22:22:09 +03:00
|
|
|
// is(elementFromPoint, path, 'Over foreignObject, inside clip path');
|
2009-07-12 22:50:45 +04:00
|
|
|
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
]]>
|
|
|
|
</script>
|
2010-10-17 20:27:51 +04:00
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=500174">Mozilla Bug 500174</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content">
|
|
|
|
|
|
|
|
<div width="100%" height="1" id="div">
|
|
|
|
</div>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" id="svg">
|
|
|
|
<defs>
|
|
|
|
<clipPath id="clip">
|
2011-05-14 20:55:53 +04:00
|
|
|
<rect x="20" y="20" width="30" height="30"/>
|
2010-10-17 20:27:51 +04:00
|
|
|
</clipPath>
|
|
|
|
</defs>
|
2011-05-14 20:55:53 +04:00
|
|
|
<rect id="bad" width="100%" height="100%" fill="blue"/>
|
2013-11-04 05:47:19 +04:00
|
|
|
<circle id="circle" cx="50%" cy="50%" r="500" stroke-width="500" fill="none" pointer-events="all"/>
|
2011-05-14 20:55:53 +04:00
|
|
|
<foreignObject id="fo" x="200" y="50" width="50" height="50" clip-path="url(#clip)">
|
2011-05-14 17:12:32 +04:00
|
|
|
<svg>
|
2011-05-14 23:10:18 +04:00
|
|
|
<path id="path" d="M0,0 H50 V50 H0 Z" fill="green"/>
|
2010-10-17 20:27:51 +04:00
|
|
|
</svg>
|
|
|
|
</foreignObject>
|
|
|
|
</svg>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
2009-07-12 22:50:45 +04:00
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|