[ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Mar 2019 00:15:11 +0000 (00:15 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Mar 2019 00:15:11 +0000 (00:15 +0000)
commit9ef2d6337a70ea0ce9d914768d2f3a0ec2e46d5d
treeccead5c194ccc968bc6543811777179b63b79381
parent237407ea7352303943b71df1de8d3c620f455d70
[ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
https://bugs.webkit.org/show_bug.cgi?id=195244
<rdar://problem/48536737>

Reviewed by Simon Fraser.

Source/WebCore:

Move state change handling code to adjustObservedState() and introduce signalContentChangeIfNeeded() to
let the client know about the state change (or lack of state change).

Test: fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingStyleRecalc):
(WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
(WebCore::ContentChangeObserver::didContentVisibilityChange):
(WebCore::ContentChangeObserver::addObservedDOMTimer):
(WebCore::ContentChangeObserver::removeObservedDOMTimer):
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::signalContentChangeIfNeeded):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
(WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.

LayoutTests:

* fast/events/touch/ios/visibility-change-happens-at-the-second-timer-expected.txt: Added.
* fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/touch/ios/visibility-change-happens-at-the-second-timer-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/ios/ContentChangeObserver.cpp
Source/WebCore/page/ios/ContentChangeObserver.h