-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Change parentheses condition for css math serialization #43364
Conversation
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.
The review process for this patch is being conducted in the Chromium project.
94365ae
to
2d91ab2
Compare
Previously the condition for adding parentheses for serialization was vast and caused every arithmetic operation to be in parentheses. With time a lot of simplifications were added and now the only case where we can end up with parentheses is when either operand of the multiplication/division is unsimplified add/sub node: (lhs as unsimplified add/sub) [* or /] rhs or lhs [* or /] (rhs as unsimplified add/sub). Change-Id: I7a4d881357205b8c317029cb2c65548a2a39a80f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5062788 Commit-Queue: Daniil Sakhapov <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/main@{#1230040}
2d91ab2
to
fa5ecc7
Compare
@danielsakhapov I believe the new test expectation is invalid per https://drafts.csswg.org/css-values/#serialize-a-calculation-tree, and Firefox and Safari are correct. Can you confirm? |
cc @nt1m |
Yes, I agree, I'll revert the test change, sorry for that. |
Maybe? It's weird to account for operand priority but could be done. Maybe file a spec issue? |
Add parentheses around multiplication operation as per spec: https://drafts.csswg.org/css-values/#serialize-a-calculation-tree we should add parentheses around the product node. Github discussion: #43364 Change-Id: I7879bfc2cc62af63dd7598d380e10e96426ff5dd
Add parentheses around multiplication operation as per spec: https://drafts.csswg.org/css-values/#serialize-a-calculation-tree we should add parentheses around the product node. Github discussion: web-platform-tests/wpt#43364 Change-Id: I7879bfc2cc62af63dd7598d380e10e96426ff5dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5087987 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Daniil Sakhapov <[email protected]> Cr-Commit-Position: refs/heads/main@{#1233345}
Add parentheses around multiplication operation as per spec: https://drafts.csswg.org/css-values/#serialize-a-calculation-tree we should add parentheses around the product node. Github discussion: #43364 Change-Id: I7879bfc2cc62af63dd7598d380e10e96426ff5dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5087987 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Daniil Sakhapov <[email protected]> Cr-Commit-Position: refs/heads/main@{#1233345}
Add parentheses around multiplication operation as per spec: https://drafts.csswg.org/css-values/#serialize-a-calculation-tree we should add parentheses around the product node. Github discussion: #43364 Change-Id: I7879bfc2cc62af63dd7598d380e10e96426ff5dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5087987 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Daniil Sakhapov <[email protected]> Cr-Commit-Position: refs/heads/main@{#1233345}
…s serialization test, a=testonly Automatic update from web-platform-tests Change parentheses for css math functions serialization test Add parentheses around multiplication operation as per spec: https://drafts.csswg.org/css-values/#serialize-a-calculation-tree we should add parentheses around the product node. Github discussion: web-platform-tests/wpt#43364 Change-Id: I7879bfc2cc62af63dd7598d380e10e96426ff5dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5087987 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Daniil Sakhapov <[email protected]> Cr-Commit-Position: refs/heads/main@{#1233345} -- wpt-commits: 27ed8f45421a9329cb918aa82c3c22f634925061 wpt-pr: 43513
…s serialization test, a=testonly Automatic update from web-platform-tests Change parentheses for css math functions serialization test Add parentheses around multiplication operation as per spec: https://drafts.csswg.org/css-values/#serialize-a-calculation-tree we should add parentheses around the product node. Github discussion: web-platform-tests/wpt#43364 Change-Id: I7879bfc2cc62af63dd7598d380e10e96426ff5dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5087987 Reviewed-by: Anders Hartvoll Ruud <andruudchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> Cr-Commit-Position: refs/heads/main{#1233345} -- wpt-commits: 27ed8f45421a9329cb918aa82c3c22f634925061 wpt-pr: 43513 UltraBlame original commit: 2047dad9ea5945b66b3c548e8e56391b3528568d
…s serialization test, a=testonly Automatic update from web-platform-tests Change parentheses for css math functions serialization test Add parentheses around multiplication operation as per spec: https://drafts.csswg.org/css-values/#serialize-a-calculation-tree we should add parentheses around the product node. Github discussion: web-platform-tests/wpt#43364 Change-Id: I7879bfc2cc62af63dd7598d380e10e96426ff5dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5087987 Reviewed-by: Anders Hartvoll Ruud <andruudchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> Cr-Commit-Position: refs/heads/main{#1233345} -- wpt-commits: 27ed8f45421a9329cb918aa82c3c22f634925061 wpt-pr: 43513 UltraBlame original commit: 2047dad9ea5945b66b3c548e8e56391b3528568d
…s serialization test, a=testonly Automatic update from web-platform-tests Change parentheses for css math functions serialization test Add parentheses around multiplication operation as per spec: https://drafts.csswg.org/css-values/#serialize-a-calculation-tree we should add parentheses around the product node. Github discussion: web-platform-tests/wpt#43364 Change-Id: I7879bfc2cc62af63dd7598d380e10e96426ff5dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5087987 Reviewed-by: Anders Hartvoll Ruud <andruudchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> Cr-Commit-Position: refs/heads/main{#1233345} -- wpt-commits: 27ed8f45421a9329cb918aa82c3c22f634925061 wpt-pr: 43513 UltraBlame original commit: 2047dad9ea5945b66b3c548e8e56391b3528568d
…s serialization test, a=testonly Automatic update from web-platform-tests Change parentheses for css math functions serialization test Add parentheses around multiplication operation as per spec: https://drafts.csswg.org/css-values/#serialize-a-calculation-tree we should add parentheses around the product node. Github discussion: web-platform-tests/wpt#43364 Change-Id: I7879bfc2cc62af63dd7598d380e10e96426ff5dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5087987 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Daniil Sakhapov <[email protected]> Cr-Commit-Position: refs/heads/main@{#1233345} -- wpt-commits: 27ed8f45421a9329cb918aa82c3c22f634925061 wpt-pr: 43513
Previously the condition for adding parentheses for serialization
was vast and caused every arithmetic operation to be in parentheses.
With time a lot of simplifications were added and now the only case
where we can end up with parentheses is when either operand
of the multiplication/division is unsimplified add/sub node:
(lhs as unsimplified add/sub) [* or /] rhs
or
lhs [* or /] (rhs as unsimplified add/sub).
Change-Id: I7a4d881357205b8c317029cb2c65548a2a39a80f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5062788
Commit-Queue: Daniil Sakhapov <[email protected]>
Reviewed-by: Anders Hartvoll Ruud <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1230040}