Bug 224411

Summary: Update color-contrast() to support a target contrast ratio
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, koivisto, macpherson, menard, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch none

Description Sam Weinig 2021-04-10 19:35:00 PDT
Update color-contrast() to support a target contrast ratio
Comment 1 Sam Weinig 2021-04-10 19:44:14 PDT Comment hidden (obsolete)
Comment 2 Sam Weinig 2021-04-11 09:32:52 PDT
Created attachment 425710 [details]
Patch
Comment 3 EWS 2021-04-12 09:53:23 PDT
Committed r275826 (236396@main): <https://commits.webkit.org/236396@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425710 [details].
Comment 4 Radar WebKit Bug Importer 2021-04-12 09:54:14 PDT
<rdar://problem/76543214>
Comment 5 Darin Adler 2021-04-12 13:25:27 PDT
Comment on attachment 425710 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=425710&action=review

> Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:1533
> +    size_t indexOfColorWithHigestContrastRatio = 0;

Could use a const Color* instead of an index, and then could switch to a range-based for loop.

Or could use std::max_element instead of writing a loop.