Bug 1450714 [wpt PR 10270] - Serialize font shorthand like any other shorthand, a=testonly
authorChris Nardi <cnardi@chromium.org>
Mon, 09 Apr 2018 21:32:14 +0000
changeset 467249 3f0a1ed7321692654d74ee66b280fe4ce0e699b9
parent 467248 8cfc4131191bfd7fc017bcaf2702396b94bb8173
child 467250 1cb51ca5e7004b25c5a3150552dbc1c7e0b7375c
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1450714, 10270, 827921, 989834, 547607
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1450714 [wpt PR 10270] - Serialize font shorthand like any other shorthand, a=testonly Automatic update from web-platform-testsSerialize font shorthand like any other shorthand The font shorthand had a short-circuit in StylePropertySerializer, which meant that it was never serialized as a shorthand for style.cssText, citing reasons of web incompatibility. However, it appears that all other major browsers serialize font as a shorthand instead of having style.cssText expand to all properties. Remove this short-circuit to match other browsers. Bug: 827921 Change-Id: I4d522b41a6153808b6b8dab17831afdd8315fdc3 Reviewed-on: https://chromium-review.googlesource.com/989834 Commit-Queue: Chris Nardi <cnardi@chromium.org> Reviewed-by: Timothy Loh <timloh@chromium.org> Cr-Commit-Position: refs/heads/master@{#547607} wpt-commits: 939b30a8b26ee46598d531034b40baf87d33f08a wpt-pr: 10270 wpt-commits: 939b30a8b26ee46598d531034b40baf87d33f08a wpt-pr: 10270
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/css/cssom/font-shorthand-serialization.html
testing/web-platform/tests/css/cssom/serialize-variable-reference.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -319746,16 +319746,22 @@
     ]
    ],
    "css/cssom/escape.html": [
     [
      "/css/cssom/escape.html",
      {}
     ]
    ],
+   "css/cssom/font-shorthand-serialization.html": [
+    [
+     "/css/cssom/font-shorthand-serialization.html",
+     {}
+    ]
+   ],
    "css/cssom/getComputedStyle-dynamic-subdoc.html": [
     [
      "/css/cssom/getComputedStyle-dynamic-subdoc.html",
      {}
     ]
    ],
    "css/cssom/getComputedStyle-pseudo.html": [
     [
@@ -534345,16 +534351,20 @@
   "css/cssom/cssstyledeclaration-mutability.html": [
    "5f29436964d01c57f61d513cee5b83281643ac54",
    "testharness"
   ],
   "css/cssom/escape.html": [
    "c9ed57c7ef7a035c25feff4ea60547a57d727f31",
    "testharness"
   ],
+  "css/cssom/font-shorthand-serialization.html": [
+   "9d0bce1c0d74bf90aca1eb8ee6aa2e2ed2b92b30",
+   "testharness"
+  ],
   "css/cssom/getComputedStyle-dynamic-subdoc.html": [
    "45d94c17f0a88877a8218135c94d331afcdf7df4",
    "testharness"
   ],
   "css/cssom/getComputedStyle-pseudo.html": [
    "a2033405d6852cdeb4c3b8cf628f7c1d8f7cd1aa",
    "testharness"
   ],
@@ -534450,17 +534460,17 @@
    "51f6a0c4a0c693338245409c60784f1a73fafb76",
    "testharness"
   ],
   "css/cssom/serialize-values.html": [
    "53c094e381ba06f111ab8b379debaa6becb40802",
    "testharness"
   ],
   "css/cssom/serialize-variable-reference.html": [
-   "85a25fcb99fe433e3f71bc1b6fec92815da2704d",
+   "65054797d336c1a4b77c6f66e7b466dc24095517",
    "testharness"
   ],
   "css/cssom/setproperty-null-undefined.html": [
    "8521d827e1e641c3b856854c38eac66a97ddf690",
    "testharness"
   ],
   "css/cssom/shorthand-serialization.html": [
    "0240668113cb5c280dcb76d8eabfa28d0ed9cb52",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/cssom/font-shorthand-serialization.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<meta charset="utf-8">
+<title>Serialization of font shorthand</title>
+<link rel="help" href="https://drafts.csswg.org/cssom-1/#serialize-a-css-declaration-block">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="target" style="font: 10px/1 Ahem;"></div>
+<script>
+    test(function() {
+        var target = document.getElementById('target');
+        assert_equals(target.style.cssText, 'font: 10px/1 Ahem;');
+        assert_equals(target.style.font, '10px/1 Ahem');
+    }, "The font shorthand should be serialized just like any other shorthand.");
+</script>
+</html>
--- a/testing/web-platform/tests/css/cssom/serialize-variable-reference.html
+++ b/testing/web-platform/tests/css/cssom/serialize-variable-reference.html
@@ -9,28 +9,28 @@
 <div id="shorthand-whitespace" style="font: var(--a);"></div>
 <div id="longhand" style="font-size:var(--a);"></div>
 <div id="shorthand" style="font:var(--a);"></div>
 <script>
     test(function() {
         var elem = document.getElementById('longhand-whitespace');
 
         assert_equals(elem.style.cssText, 'font-size: var(--a);');
-    }, 'Longhand with variable preserves original serialization: with withespace')
+    }, 'Longhand with variable preserves original serialization: with whitespace')
 
     test(function() {
         var elem = document.getElementById('shorthand-whitespace');
 
         assert_equals(elem.style.cssText, 'font: var(--a);');
-    }, 'Shorthand with variable preserves original serialization: with withespace')
+    }, 'Shorthand with variable preserves original serialization: with whitespace')
 
     test(function() {
         var elem = document.getElementById('longhand');
 
         assert_equals(elem.style.cssText, 'font-size:var(--a);');
-    }, 'Longhand with variable preserves original serialization: without withespace')
+    }, 'Longhand with variable preserves original serialization: without whitespace')
 
     test(function() {
         var elem = document.getElementById('shorthand');
 
         assert_equals(elem.style.cssText, 'font:var(--a);');
-    }, 'Shorthand with variable preserves original serialization: without withespace')
+    }, 'Shorthand with variable preserves original serialization: without whitespace')
 </script>