[webkit-reviews] review granted: [Bug 203439] Web Inspector: Display color swatches for p3 colors : [Attachment 382517] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 31 22:52:05 PDT 2019


Devin Rousso <drousso at apple.com> has granted Nikita Vasilyev
<nvasilyev at apple.com>'s request for review:
Bug 203439: Web Inspector: Display color swatches for p3 colors
https://bugs.webkit.org/show_bug.cgi?id=203439

Attachment 382517: Patch

https://bugs.webkit.org/attachment.cgi?id=382517&action=review




--- Comment #15 from Devin Rousso <drousso at apple.com> ---
Comment on attachment 382517
  --> https://bugs.webkit.org/attachment.cgi?id=382517
Patch

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

r=me, nice tests!

Please create a followup bug for supporting `WI.Color.prototype.nextFormat`
with `WI.Color.Format.ColorFunction` and add it as a FIXME inside the
function's body.  Otherwise, right now, we'd fail an assertion and log an error
if a user tries to shift-click on a `color(...)` swatch.

> Source/WebInspectorUI/UserInterface/Models/Color.js:35
> +	   this.gamut = gamut || "srgb";

We should pass in `this.gamut` when creating new `WI.Color` inside
`WI.Color.prototype.copy` as well.

> Source/WebInspectorUI/UserInterface/Models/Color.js:591
> +

Style: unnecessary newline

> Source/WebInspectorUI/UserInterface/Models/Color.js:648
> +    Function: "color-format-function",

Rather than just `Function`, can we use something more specific like
`ColorFunction`?  Given that rgb/rgba/hsl/hsla are also functions, the more
general name could be confusing.

> Source/WebInspectorUI/UserInterface/Models/Color.js:654
> +    "color",

NIT: is there a reason this is after "rgba" instead of just at the end as a new
value?	Regardless, we should try to be consistent with the ordering in
`WI.Color.Format` (and all the `switch`).


More information about the webkit-reviews mailing list