WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
142870
CSS Animations with triggers should map scroll position to duration
https://bugs.webkit.org/show_bug.cgi?id=142870
Summary
CSS Animations with triggers should map scroll position to duration
Dean Jackson
Reported
2015-03-19 11:26:37 PDT
Expose a prototype implementation of what will eventually be called animation-timebase, mapping the scroll location to the duration of an animation. This only applies if the animation has a start and end trigger.
Attachments
Patch
(17.74 KB, patch)
2015-03-19 15:42 PDT
,
Dean Jackson
simon.fraser
: review+
Details
Formatted Diff
Diff
Patch
(25.52 KB, patch)
2015-03-19 18:52 PDT
,
Dean Jackson
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-03-19 11:48:52 PDT
<
rdar://problem/20227244
>
Dean Jackson
Comment 2
2015-03-19 15:42:22 PDT
Created
attachment 249067
[details]
Patch
Simon Fraser (smfr)
Comment 3
2015-03-19 15:53:32 PDT
Comment on
attachment 249067
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=249067&action=review
> Source/WebCore/css/CSSToStyleMap.cpp:539 > + bool hasEnd = false;
I don't think you need the hasEnd variable.
> Source/WebCore/page/animation/AnimationBase.cpp:482 > + // time is determined by the scroll position.
We should stop calling this elapsedTime
> Source/WebCore/page/animation/AnimationBase.cpp:710 > + if (scrollTrigger.hasEndValue() && m_object) {
Can we make m_object a reference (later)?
> Source/WebCore/page/animation/AnimationBase.cpp:711 > + float offset = m_object->view().frameView().scrollOffsetForFixedPosition().height().toFloat();
I think we should snapshot the scroll position when we snapshot the animation time. Fetching it all over the place feels error-prone.
> Source/WebCore/page/animation/AnimationBase.cpp:718 > + return m_animation->duration() * (offset - startValue) / (endValue - startValue);
What if endValue == startValue? Please add a test for this case.
> Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:871 > + ScrollAnimationTrigger& scrollTrigger = downcast<ScrollAnimationTrigger>(*anim->trigger().get()); > + if (scrollTrigger.hasEndValue())
What about startValue?
Dean Jackson
Comment 4
2015-03-19 18:52:07 PDT
Created
attachment 249076
[details]
Patch
Dean Jackson
Comment 5
2015-03-19 18:52:20 PDT
Comment on
attachment 249067
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=249067&action=review
>> Source/WebCore/css/CSSToStyleMap.cpp:539 >> + bool hasEnd = false; > > I don't think you need the hasEnd variable.
I removed it but it means I have two calls to setTrigger, each side of the conditional.
>> Source/WebCore/page/animation/AnimationBase.cpp:482 >> + // time is determined by the scroll position. > > We should stop calling this elapsedTime
Agreed. I'll do that in a followup patch.
>> Source/WebCore/page/animation/AnimationBase.cpp:710 >> + if (scrollTrigger.hasEndValue() && m_object) { > > Can we make m_object a reference (later)?
Yes.
>> Source/WebCore/page/animation/AnimationBase.cpp:711 >> + float offset = m_object->view().frameView().scrollOffsetForFixedPosition().height().toFloat(); > > I think we should snapshot the scroll position when we snapshot the animation time. Fetching it all over the place feels error-prone.
Done
>> Source/WebCore/page/animation/AnimationBase.cpp:718 >> + return m_animation->duration() * (offset - startValue) / (endValue - startValue); > > What if endValue == startValue? > > Please add a test for this case.
OK!
Dean Jackson
Comment 6
2015-03-19 18:52:42 PDT
Checking the patch on EWS before landing.
WebKit Commit Bot
Comment 7
2015-03-19 18:54:40 PDT
Attachment 249076
[details]
did not pass style-queue: ERROR: Source/WebCore/css/CSSComputedStyleDeclaration.cpp:1241: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 1 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Dean Jackson
Comment 8
2015-03-19 21:48:38 PDT
Committed
r181778
: <
http://trac.webkit.org/changeset/181778
>
Alexey Proskuryakov
Comment 9
2015-03-20 10:28:22 PDT
(In reply to
comment #8
)
> Committed
r181778
: <
http://trac.webkit.org/changeset/181778
>
This broke animations/trigger-container-scroll-empty.html on Windows and EFL:
https://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=animations%2Ftrigger-container-scroll-empty.html
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug