[Webkit-unassigned] [Bug 247734] New: cssText serializes shorthand with var() even if some longhand is different
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Nov 10 07:54:19 PST 2022
https://bugs.webkit.org/show_bug.cgi?id=247734
Bug ID: 247734
Summary: cssText serializes shorthand with var() even if some
longhand is different
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: CSS
Assignee: webkit-unassigned at lists.webkit.org
Reporter: obrufau at igalia.com
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.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221110/c8aeb960/attachment-0001.htm>
More information about the webkit-unassigned
mailing list