Content-Length: 356502 | pFad | http://github.com/WebKit/WebKit/pull/15677

D7 [CSS Math Functions] NaN numeric representation should be 0 (not Infinity) by nt1m · Pull Request #15677 · WebKit/WebKit · GitHub
Skip to content

[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

Conversation

nt1m
Copy link
Member

@nt1m nt1m commented Jul 9, 2023

c7b1f51

[CSS Math Functions] NaN numeric representation should be 0 (not Infinity)
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

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🛠 gtk
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🧪 gtk-wk2
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2
✅ 🛠 tv-sim
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@nt1m nt1m self-assigned this Jul 9, 2023
@nt1m nt1m added the CSS Cascading Style Sheets implementation label Jul 9, 2023
@nt1m nt1m requested review from darinadler, smfr, nmoucht and anttijk July 9, 2023 21:13
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.
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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.

@nt1m nt1m added the merge-queue Applied to send a pull request to merge-queue label Jul 9, 2023
@webkit-ews-buildbot webkit-ews-buildbot added merging-blocked Applied to prevent a change from being merged and removed merge-queue Applied to send a pull request to merge-queue labels Jul 9, 2023
@nt1m nt1m removed the merging-blocked Applied to prevent a change from being merged label Jul 9, 2023
@nt1m nt1m force-pushed the eng/CSS-Math-Functions-NaN-numeric-representation-should-be-0-not-Infinity branch from 394316e to 9153ccd Compare July 9, 2023 22:40
@nt1m nt1m added the merge-queue Applied to send a pull request to merge-queue label Jul 9, 2023
…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
@webkit-commit-queue webkit-commit-queue force-pushed the eng/CSS-Math-Functions-NaN-numeric-representation-should-be-0-not-Infinity branch from 9153ccd to c7b1f51 Compare July 9, 2023 23:44
@webkit-commit-queue
Copy link
Collaborator

Committed 265891@main (c7b1f51): https://commits.webkit.org/265891@main

Reviewed commits have been landed. Closing PR #15677 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit c7b1f51 into WebKit:main Jul 9, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jul 9, 2023
@nt1m nt1m deleted the eng/CSS-Math-Functions-NaN-numeric-representation-should-be-0-not-Infinity branch July 9, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Cascading Style Sheets implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/WebKit/WebKit/pull/15677

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy