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

Unified Diff: LayoutTests/fast/css/font-shorthand.html

Issue 677103002: Expand system font values during property parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove isExpandedShorthandForAll. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/css/font-shorthand-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5090dcd713457eca45f74f40288fc19f60206394 100644
--- a/LayoutTests/fast/css/font-shorthand.html
+++ b/LayoutTests/fast/css/font-shorthand.html
@@ -1,44 +1,58 @@
-<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");
+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');
+
+// 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('-webkit-mini-control', true);
+showFontLonghands('-webkit-small-control', true);
+showFontLonghands('-webkit-control', true);
// 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');
+showFontLonghands("caption italic");
+showFontLonghands("icon 12px");
+showFontLonghands("icon 12px serif");
+showFontLonghands("menu italic 12px");
</script>
-</body>
-</html>
« no previous file with comments | « no previous file | LayoutTests/fast/css/font-shorthand-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698