Bug 235071

Summary: CSS Gradients: interpolation mode should default to OKLab if any non-legacy color syntax colors are used in the stops
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, clopez, darin, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, macpherson, menard, mifenton, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch
darin: review+, ews-feeder: commit-queue-
Patch none

Sam Weinig
Reported 2022-01-11 08:53:27 PST
CSS Gradients: interpolation mode should default to OKLab if any non-legacy color syntax colors are used in the stops
Attachments
Patch (25.12 KB, patch)
2022-01-11 11:18 PST, Sam Weinig
ews-feeder: commit-queue-
Patch (25.13 KB, patch)
2022-01-11 14:06 PST, Sam Weinig
ews-feeder: commit-queue-
Patch (547.86 KB, patch)
2022-01-15 10:43 PST, Sam Weinig
no flags
Patch (550.81 KB, patch)
2022-01-15 11:34 PST, Sam Weinig
no flags
Patch (551.26 KB, patch)
2022-01-15 12:11 PST, Sam Weinig
darin: review+
ews-feeder: commit-queue-
Patch (555.31 KB, patch)
2022-01-15 19:28 PST, Sam Weinig
no flags
Sam Weinig
Comment 1 2022-01-11 11:18:26 PST Comment hidden (obsolete)
Sam Weinig
Comment 2 2022-01-11 14:06:30 PST Comment hidden (obsolete)
Sam Weinig
Comment 3 2022-01-15 10:43:29 PST Comment hidden (obsolete)
EWS Watchlist
Comment 4 2022-01-15 10:44:30 PST Comment hidden (obsolete)
Sam Weinig
Comment 5 2022-01-15 11:34:27 PST Comment hidden (obsolete)
Sam Weinig
Comment 6 2022-01-15 12:11:25 PST Comment hidden (obsolete)
Darin Adler
Comment 7 2022-01-15 14:24:27 PST
Comment on attachment 449262 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=449262&action=review > Source/WebCore/css/CSSGradientValue.cpp:651 > + && m_defaultColorInterpolationMethod == other.m_defaultColorInterpolationMethod Gosh can’t wait until we get enough C++20 support that we can stop writing these functions. > Source/WebCore/css/CSSGradientValue.h:72 > - > + Please don’t add the spaces here. > Source/WebCore/css/CSSGradientValue.h:143 > + static Ref<CSSLinearGradientValue> create(CSSGradientRepeat repeat, CSSGradientType gradientType, ColorInterpolationMethod colorInterpolationMethod, CSSGradientDefaultColorInterpolationMethod defaultColorInterpolationMethod, CSSGradientColorStopList stops) Frustrating how long these argument names and types are. > Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:3132 > + downcast<CSSRadialGradientValue>(result.get())->setFirstRadius(WTFMove(firstRadius)); > + downcast<CSSRadialGradientValue>(result.get())->setSecondRadius(WTFMove(secondRadius)); Can use (*result). here instead of (result.get())-> > Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:3567 > + auto [computedColorInterpolationMethod, computedDefaultColorInterpolationMethod] = computeGradientColorInterpolationMethod(context, colorInterpolationMethod, *stops); Reading this over and over again makes me wonder why we don’t pass these two around together as a struct.
Sam Weinig
Comment 8 2022-01-15 19:28:14 PST
Sam Weinig
Comment 9 2022-01-15 19:50:34 PST
(In reply to Darin Adler from comment #7) > Comment on attachment 449262 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=449262&action=review > > > > Source/WebCore/css/CSSGradientValue.h:72 > > - > > + > > Please don’t add the spaces here. Fixed. > > Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:3132 > > + downcast<CSSRadialGradientValue>(result.get())->setFirstRadius(WTFMove(firstRadius)); > > + downcast<CSSRadialGradientValue>(result.get())->setSecondRadius(WTFMove(secondRadius)); > > Can use (*result). here instead of (result.get())-> Fixed. > > Source/WebCore/css/CSSGradientValue.h:143 > > + static Ref<CSSLinearGradientValue> create(CSSGradientRepeat repeat, CSSGradientType gradientType, ColorInterpolationMethod colorInterpolationMethod, CSSGradientDefaultColorInterpolationMethod defaultColorInterpolationMethod, CSSGradientColorStopList stops) > > Frustrating how long these argument names and types are. > > > > Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:3567 > > + auto [computedColorInterpolationMethod, computedDefaultColorInterpolationMethod] = computeGradientColorInterpolationMethod(context, colorInterpolationMethod, *stops); > > Reading this over and over again makes me wonder why we don’t pass these two > around together as a struct. Yeah, I agree. Fixed.
EWS
Comment 10 2022-01-15 22:23:49 PST
Committed r288071 (246091@main): <https://commits.webkit.org/246091@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 449280 [details].
Radar WebKit Bug Importer
Comment 11 2022-01-15 22:24:17 PST
Note You need to log in before you can comment on or make changes to this bug.