Bug 224411 - Update color-contrast() to support a target contrast ratio
Summary: Update color-contrast() to support a target contrast ratio
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-10 19:35 PDT by Sam Weinig
Modified: 2021-04-12 13:25 PDT (History)
10 users (show)

See Also:


Attachments
Patch (12.19 KB, patch)
2021-04-10 19:44 PDT, Sam Weinig
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (12.19 KB, patch)
2021-04-11 09:32 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff

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