Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1382)

Side by Side Diff: third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size.html

Issue 1870983002: Only hit-test SVG <text> foreground (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test fixup Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Hit-test of &lt;text> does not hit-test the "background" (w/ small font s ize)</title>
3 <script src="../../resources/ahem.js"></script>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <style>
7 body {
8 margin: 0;
9 padding: 0;
10 }
11 g text:hover {
12 fill: red;
13 cursor: crosshair;
14 }
15 </style>
16 <svg font-family="Ahem" font-size="1.6" fill="blue" width="600" height="300">
17 <g transform="matrix(50,0,0,50,-400,-800)">
18 <text x="9.4" y="17.80">SELECT</text>
19 </g>
20 </svg>
21 <script>
22 test(function() {
23 var textElement = document.querySelector('text');
24 // Should hit <text>.
25 [
26 { x: 71, y: 28 },
27 { x: 71, y: 105 },
28 { x: 540, y: 105 },
29 { x: 540, y: 28 },
30 ].forEach(function(point) {
31 assert_equals(document.elementFromPoint(point.x, point.y), textElement, poin t.x + ',' + point.y);
32 });
33
34 var svgRoot = document.querySelector('svg');
35 // Should not hit <text>.
36 [
37 { x: 69, y: 26 },
38 { x: 69, y: 105 },
39 { x: 69, y: 107 },
40 { x: 300, y: 26 },
41 { x: 300, y: 107 },
42 { x: 550, y: 26 },
43 { x: 550, y: 105 },
44 { x: 550, y: 107 },
45 ].forEach(function(point) {
46 assert_equals(document.elementFromPoint(point.x, point.y), svgRoot, point.x + ',' + point.y);
47 });
48 });
49 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698