Bug 238401 - Clamp degenerate calc() values for <angle>
Summary: Clamp degenerate calc() values for <angle>
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: Nikos Mouchtaris
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-25 17:54 PDT by Nikos Mouchtaris
Modified: 2022-03-28 18:18 PDT (History)
8 users (show)

See Also:


Attachments
Patch (5.85 KB, patch)
2022-03-25 22:49 PDT, Nikos Mouchtaris
simon.fraser: review+
Details | Formatted Diff | Diff
Patch (5.92 KB, patch)
2022-03-28 15:20 PDT, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Mouchtaris 2022-03-25 17:54:05 PDT
Clamp degenerate calc() values for <angle>
Comment 1 Nikos Mouchtaris 2022-03-25 22:49:31 PDT
Created attachment 455827 [details]
Patch
Comment 2 Simon Fraser (smfr) 2022-03-28 15:17:46 PDT
Comment on attachment 455827 [details]
Patch

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

> Source/WebCore/ChangeLog:8
> +        Clamp nan, infinity and -infinity to zero for <angle>.

Spec (or issue) link here please.

> Source/WebCore/css/calc/CSSCalcValue.cpp:329
> +    if (primitiveType() == CSSUnitType::CSS_DEG && (isnan(value) || isinf(value)))
> +        return 0;

Are we always CSS_DEG here because of canonicalization, or can we end up here with CSS_RAD, CSS_GRAD etc?
Comment 3 Nikos Mouchtaris 2022-03-28 15:20:25 PDT
Created attachment 455962 [details]
Patch
Comment 4 Nikos Mouchtaris 2022-03-28 15:21:20 PDT
(In reply to Simon Fraser (smfr) from comment #2)
> Comment on attachment 455827 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=455827&action=review
> 
> > Source/WebCore/ChangeLog:8
> > +        Clamp nan, infinity and -infinity to zero for <angle>.
> 
> Spec (or issue) link here please.
Added GitHub issue link.
> 
> > Source/WebCore/css/calc/CSSCalcValue.cpp:329
> > +    if (primitiveType() == CSSUnitType::CSS_DEG && (isnan(value) || isinf(value)))
> > +        return 0;
> 
> Are we always CSS_DEG here because of canonicalization, or can we end up
> here with CSS_RAD, CSS_GRAD etc?
Yes it will always be CSS_DEG due to canonicalization. Test covers this.
Comment 5 EWS 2022-03-28 18:17:42 PDT
Committed r292018 (248962@main): <https://commits.webkit.org/248962@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 455962 [details].
Comment 6 Radar WebKit Bug Importer 2022-03-28 18:18:15 PDT
<rdar://problem/90957174>