gecko-dev/testing/web-platform/tests/css/cssom/font-shorthand-serialization.html
Chris Nardi 2ca8f0adba 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
2018-04-15 09:25:21 +01:00

16 lines
654 B
HTML

<!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>