gecko-dev/layout/style/test/test_clip-path_polygon.html
Ting-Yu Lin 34dfa1cea5 Bug 1399767 - Remove preference "layout.css.clip-path-shapes.enabled". r=heycam
The variables (basicShapeSVGBoxValues, etc.) in property_database.js are
moved to the beginning of the file so that they're defined before usage.

MozReview-Commit-ID: 7L3obIY1alP

--HG--
extra : rebase_source : 6c3dff5ecbdad8ef6cf1a49953e4ad1001620b6c
2017-09-15 15:00:30 +08:00

41 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<style>
body {padding: 0;margin:0;}
div {
width: 200px;
height: 200px;
position: fixed;
top: 50px;
left: 50px;
margin: 50px;
padding: 50px;
border: 50px solid red;
transform-origin: 0 0;
transform: translate(50px, 50px) scale(0.5);
background-color: green;
clip-path: polygon(0 0, 200px 0, 0 200px) content-box;
}
</style>
<title>clip-path with polygon() hit test</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<div id="a"></div>
<p style="margin-top: 110px">
<script>
var a = document.getElementById("a");
isnot(a, document.elementFromPoint(199, 199), "a shouldn't be found");
isnot(a, document.elementFromPoint(199, 250), "a shouldn't be found");
isnot(a, document.elementFromPoint(250, 199), "a shouldn't be found");
isnot(a, document.elementFromPoint(255, 255), "a shouldn't be found");
isnot(a, document.elementFromPoint(301, 200), "a shouldn't be found");
isnot(a, document.elementFromPoint(200, 301), "a shouldn't be found");
is(a, document.elementFromPoint(200, 200), "a should be found");
is(a, document.elementFromPoint(299, 200), "a should be found");
is(a, document.elementFromPoint(200, 299), "a should be found");
is(a, document.elementFromPoint(250, 250), "a should be found");
</script>
</html>