RESOLVED FIXED Bug 247734
cssText serializes shorthand with var() even if some longhand is different
https://bugs.webkit.org/show_bug.cgi?id=247734
Summary cssText serializes shorthand with var() even if some longhand is different
Oriol Brufau
Reported 2022-11-10 07:54:19 PST
Run this: document.body.style.cssText = "margin: var(--m); margin-top: 1px"; document.body.style.cssText; Expected: "margin-right: ; margin-bottom: ; margin-left: ; margin-top: 1px;" Actual: "margin: var(--m);" The problem is that StyleProperties::asTextInternal() sees that margin-right is set to a pending-substitution value for margin:var(--m), and then https://searchfox.org/wubkat/rev/7a292520f6b12e8d4d9001d1480474b5c83cb0f8/Source/WebCore/css/StyleProperties.cpp#1795 sets value to "var(--m)". value = substitutionValue.shorthandValue().cssText(); The value should instead be obtained in https://searchfox.org/wubkat/rev/7a292520f6b12e8d4d9001d1480474b5c83cb0f8/Source/WebCore/css/StyleProperties.cpp#1823 value = getPropertyValue(shorthandPropertyID); which will properly detect that "var(--m)" is not a proper serialization.
Attachments
Oriol Brufau
Comment 1 2022-11-10 11:49:08 PST
EWS
Comment 2 2022-11-10 23:45:29 PST
Committed 256564@main (b7eeaa128fab): <https://commits.webkit.org/256564@main> Reviewed commits have been landed. Closing PR #6356 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2022-11-10 23:46:19 PST
Note You need to log in before you can comment on or make changes to this bug.