Bug 247734
Summary: | cssText serializes shorthand with var() even if some longhand is different | ||
---|---|---|---|
Product: | WebKit | Reporter: | Oriol Brufau <obrufau> |
Component: | CSS | Assignee: | Oriol Brufau <obrufau> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 247741 |
Oriol Brufau
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Oriol Brufau
Pull request: https://github.com/WebKit/WebKit/pull/6356
EWS
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
<rdar://problem/102229765>