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

Unified Diff: LayoutTests/svg/custom/zoomed-mixed-scripts.html

Issue 1081813003: Remove effective zoom from font metrics before SVG text layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update expectations Created 5 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/svg/custom/zoomed-mixed-scripts.html
diff --git a/LayoutTests/svg/custom/zoomed-mixed-scripts.html b/LayoutTests/svg/custom/zoomed-mixed-scripts.html
new file mode 100644
index 0000000000000000000000000000000000000000..67efae80805040fc5c4d53301305ba718ae627dc
--- /dev/null
+++ b/LayoutTests/svg/custom/zoomed-mixed-scripts.html
@@ -0,0 +1,35 @@
+<!doctype html>
+<meta charset="utf-8">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<html>
+<svg width="100" viewBox="0 0 200 400">
+ <title>Mixed Scripts and Writing Modes</title>
+ <style type="text/css">
+ svg {
+ font: 20px sans-serif;
+ stroke-width: 2px;
+ }
+ </style>
+ <g color="darkGreen" text-anchor="start">
+ <g id="sample" fill="currentColor" writing-mode="tb">
+ <text x="1em" y="2em">您好SVG</text>
+ </g>
+ </g>
+</svg>
+<script>
+ var html = document.documentElement;
+ var positions = [];
+ var textElement = document.querySelector('text');
+ for (var i=0; i<5; i++)
+ positions.push(textElement.getStartPositionOfChar(i).x);
+ html.style.zoom = 2;
+ for (var i=0; i<5; i++) {
+ newPos = textElement.getStartPositionOfChar(i).x;
+ test(function () {
+ assert_approx_equals(newPos, positions[i], 1);
+ }, "Position of character index " + i + " unaffected by zoom level");
+ }
+ html.style.zoom = 1;
+</script>
+<div id="log"></div>
« no previous file with comments | « LayoutTests/svg/custom/zoomed-baseline-shift-expected.txt ('k') | LayoutTests/svg/custom/zoomed-mixed-scripts-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698