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-easing-2] Implement linear(...) easing function for css animations #15936
Conversation
EWS run on previous version of this PR (hash 9c57df9) |
EWS run on previous version of this PR (hash bb428ce) |
|
||
bool CSSLinearTimingFunctionValue::equals(const CSSLinearTimingFunctionValue& other) const | ||
{ | ||
return m_points == other.m_points; |
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.
Does this actually check that the two Vector<LinearTimingFunction::Point>
s have the same values? I guess I'm asking what LinearTimingFunction::Point
is.
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.
LinearTimingFunction::Point
is basically a named tuple of double value
(i.e. what the transformed/animated value should be) and double progress
(i.e. at what point in the transition/animation). it has it's own operator==
so it should be using that to compare
lastPointIsExtraPoint = true; | ||
} | ||
} else if (steps.size() == 1) { | ||
largestInput = 0.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.
Is there a reason to do this? The first time through the loop will always run this code, so you could initialise largestInput
before.
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.
Oh no wait, I didn't read it properly. Only runs if you didn't get a percent value. Sorry.
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.
yeah this corresponds to step 4.4 of <https://drafts.csswg.org/css-easing-2/#linear-easing-function-parsing>
EWS run on previous version of this PR (hash dc3194a) |
EWS run on previous version of this PR (hash d35e129) |
EWS run on previous version of this PR (hash fd7bfc6) |
CSSParserTokenRange rangeCopy = range; | ||
CSSParserTokenRange args = consumeFunction(rangeCopy); |
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.
Can we use auto
?
EWS run on current version of this PR (hash 06346cb) |
https://bugs.webkit.org/show_bug.cgi?id=240061 <rdar://problem/93088094> Reviewed by Dean Jackson. Add support for the `linear()` CSS timing function <https://drafts.csswg.org/css-easing-2/#the-linear-easing-function>. * Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp: (WebCore::consumeLinear): Added. (WebCore::CSSPropertyParserHelpers::consumeTimingFunction): * Source/WebCore/css/ComputedStyleExtractor.cpp: (WebCore::valueForAnimationTimingFunction): Implement parsing logic for CSS `linear()` <https://drafts.csswg.org/css-easing-2/#linear-easing-function-parsing>. * Source/WebCore/platform/animation/TimingFunction.h: (WebCore::LinearTimingFunction::Point::operator== const): Added. (WebCore::LinearTimingFunction::create): Added. (WebCore::LinearTimingFunction::operator== const): Added. (WebCore::LinearTimingFunction::points const): Added. (WebCore::LinearTimingFunction::identity): Renamed from `sharedLinearTimingFunction`. (WebCore::LinearTimingFunction::LinearTimingFunction): Added. (WebCore::LinearTimingFunction::clone): * Source/WebCore/platform/animation/TimingFunction.cpp: (WebCore::operator<<): (WebCore::TimingFunction::transformProgress const): (WebCore::TimingFunction::createFromCSSValue): (WebCore::TimingFunction::cssText const): * Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in: * Source/WebCore/css/CSSTimingFunctionValue.h: (WebCore::CSSLinearTimingFunctionValue::create): Added. (WebCore::CSSLinearTimingFunctionValue::points const): Added. (WebCore::CSSLinearTimingFunctionValue::CSSLinearTimingFunctionValue): Added. * Source/WebCore/css/CSSTimingFunctionValue.cpp: (WebCore::CSSLinearTimingFunctionValue::customCSSText const): Added. (WebCore::CSSLinearTimingFunctionValue::equals const): Added. * Source/WebCore/css/CSSValue.h: (WebCore::CSSValue::isLinearTimingFunctionValue const): Added. * Source/WebCore/css/CSSValue.cpp: (WebCore::CSSValue::visitDerived): Add subclasses and member variables to support CSS `linear()`. Implement the logic to calculate the current value of a CSS `linear()` given the current progress <https://drafts.csswg.org/css-easing-2/#linear-easing-function-output>. * Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::keyframeValueListHasSingleIntervalWithLinearOrEquivalentTimingFunction): (WebCore::GraphicsLayerCA::timingFunctionForAnimationValue): * Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: (WebCore::toCAMediaTimingFunction): Use renamed `identity` instead of `sharedLinearTimingFunction` since `LinearTimingFunction` can now be more than just an identity function. * Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js: Add basic autocompletion support for `linear()` in Web Inspector. * LayoutTests/imported/w3c/web-platform-tests/css/css-easing/linear-timing-functions-output.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-easing/linear-timing-functions-output.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-easing/linear-timing-functions-syntax.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-easing/linear-timing-functions-syntax.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-easing/timing-functions-syntax-computed.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-easing/timing-functions-syntax-computed-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-easing/timing-functions-syntax-invalid.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-easing/timing-functions-syntax-invalid-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-easing/timing-functions-syntax-valid.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-easing/timing-functions-syntax-valid-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-easing/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/animations/transition-timing-function.html: * LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-timing-function-valid.html: * LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-timing-function-valid-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/transition-001.html: * LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/transition-001-expected.txt: Canonical link: https://commits.webkit.org/266195@main
06346cb
to
2b0ebfa
Compare
Committed 266195@main (2b0ebfa): https://commits.webkit.org/266195@main Reviewed commits have been landed. Closing PR #15936 and removing active labels. |
2b0ebfa
06346cb