Skip to content
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

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Nov 27, 2023

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}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a 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.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-5062788 branch 4 times, most recently from 94365ae to 2d91ab2 Compare November 27, 2023 17:16
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}
@emilio
Copy link
Contributor

emilio commented Dec 1, 2023

@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?

@emilio
Copy link
Contributor

emilio commented Dec 1, 2023

cc @nt1m

@danielsakhapov
Copy link
Contributor

Yes, I agree, I'll revert the test change, sorry for that.
But don't you think it makes sense not to have parentheses in this case?

@emilio
Copy link
Contributor

emilio commented Dec 2, 2023

Maybe? It's weird to account for operand priority but could be done. Maybe file a spec issue?

chromium-wpt-export-bot pushed a commit that referenced this pull request Dec 5, 2023
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
aarongable pushed a commit to chromium/chromium that referenced this pull request Dec 5, 2023
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}
chromium-wpt-export-bot pushed a commit that referenced this pull request Dec 5, 2023
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}
chromium-wpt-export-bot pushed a commit that referenced this pull request Dec 5, 2023
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}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Dec 14, 2023
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Dec 16, 2023
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Dec 16, 2023
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Dec 16, 2023
…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
aosmond pushed a commit to aosmond/gecko that referenced this pull request Dec 16, 2023
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants