OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <title>Test that alignment-baseline is unaffected by zoom level</title> | 2 <title>Test that alignment-baseline is unaffected by zoom level</title> |
3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
5 <svg width="250" height="140" viewBox="0 0 250 140" | 5 <svg width="250" height="140" viewBox="0 0 250 140" |
6 xmlns="http://www.w3.org/2000/svg" version="1.1"> | 6 xmlns="http://www.w3.org/2000/svg" version="1.1"> |
7 <style> | 7 <style> |
8 text { | 8 text { |
9 font-family: ahem; | 9 font-family: ahem; |
10 font-size: 20px; | 10 font-size: 20px; |
(...skipping 24 matching lines...) Expand all Loading... |
35 zoomLevels.forEach(function (zoom) { | 35 zoomLevels.forEach(function (zoom) { |
36 html.style.zoom = zoom; | 36 html.style.zoom = zoom; |
37 var baselineShiftDelta = (document.querySelector('text').getStartPos
itionOfChar(0).y - | 37 var baselineShiftDelta = (document.querySelector('text').getStartPos
itionOfChar(0).y - |
38 document.querySelector('tspan').getStartPositionOfChar(0).y); | 38 document.querySelector('tspan').getStartPositionOfChar(0).y); |
39 test(function () { | 39 test(function () { |
40 assert_approx_equals(baselineShiftDelta, expectedDeltas[alignmen
tBaselineValue], 1); | 40 assert_approx_equals(baselineShiftDelta, expectedDeltas[alignmen
tBaselineValue], 1); |
41 }, "Text bounds height at zoom " + zoom + " with alignment-baseline=
" + alignmentBaselineValue); | 41 }, "Text bounds height at zoom " + zoom + " with alignment-baseline=
" + alignmentBaselineValue); |
42 }); | 42 }); |
43 }); | 43 }); |
44 html.style.zoom = 1; | 44 html.style.zoom = 1; |
| 45 // Clean up to avoid being classified as a text test; avoids an -expected.tx
t file. |
| 46 document.querySelector('text').remove(); |
45 </script> | 47 </script> |
46 </svg> | 48 </svg> |
47 <p>This test requires the Ahem font</p> | |
OLD | NEW |