mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-25 02:40:22 -10:00
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 <[email protected]> Reviewed-by: Timothy Loh <[email protected]> Cr-Commit-Position: refs/heads/master@{#547607} wpt-commits: 939b30a8b26ee46598d531034b40baf87d33f08a wpt-pr: 10270 wpt-commits: 939b30a8b26ee46598d531034b40baf87d33f08a wpt-pr: 10270
37 lines
1.6 KiB
HTML
37 lines
1.6 KiB
HTML
<!doctype html>
|
|
<meta charset="utf-8">
|
|
<title>CSSOM - Serialization with variable preserves original serialization.</title>
|
|
<link rel="help" href="https://drafts.csswg.org/css-variables/#serializing-custom-props">
|
|
<link rel="help" href="https://drafts.csswg.org/css-variables/#variables-in-shorthands">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<div id="longhand-whitespace" style="font-size: var(--a);"></div>
|
|
<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 whitespace')
|
|
|
|
test(function() {
|
|
var elem = document.getElementById('shorthand-whitespace');
|
|
|
|
assert_equals(elem.style.cssText, 'font: var(--a);');
|
|
}, '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 whitespace')
|
|
|
|
test(function() {
|
|
var elem = document.getElementById('shorthand');
|
|
|
|
assert_equals(elem.style.cssText, 'font:var(--a);');
|
|
}, 'Shorthand with variable preserves original serialization: without whitespace')
|
|
</script>
|