haikuwebkit/LayoutTests/animations/animation-callback-timestam...

20 lines
914 B
Plaintext
Raw Permalink Normal View History

Timestamps should be the same for all rendering update steps https://bugs.webkit.org/show_bug.cgi?id=207153 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-04-27 Reviewed by Simon Fraser. Source/WebCore: The HTML 5 event loop sepcs states that timestamps should be the same for all rendering update steps. Specs link (step 9): https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model This patch also fixes some issues in IntersectionObserver. Test: intersection-observer/intersection-observer-callback-timestamp.html * dom/Document.cpp: (WebCore::Document::updateIntersectionObservations): (WebCore::Document::notifyIntersectionObserversTimerFired): Deleted. * dom/Document.h: -- Handle the case when two floats are areEssentiallyEqual(). -- Execute the IntersectionObserver immediately and do not wait until the next CFRunLoop event since this does not implement the specs. * page/DOMWindow.cpp: (WebCore::DOMWindow::freezeNowTimestamp): (WebCore::DOMWindow::unfreezeNowTimestamp): (WebCore::DOMWindow::frozenNowTimestamp const): * page/DOMWindow.h: Provide a frozen now() timestamp in seconds to be used internally only. * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::nowTimestamp const): Use the frozenNowTimestamp(). * page/Page.cpp: (WebCore::Page::updateRendering): Freeze the timestamps while serving the rendering update steps. LayoutTests: * animations/animation-callback-timestamp-expected.txt: * animations/animation-callback-timestamp.html: Ensure the rAF callback timestamp is less than Performance.now(). * animations/animation-multiple-callbacks-timestamp-expected.txt: * animations/animation-multiple-callbacks-timestamp.html: Ensure the rAF callbacks receive the same timestamps. * intersection-observer/intersection-observer-callback-timestamp-expected.txt: Added. * intersection-observer/intersection-observer-callback-timestamp.html: Added. A new test to ensure the IntersectionObsever and the rAF callbacks receive the same timestamps. * platform/ios-wk2/TestExpectations: * platform/mac-wk1/TestExpectations: Canonical link: https://commits.webkit.org/223995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-28 00:22:49 +00:00
Test performance.now() is at least as the timestamp the rAF callback.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Math.round(window.performance.now()) is >= Math.round(timestamp1)
PASS Math.round(window.performance.now()) is >= Math.round(timestamp1)
PASS Math.round(window.performance.now()) is >= Math.round(timestamp1)
PASS Math.round(window.performance.now()) is >= Math.round(timestamp1)
PASS Math.round(window.performance.now()) is >= Math.round(timestamp1)
PASS Math.round(window.performance.now()) is >= Math.round(timestamp1)
PASS Math.round(window.performance.now()) is >= Math.round(timestamp1)
PASS Math.round(window.performance.now()) is >= Math.round(timestamp1)
PASS Math.round(window.performance.now()) is >= Math.round(timestamp1)
PASS Math.round(window.performance.now()) is >= Math.round(timestamp1)
requestFrameAnimation() callback timestamp should be very close to Performance.now() https://bugs.webkit.org/show_bug.cgi?id=159038 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-06-23 Reviewed by Simon Fraser. Source/WebCore: Pass the Performance.now() to requestFrameAnimation() callback. Do not add the timeUntilOutput which is the difference between outputTime and now since this addition makes us report a timestamp ahead in the future by almost 33ms. A new function named "nowTimestamp()" is added to the DOMWindow class. It calls Performance.now() if WEB_TIMING is enabled, otherwise it calls monotonicallyIncreasingTime(). The returned timestamp is seconds and it is relative to the document loading time. The timestamp passing will be removed all the down till the callers of ScriptedAnimationController::serviceScriptedAnimations(). The callers will getting the now timestamp by calling DOMWindow::nowTimestamp(). Tests: animations/animation-callback-timestamp.html animations/animation-multiple-callbacks-timestamp.html * dom/Document.cpp: (WebCore::Document::monotonicTimestamp): (WebCore::Document::serviceScriptedAnimations): * dom/Document.h: * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::serviceScriptedAnimations): (WebCore::ScriptedAnimationController::animationTimerFired): (WebCore::ScriptedAnimationController::displayRefreshFired): * dom/ScriptedAnimationController.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::getVideoPlaybackQuality): * loader/DocumentLoadTiming.h: (WebCore::DocumentLoadTiming::referenceWallTime): * page/DOMWindow.cpp: (WebCore::DOMWindow::nowTimestamp): * page/DOMWindow.h: * page/FrameView.cpp: (WebCore::FrameView::serviceScriptedAnimations): * page/FrameView.h: * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitor::DisplayRefreshMonitor): (WebCore::DisplayRefreshMonitor::displayDidRefresh): * platform/graphics/DisplayRefreshMonitor.h: (WebCore::DisplayRefreshMonitor::setMonotonicAnimationStartTime): Deleted. * platform/graphics/DisplayRefreshMonitorClient.cpp: (WebCore::DisplayRefreshMonitorClient::fireDisplayRefreshIfNeeded): * platform/graphics/DisplayRefreshMonitorClient.h: * platform/graphics/GraphicsLayerUpdater.cpp: (WebCore::GraphicsLayerUpdater::displayRefreshFired): * platform/graphics/GraphicsLayerUpdater.h: * platform/graphics/ios/DisplayRefreshMonitorIOS.h: * platform/graphics/ios/DisplayRefreshMonitorIOS.mm: (-[WebDisplayLinkHandler handleDisplayLink:]): (WebCore::DisplayRefreshMonitorIOS::displayLinkFired): (WebCore::mediaTimeToCurrentTime): Deleted. * platform/graphics/mac/DisplayRefreshMonitorMac.cpp: (WebCore::displayLinkCallback): (WebCore::DisplayRefreshMonitorMac::displayLinkFired): * platform/graphics/mac/DisplayRefreshMonitorMac.h: * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp: (WebCore::CompositingCoordinator::syncDisplayState): (WebCore::CompositingCoordinator::nextAnimationServiceTime): Source/WebKit2: * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm: (WebKit::RemoteLayerTreeDisplayRefreshMonitor::didUpdateLayers): LayoutTests: * animations/animation-callback-timestamp-expected.txt: Added. * animations/animation-callback-timestamp.html: Added. * animations/animation-multiple-callbacks-timestamp-expected.txt: Added. * animations/animation-multiple-callbacks-timestamp.html: Added. Canonical link: https://commits.webkit.org/177159@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-23 22:46:28 +00:00
PASS successfullyParsed is true
TEST COMPLETE