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

Unified Diff: third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox.html

Issue 1775363002: Avoiding losing too much precision when hit-testing SVG <text> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use HitTestLocation(const FloatPoint&) Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox.html
diff --git a/third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox.html b/third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox.html
new file mode 100644
index 0000000000000000000000000000000000000000..74f2ba3b41f2baceb3a87c67a3dfc878168c7473
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Hit-test of text with fractional (&lt; 1) font-size and small (high scalefactor) viewBox</title>
+<script src="../../resources/ahem.js"></script>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+svg {
+ margin: 0px;
+ padding: 0px;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 800px;
+}
+</style>
+<svg viewBox="0 0 22 28">
+ <text font-family="Ahem" font-size="0.125" fill="blue" y="2.438"><a xlink:href="#">ABCDEFGH</a></text>
+</svg>
+<script>
+test(function() {
+ var referenceElement = document.querySelector('a');
+ [
+ { x: 2, y: 85 },
+ { x: 4, y: 87 },
+ { x: 2, y: 89 },
+ { x: 6, y: 85 },
+ { x: 4, y: 87 },
+ { x: 6, y: 89 },
+ { x: 10, y: 87 },
+ { x: 14, y: 87 },
+ { x: 18, y: 87 },
+ { x: 22, y: 87 },
+ { x: 26, y: 87 },
+ ].forEach(function(point) {
+ assert_equals(document.elementFromPoint(point.x, point.y), referenceElement, point.x + ',' + point.y);
+ });
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698