RESOLVED DUPLICATE of bug 230389 225209
CSS shorthands with var() should serialize with var()
https://bugs.webkit.org/show_bug.cgi?id=225209
Summary CSS shorthands with var() should serialize with var()
Oriol Brufau
Reported 2021-04-29 13:51:32 PDT
Run this code: ```js document.body.style.cssText = "--m:10px; margin:var(--m)"; document.body.style.margin; ``` **Actual**: "" **Expected: "var(--m)" See https://drafts.csswg.org/css-variables/#variables-in-shorthands > while [CSSOM] defines that shorthand properties are serialized > by appropriately concatenating the values of their corresponding longhands, > shorthands that are specified with explicit var() functions > must serialize to the original, var()-containing value.
Attachments
Radar WebKit Bug Importer
Comment 1 2021-05-06 13:52:13 PDT
Ahmad Saleem
Comment 2 2022-07-28 14:40:04 PDT
Safari seems to pass all test from WPT about CSS Var Serialize: https://wpt.fyi/results/css/css-variables/vars-border-shorthand-serialize.html?label=master&label=experimental&aligned&q=shorthand Anything else needed here? Thanks!
Oriol Brufau
Comment 3 2022-07-28 14:50:23 PDT
The problem here was when serializing a shorthand set to a variable. That test is unrelated, it checks the serialization of subshorthands. But anyways this was fixed in bug 230389. *** This bug has been marked as a duplicate of bug 230389 ***
Note You need to log in before you can comment on or make changes to this bug.