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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <meta charset="utf-8">
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <html>
6 <svg width="100" viewBox="0 0 200 400">
7 <title>Mixed Scripts and Writing Modes</title>
8 <style type="text/css">
9 svg {
10 font: 20px sans-serif;
11 stroke-width: 2px;
12 }
13 </style>
14 <g color="darkGreen" text-anchor="start">
15 <g id="sample" fill="currentColor" writing-mode="tb">
16 <text x="1em" y="2em">您好SVG</text>
17 </g>
18 </g>
19 </svg>
20 <script>
21 var html = document.documentElement;
22 var positions = [];
23 var textElement = document.querySelector('text');
24 for (var i=0; i<5; i++)
25 positions.push(textElement.getStartPositionOfChar(i).x);
26 html.style.zoom = 2;
27 for (var i=0; i<5; i++) {
28 newPos = textElement.getStartPositionOfChar(i).x;
29 test(function () {
30 assert_approx_equals(newPos, positions[i], 1);
31 }, "Position of character index " + i + " unaffected by zoom level");
32 }
33 html.style.zoom = 1;
34 </script>
35 <div id="log"></div>
OLDNEW
« 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