[Webkit-unassigned] [Bug 234798] New: Add resolved/unresolved color type accessors to require users to be explicit about whether they will handle missing/none color components

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 2 11:11:13 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=234798

            Bug ID: 234798
           Summary: Add resolved/unresolved color type accessors to
                    require users to be explicit about whether they will
                    handle missing/none color components
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Platform
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sam at webkit.org

As a precursor to 233526 ([CSS Color 4] Add support for "Missing"/"none" color components), which will require allowing color types to have components with NaN values to indicate missing and powerless components, we should use the type system to require users who want to access components to declare whether they will handle those values, or want the existing behavior (and the behavior used for rendering) where those components are converted to 0.

To do this, color types will no longer expose their components publicly, but rather, will only allow access to them via new subclasses, ResolvedColorType<ColorType> and UnresolvedColorType<ColorType> (the former doing the conversion to 0, the later doing nothing). Theses subclasses will expose the components publicly (via using directives). 

This will require call sites to change from:

auto [r, g, b, alpha] = myColorType;

to:

auto [r, g, b, alpha] = myColorType.resolved();

-- 
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/20220102/303439ce/attachment-0001.htm>


More information about the webkit-unassigned mailing list