-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[CSS Math Functions] NaN numeric representation should be 0 (not Infinity) #15677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CSS Math Functions] NaN numeric representation should be 0 (not Infinity) #15677
Conversation
EWS run on previous version of this PR (hash 394316e)
|
if (primitiveType() == CSSUnitType::CSS_DEG && (isnan(value) || isinf(value))) | ||
value = CSSCalcOperationNode::convertToTopLevelValue(value); | ||
// If an <angle> must be converted due to exceeding the implementation-defined range of supported values, | ||
// it must be clamped to the nearest supported multiple of 360deg. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is 0 the nearest supported multiple of 360deg to infinity and -infinity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it would be 360 or -360 which are equivalent to 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s not literally correct (360deg would not be the nearest multiple of 360deg to infinity), but if this is modulo 360deg then clearly any multiple is equivalent to 0deg. But that was not obvious to me.
394316e
to
9153ccd
Compare
EWS run on current version of this PR (hash 9153ccd)
|
…nity) https://bugs.webkit.org/show_bug.cgi?id=259034 rdar://111984451 Reviewed by Darin Adler. This changed in w3c/csswg-drafts@b5113b9 Discussion was at w3c/csswg-drafts#7067 * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-color-function-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-lab-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-color-function-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-lab-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-infinity-nan-computed-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-values/round-mod-rem-serialize-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-values/signs-abs-computed-expected.txt: * Source/WebCore/css/calc/CSSCalcOperationNode.h: * Source/WebCore/css/calc/CSSCalcValue.cpp: (WebCore::CSSCalcValue::clampToPermittedRange const): Canonical link: https://commits.webkit.org/265891@main
9153ccd
to
c7b1f51
Compare
Committed 265891@main (c7b1f51): https://commits.webkit.org/265891@main Reviewed commits have been landed. Closing PR #15677 and removing active labels. |
c7b1f51
9153ccd