Invert random() caching behavior to match spec#61964
Merged
Merged
Conversation
Collaborator
|
EWS run on current version of this PR (hash 8b17a7c) Details
|
weinig
approved these changes
Apr 3, 2026
nt1m
reviewed
Apr 3, 2026
| return { }; | ||
|
|
||
| guard.commit(); | ||
|
|
||
| return Random::SharingOptions { | ||
| .identifier = identifier.value_or(makeRandomSharingAuto(state)), | ||
| .elementShared = elementShared | ||
| .identifier = identifier.value_or(AtomString { }), |
Member
There was a problem hiding this comment.
nullString() might be more explicit
Contributor
Author
There was a problem hiding this comment.
That seems like an improvement. I will fix it in a follow-up along with some other cleanup that I think should happen here.
https://bugs.webkit.org/show_bug.cgi?id=311355 rdar://173943833 Reviewed by Sam Weinig. The CSS spec for random() changed so that the `--foo` in `random(--foo)` is matched globally to the document rather than scoped to the element. This is the opposite of the behavior implemented in WebKit, so invert the behavior and update the keyword to match. * LayoutTests/imported/w3c/web-platform-tests/css/css-values/random-computed.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-values/random-computed.tentative.html: * LayoutTests/imported/w3c/web-platform-tests/css/css-values/random-serialize.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-values/random-serialize.tentative.html: * Source/WebCore/css/CSSValueKeywords.in: * Source/WebCore/css/calc/CSSCalcTree+Evaluation.cpp: (WebCore::CSSCalc::evaluate): * Source/WebCore/css/calc/CSSCalcTree+Parser.cpp: (WebCore::CSSCalc::consumeOptionalRandomSharingOptions): (WebCore::CSSCalc::consumeOptionalRandomSharing): (WebCore::CSSCalc::consumeRandom): * Source/WebCore/css/calc/CSSCalcTree+Serialization.cpp: (WebCore::CSSCalc::serializeMathFunctionArguments): * Source/WebCore/css/calc/CSSCalcTree+Simplification.cpp: (WebCore::CSSCalc::simplify): * Source/WebCore/css/calc/CSSCalcTree.h: * Source/WebCore/style/StyleBuilderState.cpp: (WebCore::Style::BuilderState::lookupCSSRandomBaseValue const): * Source/WebCore/style/StyleBuilderState.h: * Source/WebCore/style/calc/StyleCalculationTree+Conversion.cpp: (WebCore::Style::Calculation::toStyle): Canonical link: https://commits.webkit.org/310532@main
8b17a7c to
e3d530f
Compare
Collaborator
|
Committed 310532@main (e3d530f): https://commits.webkit.org/310532@main Reviewed commits have been landed. Closing PR #61964 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
e3d530f
8b17a7c