Chromium Code Reviews| Index: LayoutTests/cssom/ahem-ex-units.html |
| diff --git a/LayoutTests/cssom/ahem-ex-units.html b/LayoutTests/cssom/ahem-ex-units.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4273b70ff91c467ff0686e22a430ded75370b664 |
| --- /dev/null |
| +++ b/LayoutTests/cssom/ahem-ex-units.html |
| @@ -0,0 +1,40 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<style> |
| +* { font-size: 16px; } |
| +svg, rect, div { font-family: 'Ahem'; } |
| +</style> |
| +<html> |
| +<svg id="svg" width="0" height="0"></svg> |
| +<script src="../resources/js-test.js"></script> |
| +<script> |
| +description("Test ex unit with Ahem font"); |
| + |
| +function computedStyleDiv(property, value) { |
| + var div = document.createElement("div"); |
| + document.body.appendChild(div); |
| + div.style[property] = value; |
| + var computedValue = getComputedStyle(div).getPropertyValue(property); |
| + document.body.removeChild(div); |
| + return computedValue; |
| +} |
| + |
| +function computedStyleRect(property, value) { |
| + var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); |
| + document.getElementById("svg").appendChild(rect); |
| + rect.setAttribute(property, value); |
| + var computedValue = getComputedStyle(rect).getPropertyValue(property); |
| + document.getElementById("svg").removeChild(rect); |
| + return computedValue; |
| +} |
| + |
| + |
| +function testComputed(property, value, expected) { |
| + shouldBeEqualToString('computedStyleDiv("' + property + '", "' + value + '")', expected); |
| + shouldBeEqualToString('computedStyleRect("' + property + '", "' + value + '")', expected); |
| +} |
| + |
| +testComputed("word-spacing", "1ex", "12.8000001907349px"); |
|
eae
2015/03/05 19:39:44
I'd rather not add yet another test that depends o
Erik Dahlström (inactive)
2015/03/06 09:05:01
Done.
|
| +</script> |
| +</body> |
| +</html> |