Bug 249019 - StylePropertyMap should return CSS values exactly as they were set
Summary: StylePropertyMap should return CSS values exactly as they were set
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 175733
  Show dependency treegraph
 
Reported: 2022-12-09 08:17 PST by Chris Dumez
Modified: 2022-12-13 14:44 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>