Bug 249019

Summary: StylePropertyMap should return CSS values exactly as they were set
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: CSSAssignee: Chris Dumez <cdumez>
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: 175733    

Description Chris Dumez 2022-12-09 08:17:41 PST
StylePropertyMap should return CSS values exactly as they were set. However, our implementation passes the input to the CSS parser which may result in a slightly different representation (sometimes simplified, sometimes converted). Feeding the input through the CSS parser is useful because it validates that the value is valid for the property in question. Also, our StyleBuilder makes a lot of assumptions about the type / format of the value for a given CSS property so we cannot let the JS set CSS property values that do not match the expected type / format.

To address the issue, I added a CSSValue cache to InlineStylePropertyMap so that we can remember the CSSValues set by JavaScript and reflect them on later retrieval. I also make sure to invalidate this cache if the value of the CSS property changes using other means than the InlineStylePropertyMap.
Comment 1 Chris Dumez 2022-12-09 08:19:51 PST
Pull request: https://github.com/WebKit/WebKit/pull/7387
Comment 2 Chris Dumez 2022-12-12 16:15:59 PST
Pull request: https://github.com/WebKit/WebKit/pull/7519
Comment 3 EWS 2022-12-13 14:43:42 PST
Committed 257815@main (bfd520b659e8): <https://commits.webkit.org/257815@main>

Reviewed commits have been landed. Closing PR #7519 and removing active labels.
Comment 4 Radar WebKit Bug Importer 2022-12-13 14:44:18 PST
<rdar://problem/103321455>