[ContentChangeObserver] Introduce fixed duration content observation
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 00:43:41 +0000 (00:43 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 00:43:41 +0000 (00:43 +0000)
commit090d8f89e032ec9c225653ac1addaca40b0a7733
treedb742345059efef4d29458f7e1abb13e025fac9f
parentdaecc9d193c0005e320eb4386bc0ff69dd2a45b6
[ContentChangeObserver] Introduce fixed duration content observation
https://bugs.webkit.org/show_bug.cgi?id=195295
<rdar://problem/48579913>

Reviewed by Simon Fraser.

Source/WebCore:

Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
we stop observing for content changes before they even get fired.

Test: fast/events/touch/ios/visibility-change-happens-on-timer-hops.html

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::ContentChangeObserver):
(WebCore::ContentChangeObserver::startContentObservationForDuration):
(WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
(WebCore::ContentChangeObserver::hasDeterminateState const):
(WebCore::ContentChangeObserver::adjustObservedState):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isObservingContentChanges const):
(WebCore::ContentChangeObserver::hasPendingActivity const):

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):

LayoutTests:

* fast/events/touch/ios/visibility-change-happens-on-timer-hops-expected.txt: Added.
* fast/events/touch/ios/visibility-change-happens-on-timer-hops.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/touch/ios/visibility-change-happens-on-timer-hops-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/visibility-change-happens-on-timer-hops.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/ios/ContentChangeObserver.cpp
Source/WebCore/page/ios/ContentChangeObserver.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm