[Web Animations] Throttle animations when lowPowerMode is on
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2018 16:35:32 +0000 (16:35 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2018 16:35:32 +0000 (16:35 +0000)
commit704d940a17990fe03c7e8232cfde6a08153640b5
tree762ab3aa8f3f2fcd4a51a047f9045adb34135cf5
parente0d30975b1637881222d990f807ba3f3e7392e90
[Web Animations] Throttle animations when lowPowerMode is on
https://bugs.webkit.org/show_bug.cgi?id=184540

Reviewed by Jon Lee.

Source/WebCore:

Ensure animations are sampled at a lower frequency when lowPowerMode is on.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateThrottlingState):
(WebCore::DocumentTimeline::animationInterval const):
(WebCore::DocumentTimeline::updateAnimationSchedule):
(WebCore::DocumentTimeline::scheduleAnimationResolution):
* animation/DocumentTimeline.h:
* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
* testing/Internals.cpp:
(WebCore::Internals::animationsInterval const):

LayoutTests:

Mark one more test as passing when the CSS Animations and CSS Transitions as Web Animations flag is on.

* fast/animation/css-animation-throttling-lowPowerMode.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/animation/css-animation-throttling-lowPowerMode.html
Source/WebCore/ChangeLog
Source/WebCore/animation/DocumentTimeline.cpp
Source/WebCore/animation/DocumentTimeline.h
Source/WebCore/page/Page.cpp
Source/WebCore/testing/Internals.cpp