haikuwebkit/LayoutTests/intersection-observer/intersection-observer-callb...

12 lines
360 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 the IntersectionObserver timestamp is the same as the timestamp of the rAF callback.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Math.round(animateTimestamp) is Math.round(intersectTimestamp)
PASS Math.round(animateTimestamp) is Math.round(intersectTimestamp)
PASS successfullyParsed is true
TEST COMPLETE