Hello,
This CL fixes a bug with color functions using calc() in Canvas.
See https://issues.chromium.org/issues/459135661 for details and an example.
The fix itself is very small. I've added a thorough test file to catch similar issues in the future.
Thank you for your feedback.
Best,
Felipe
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Thanks!
// Helper function to render a color and return its pixel value as rgba stringNit: consider ending comment sentences with a period. We often view one-line code snippets in tools like code search. Seeing this line without the next one might trick a reader into thinking that the sentence isn't complete and spans over multiple lines. Proper punctuation can avoid this confusion.
I can't find a guideline specific to JavaScript, but some Google style guides call this out explicitly, for instance:
“Comments should be as readable as narrative text, with proper capitalization and punctuation. In many cases, complete sentences are more readable than sentence fragments. Shorter comments, such as comments at the end of a line of code, can sometimes be less formal, but you should be consistent with your style.
Although it can be frustrating to have a code reviewer point out that you are using a comma when you should be using a semicolon, it is very important that source code maintain a high level of clarity and readability. Proper punctuation, spelling, and grammar help with that goal.”
https://google.github.io/styleguide/cppguide.html#Punctuation_Spelling_and_Grammar
function assertColorsEqual(ctx, colorGroup, description) {`description` is unused. Remove?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thank you for the feedback, I have updated the test file as suggested.
// Helper function to render a color and return its pixel value as rgba stringNit: consider ending comment sentences with a period. We often view one-line code snippets in tools like code search. Seeing this line without the next one might trick a reader into thinking that the sentence isn't complete and spans over multiple lines. Proper punctuation can avoid this confusion.
I can't find a guideline specific to JavaScript, but some Google style guides call this out explicitly, for instance:
“Comments should be as readable as narrative text, with proper capitalization and punctuation. In many cases, complete sentences are more readable than sentence fragments. Shorter comments, such as comments at the end of a line of code, can sometimes be less formal, but you should be consistent with your style.
Although it can be frustrating to have a code reviewer point out that you are using a comma when you should be using a semicolon, it is very important that source code maintain a high level of clarity and readability. Proper punctuation, spelling, and grammar help with that goal.”
https://google.github.io/styleguide/cppguide.html#Punctuation_Spelling_and_Grammar
Done
function assertColorsEqual(ctx, colorGroup, description) {Felipe Erias`description` is unused. Remove?
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Support unresolved calc() values in Canvas 2D color parsing
Add IsUnresolvedColorValue() check in canvas color parsing to properly
handle CSS color functions containing calc() expressions. Without this,
colors with calc() were being rendered inaccurately.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |