Bug 556661 bustage fix: test_priority_preservation.html updated to new semantics, augmented with further tests
authorZack Weinberg <zweinberg@mozilla.com>
Tue, 06 Apr 2010 17:55:57 -0700
changeset 40521 a016ac686be0d126b9aa13c6d887306095539e7f
parent 40520 54d74759a24c9cf33d8b9794bf85db58cad8271e
child 40523 b931ea32034b6ab61214cb3aaec814da8aff159d
push id12645
push userzweinberg@mozilla.com
push dateWed, 07 Apr 2010 00:56:17 +0000
treeherdermozilla-central@a016ac686be0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs556661
milestone1.9.3a4pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 556661 bustage fix: test_priority_preservation.html updated to new semantics, augmented with further tests
layout/style/test/test_priority_preservation.html
--- a/layout/style/test/test_priority_preservation.html
+++ b/layout/style/test/test_priority_preservation.html
@@ -29,40 +29,93 @@ is(s.getPropertyValue("text-decoration")
 is(s.getPropertyPriority("text-decoration"), "",
    "text-decoration priority stored");
 s.setProperty("z-index", "7", "important");
 is(s.getPropertyValue("z-index"), "7",
    "z-index stored");
 is(s.getPropertyPriority("z-index"), "important",
    "z-index priority stored");
 s.setProperty("z-index", "3", "");
-is(s.getPropertyValue("z-index"), "7",
-   "z-index not overridden by setting non-important");
-is(s.getPropertyPriority("z-index"), "important",
-   "z-index priority not overridden by setting non-important");
+is(s.getPropertyValue("z-index"), "3",
+   "z-index overridden by setting non-important");
+is(s.getPropertyPriority("z-index"), "",
+   "z-index priority overridden by setting non-important");
 is(s.getPropertyValue("text-decoration"), "underline",
    "text-decoration still stored");
 is(s.getPropertyPriority("text-decoration"), "",
    "text-decoration priority still stored");
 s.setProperty("text-decoration", "overline", "");
 is(s.getPropertyValue("text-decoration"), "overline",
    "text-decoration stored");
 is(s.getPropertyPriority("text-decoration"), "",
    "text-decoration priority stored");
-is(s.getPropertyValue("z-index"), "7",
+is(s.getPropertyValue("z-index"), "3",
    "z-index still stored");
-is(s.getPropertyPriority("z-index"), "important",
+is(s.getPropertyPriority("z-index"), "",
    "z-index priority still stored");
 s.setProperty("text-decoration", "line-through", "important");
 is(s.getPropertyValue("text-decoration"), "line-through",
    "text-decoration stored at new priority");
 is(s.getPropertyPriority("text-decoration"), "important",
    "text-decoration priority overridden");
-is(s.getPropertyValue("z-index"), "7",
+is(s.getPropertyValue("z-index"), "3",
    "z-index still stored");
-is(s.getPropertyPriority("z-index"), "important",
+is(s.getPropertyPriority("z-index"), "",
    "z-index priority still stored");
 
+  // also test setting a shorthand
+s.setProperty("font", "italic bold 12px/30px serif", "important");
+is(s.getPropertyValue("font-style"), "italic", "font-style stored");
+is(s.getPropertyPriority("font-style"), "important",
+   "font-style priority stored");
+is(s.getPropertyValue("font-weight"), "bold", "font-weight stored");
+is(s.getPropertyPriority("font-weight"), "important",
+   "font-weight priority stored");
+is(s.getPropertyValue("font-size"), "12px", "font-size stored");
+is(s.getPropertyPriority("font-size"), "important",
+   "font-size priority stored");
+is(s.getPropertyValue("line-height"), "30px", "line-height stored");
+is(s.getPropertyPriority("line-height"), "important",
+   "line-height priority stored");
+is(s.getPropertyValue("font-family"), "serif", "font-family stored");
+is(s.getPropertyPriority("font-family"), "important",
+   "font-family priority stored");
 
+is(s.getPropertyValue("text-decoration"), "line-through",
+   "text-decoration still stored");
+is(s.getPropertyPriority("text-decoration"), "important",
+   "text-decoration priority still stored");
+is(s.getPropertyValue("z-index"), "3",
+   "z-index still stored");
+is(s.getPropertyPriority("z-index"), "",
+   "z-index priority still stored");
+
+  // and overriding one element of that shorthand with some longhand
+s.setProperty("font-style", "normal", "");
+
+is(s.getPropertyValue("font-style"), "normal", "font-style overridden");
+is(s.getPropertyPriority("font-style"), "", "font-style priority overridden");
+
+is(s.getPropertyValue("font-weight"), "bold", "font-weight unchanged");
+is(s.getPropertyPriority("font-weight"), "important",
+   "font-weight priority unchanged");
+is(s.getPropertyValue("font-size"), "12px", "font-size unchanged");
+is(s.getPropertyPriority("font-size"), "important",
+   "font-size priority unchanged");
+is(s.getPropertyValue("line-height"), "30px", "line-height unchanged");
+is(s.getPropertyPriority("line-height"), "important",
+   "line-height priority unchanged");
+is(s.getPropertyValue("font-family"), "serif", "font-family unchanged");
+is(s.getPropertyPriority("font-family"), "important",
+   "font-family priority unchanged");
+
+is(s.getPropertyValue("text-decoration"), "line-through",
+   "text-decoration still stored");
+is(s.getPropertyPriority("text-decoration"), "important",
+   "text-decoration priority still stored");
+is(s.getPropertyValue("z-index"), "3",
+   "z-index still stored");
+is(s.getPropertyPriority("z-index"), "",
+   "z-index priority still stored");
 </script>
 </pre>
 </body>
 </html>