Chromium Code Reviews| Index: LayoutTests/fast/css/font-shorthand.html |
| diff --git a/LayoutTests/fast/css/font-shorthand.html b/LayoutTests/fast/css/font-shorthand.html |
| index ad7af5a971550e4c5aa04518d1ea1a5ba9a6f052..7d2159c21cdd69f9c8780850b87c003928a5fab7 100644 |
| --- a/LayoutTests/fast/css/font-shorthand.html |
| +++ b/LayoutTests/fast/css/font-shorthand.html |
| @@ -1,44 +1,51 @@ |
| -<html> |
| -<head> |
| +<!DOCTYPE html> |
| +<div id="target"></div> |
| +<pre id="output"></pre> |
| <script> |
| - if (window.testRunner) |
| - testRunner.dumpAsText(); |
| -</script> |
| -</head> |
| -<body> |
| -<div id="foo">Test</div> |
| -<script> |
| -function testFontValue(value) |
| +if (window.testRunner) { |
| + testRunner.dumpAsText(); |
| +} |
| + |
| +var style = target.style; |
| +function showFontLonghands(fontValue, suppressLonghandValue) |
| { |
| - document.write("Font for '" + value + "':<br>"); |
| - var element = document.getElementById("foo"); |
| - var decl = element.style; |
| - decl.font = ""; |
| - decl.font = value; |
| - for (var i = 0; i < decl.length; i++) { |
| - document.write(decl[i] + ": " + decl.getPropertyValue(decl[i])); |
| - document.write("<br>"); |
| + output.textContent += 'Longhands for font: ' + fontValue + '\n'; |
| + style.font = ''; |
| + style.font = fontValue; |
| + for (var i = 0; i < style.length; i++) { |
| + output.textContent += style[i]; |
| + if (!suppressLonghandValue) { |
| + output.textContent += ': ' + style.getPropertyValue(style[i]); |
| + } |
| + output.textContent += '\n'; |
| } |
| - document.write("<br>"); |
| + output.textContent += '\n'; |
| } |
| -testFontValue("12px monospace"); |
| -testFontValue("12px/24px serif"); |
| -testFontValue("normal 12px serif"); |
| -testFontValue("normal normal 12px serif"); |
| -testFontValue("normal normal normal 12px serif"); |
| -testFontValue("italic small-caps 12px/24px serif"); |
| -testFontValue("italic bold 12px/24px serif"); |
| -testFontValue("small-caps bold 14px/28px Arial, sans-serif"); |
| -testFontValue("italic small-caps bold 14px/28px Arial, sans-serif"); |
| +// Suppress showing the longhand values for system fonts because they are platform specific. |
| +// Platform specific system font styles are covered in fast/css/css2-system-fonts.html. |
| +showFontLonghands('caption', true); |
| +showFontLonghands('icon', true); |
| +showFontLonghands('menu', true); |
| +showFontLonghands('message-box', true); |
| +showFontLonghands('small-caption', true); |
| +showFontLonghands('status-bar', true); |
| + |
| +showFontLonghands('12px monospace'); |
| +showFontLonghands('12px/24px serif'); |
| +showFontLonghands('normal 12px serif'); |
| +showFontLonghands('normal normal 12px serif'); |
| +showFontLonghands('normal normal normal 12px serif'); |
| +showFontLonghands('italic small-caps 12px/24px serif'); |
| +showFontLonghands('italic bold 12px/24px serif'); |
| +showFontLonghands('small-caps bold 14px/28px Arial, sans-serif'); |
| +showFontLonghands('italic small-caps bold 14px/28px Arial, sans-serif'); |
| // Invalid values should yield no longhands. |
| -testFontValue("italic small-caps bold 12px/24px"); |
| -testFontValue("italic small-caps bold 12px"); |
| -testFontValue("italic small-caps bold /12px serif"); |
| -testFontValue("italic small-caps small-caps 12px serif"); |
| -testFontValue("italic italic small-caps bold 12px serif"); |
| -testFontValue("12px/italic serif"); |
| +showFontLonghands('italic small-caps bold 12px/24px'); |
| +showFontLonghands('italic small-caps bold 12px'); |
| +showFontLonghands('italic small-caps bold /12px serif'); |
| +showFontLonghands('italic small-caps small-caps 12px serif'); |
| +showFontLonghands('italic italic small-caps bold 12px serif'); |
| +showFontLonghands('12px/italic serif'); |
|
apavlov
2014/03/20 15:27:49
This test is missing invalid "font" values involvi
|
| </script> |
| -</body> |
| -</html> |