Bug 204347

Summary: CSSFastPaths::parseColor should handle more color specifications
Product: WebKit Reporter: Chris Lord <clord>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: simon.fraser
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 182686    

Chris Lord
Reported 2019-11-19 03:13:15 PST
Currently, the fast path handles keywords, hex colours and rgb/rgba, but doesn't handle rgb/rgba when the colour is terminated early and doesn't handle hsl/hsla. It would be helpful to handle those other cases, mainly so that OffscreenCanvas doesn't need to use the full parser to parse colours. Though this would be a small perf win in some (what I expect are) uncommon situations, this is mainly to help with OffscreenCanvas.
Attachments
Chris Lord
Comment 1 2019-11-20 03:52:59 PST
I no longer think this is a good idea, given better understanding of the colour spec. I don't think hsl(a) is used often enough to warrant maintaining a fast-path for, and I don't think the various odd but accepted ways of specifying colours make sense to complicate this code over. Regards to OffscreenCanvas, I'm taking the path of just making the full parser path verified thread-safe.
Note You need to log in before you can comment on or make changes to this bug.