Clamp degenerate calc() values for <angle>
Created attachment 455827 [details] Patch
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?
Created attachment 455962 [details] Patch
(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.
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].
<rdar://problem/90957174>