Bug 246595 - Change CSSValue types to have immutable value semantics
Summary: Change CSSValue types to have immutable value semantics
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 246315 246594
Blocks:
  Show dependency treegraph
 
Reported: 2022-10-16 13:04 PDT by Sam Weinig
Modified: 2022-10-23 13:05 PDT (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 Sam Weinig 2022-10-16 13:04:50 PDT
To create a clear boundary and allow for more caching opportunities, we should convert the CSSValue types to have immutable value semantics, moving whatever remains to the style / style building system.

In the end, I would like to have a type for each possible top level css value, and make CSSValue itself a type-erasing wrapper of sorts:

struct CSSValue {
    std::variant<
        // Each css value type here.
    > value;
};


We can use this opportunity to create more strongly typed results coming out of the parser, so style building does not have to do quite as much type checking or assuming.
Comment 1 Radar WebKit Bug Importer 2022-10-23 13:05:18 PDT
<rdar://problem/101479589>