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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/font-shorthand-from-longhands.html

Issue 1519643002: Serialize font shorthand as empty string if any longhand is not specified (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: third_party/WebKit/LayoutTests/fast/css/font-shorthand-from-longhands.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/font-shorthand-from-longhands.html b/third_party/WebKit/LayoutTests/fast/css/font-shorthand-from-longhands.html
index 36373c21467b37078eaf007f2532ba7dba28a0ca..92c584df0822a9effed033345fa18d595739dc2e 100644
--- a/third_party/WebKit/LayoutTests/fast/css/font-shorthand-from-longhands.html
+++ b/third_party/WebKit/LayoutTests/fast/css/font-shorthand-from-longhands.html
@@ -34,7 +34,7 @@ function checkFontStyleValue() {
}
style.fontSize = "20px";
-// We need at least the font-family to build the shorthand.
+// We need all font longhands to build the shorthand.
shouldBe("style.font", "''");
shouldBe("computedStyle.font", "'normal normal normal normal 20px / normal foobar'");
shouldBe("computedStyle.fontSize", "'20px'");
@@ -42,33 +42,34 @@ shouldBe("checkFontStyleValue()", "true");
style.fontSize = "20px";
style.fontFamily = "sans-serif";
-shouldBe("style.font", "'20px sans-serif'");
+shouldBe("style.font", "''");
shouldBe("computedStyle.font", "'normal normal normal normal 20px / normal sans-serif'");
shouldBe("computedStyle.fontFamily", "'sans-serif'");
-shouldBe("checkFontStyleValue()", "true");
style.fontStyle = "italic";
-shouldBe("style.font", "'italic 20px sans-serif'");
+shouldBe("style.font", "''");
shouldBe("computedStyle.font", "'italic normal normal normal 20px / normal sans-serif'");
shouldBe("computedStyle.fontStyle", "'italic'");
-shouldBe("checkFontStyleValue()", "true");
style.fontVariant = "small-caps";
-shouldBe("style.font", "'italic small-caps 20px sans-serif'");
+shouldBe("style.font", "''");
shouldBe("computedStyle.font", "'italic small-caps normal normal 20px / normal sans-serif'");
shouldBe("computedStyle.fontVariant", "'small-caps'");
-shouldBe("checkFontStyleValue()", "true");
style.fontWeight = "bold";
-shouldBe("style.font", "'italic small-caps bold 20px sans-serif'");
+shouldBe("style.font", "''");
shouldBe("computedStyle.font", "'italic small-caps bold normal 20px / normal sans-serif'");
shouldBe("computedStyle.fontWeight", "'bold'");
-shouldBe("checkFontStyleValue()", "true");
style.lineHeight = "40px";
-shouldBe("style.font", "'italic small-caps bold 20px/40px sans-serif'");
+shouldBe("style.font", "''");
shouldBe("computedStyle.font", "'italic small-caps bold normal 20px / 40px sans-serif'");
shouldBe("computedStyle.lineHeight", "'40px'");
+
+style.fontStretch = "ultra-expanded";
+// All font longhands are set, therefore shorthand is built
+shouldBe("style.font", "'italic small-caps bold ultra-expanded 20px/40px sans-serif'");
+shouldBe("computedStyle.font", "'italic small-caps bold ultra-expanded 20px / 40px sans-serif'");
shouldBe("checkFontStyleValue()", "true");
style.font = "";
@@ -76,22 +77,6 @@ shouldBe("style.font", "''");
shouldBe("computedStyle.font", "'normal normal normal normal 16px / normal foobar'");
shouldBe("checkFontStyleValue()", "true");
-style.fontWeight = "bold";
-// It is normal to return null as the font-size is mandatory to build the shorthand.
-shouldBe("style.font", "''");
-shouldBe("computedStyle.font", "'normal normal bold normal 16px / normal foobar'");
-shouldBe("computedStyle.fontWeight", "'bold'");
-shouldBe("checkFontStyleValue()", "true");
-
-style.fontSize = "40px";
-style.fontFamily = "sans-serif";
-style.fontWeight = "bold";
-shouldBe("style.font", "'bold 40px sans-serif'");
-shouldBe("computedStyle.font", "'normal normal bold normal 40px / normal sans-serif'");
-shouldBe("computedStyle.fontSize", "'40px'");
-shouldBe("computedStyle.fontFamily", "'sans-serif'");
-shouldBe("checkFontStyleValue()", "true");
-
document.body.removeChild(testContainer);
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698