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

Side by Side Diff: LayoutTests/svg/custom/zoomed-ex-em-font-sizes.html

Issue 1283463003: Remove effective zoom from font metrics before length calculations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Avoid hardcoded values in test Created 5 years, 4 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
« no previous file with comments | « no previous file | Source/core/svg/SVGLengthContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Test that ex, em, rem and ch font sizes are unaffected by zoom level</tit le>
3 <script src="../../resources/ahem.js"></script>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <style>
7 svg {
8 font-size: 100px;
9 font-family: ahem;
10 }
11 </style>
12 <svg width="100%" height="1em" xmlns="http://www.w3.org/2000/svg" version="1.1">
13
14 <text id="em" y="1em" dy="4em">XXXXXX XXX</text>
15 <text id="rem" y="1em" dy="25rem">XXXXXX XXX</text>
16 <text id="ex" y="1em" dy="5ex">XXXXXX XXX</text>
17 <text id="ch" y="1em" dy="4ch">XXXXXX XXX</text>
18
19 <script>
20 var zoomLevels = [0.3, 4];
21 var html = document.documentElement;
22 var textElements = document.querySelectorAll('text');
23
24 [].forEach.call(textElements, function(elm) {
25 html.style.zoom = 1;
26 var reference_y = elm.getStartPositionOfChar(0).y;
27
28 zoomLevels.forEach(function (zoom) {
29 html.style.zoom = zoom;
30 test(function () {
31 assert_approx_equals(elm.getStartPositionOfChar(0).y, reference_ y, 1);
32 }, "Unit " + elm.id + " not affected by zoom level " + zoom);
33 });
34
35 // Clean up to avoid being classified as a text test; avoids an -expecte d.txt file.
36 elm.remove();
37 });
38 html.style.zoom = 1;
39 </script>
40 </svg>
OLDNEW
« no previous file with comments | « no previous file | Source/core/svg/SVGLengthContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698